Index: uspace/lib/tbarcfg/test/tbarcfg.c
===================================================================
--- uspace/lib/tbarcfg/test/tbarcfg.c	(revision 95fc53875f15bdcac192800f4c03f0faf5c46efb)
+++ uspace/lib/tbarcfg/test/tbarcfg.c	(revision 84d29a2469f6e9f8b8996192f61028dba140b6e7)
@@ -36,25 +36,27 @@
 PCUT_TEST_SUITE(tbarcfg);
 
-/** Opening and closing taskbar configuration */
-PCUT_TEST(open_close)
-{
-	errno_t rc;
-	tbarcfg_t *tbcfg;
-	FILE *f;
-	int rv;
-
-	f = fopen("/tmp/test", "wt");
-	PCUT_ASSERT_NOT_NULL(f);
-
-	rv = fputs("[sif](){[entries](){}}", f);
-	PCUT_ASSERT_TRUE(rv >= 0);
-
-	rv = fclose(f);
-	PCUT_ASSERT_INT_EQUALS(0, rv);
-
-	rc = tbarcfg_open("/tmp/test", &tbcfg);
-	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
-
-	tbarcfg_close(tbcfg);
+/** Creating, opening and closing taskbar configuration */
+PCUT_TEST(create_open_close)
+{
+	errno_t rc;
+	tbarcfg_t *tbcfg;
+	char fname[L_tmpnam], *p;
+
+	p = tmpnam(fname);
+	PCUT_ASSERT_NOT_NULL(p);
+
+	/* Create new repository */
+	rc = tbarcfg_create(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tbarcfg_close(tbcfg);
+
+	/* Re-open the repository */
+
+	rc = tbarcfg_open(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	tbarcfg_close(tbcfg);
+	remove(fname);
 }
 
@@ -64,21 +66,17 @@
 	errno_t rc;
 	tbarcfg_t *tbcfg;
-	smenu_entry_t *e;
-	FILE *f;
-	int rv;
-
-	f = fopen("/tmp/test", "wt");
-	PCUT_ASSERT_NOT_NULL(f);
-
-	rv = fputs("[sif](){[entries](){"
-	    "[entry]([caption]=[A][cmd]=[a]){}"
-	    "[entry]([caption]=[B][cmd]=[b]){}"
-	    "}}", f);
-	PCUT_ASSERT_TRUE(rv >= 0);
-
-	rv = fclose(f);
-	PCUT_ASSERT_INT_EQUALS(0, rv);
-
-	rc = tbarcfg_open("/tmp/test", &tbcfg);
+	char fname[L_tmpnam], *p;
+	smenu_entry_t *e;
+
+	p = tmpnam(fname);
+	PCUT_ASSERT_NOT_NULL(p);
+
+	rc = tbarcfg_create(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = smenu_entry_create(tbcfg, "A", "a");
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = smenu_entry_create(tbcfg, "B", "b");
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -91,4 +89,5 @@
 
 	tbarcfg_close(tbcfg);
+	remove(fname);
 }
 
@@ -98,22 +97,16 @@
 	errno_t rc;
 	tbarcfg_t *tbcfg;
+	char fname[L_tmpnam], *p;
 	smenu_entry_t *e;
 	const char *caption;
 	const char *cmd;
-	FILE *f;
-	int rv;
-
-	f = fopen("/tmp/test", "wt");
-	PCUT_ASSERT_NOT_NULL(f);
-
-	rv = fputs("[sif](){[entries](){"
-	    "[entry]([caption]=[A][cmd]=[a]){}"
-	    "}}", f);
-	PCUT_ASSERT_TRUE(rv >= 0);
-
-	rv = fclose(f);
-	PCUT_ASSERT_INT_EQUALS(0, rv);
-
-	rc = tbarcfg_open("/tmp/test", &tbcfg);
+
+	p = tmpnam(fname);
+	PCUT_ASSERT_NOT_NULL(p);
+
+	rc = tbarcfg_create(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = smenu_entry_create(tbcfg, "A", "a");
 	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
 
@@ -127,4 +120,98 @@
 
 	tbarcfg_close(tbcfg);
+	remove(fname);
+}
+
+/** Setting menu entry properties */
+PCUT_TEST(set_caption_cmd)
+{
+	errno_t rc;
+	tbarcfg_t *tbcfg;
+	char fname[L_tmpnam], *p;
+	smenu_entry_t *e;
+	const char *caption;
+	const char *cmd;
+
+	p = tmpnam(fname);
+	PCUT_ASSERT_NOT_NULL(p);
+
+	rc = tbarcfg_create(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = smenu_entry_create(tbcfg, "A", "a");
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	e = tbarcfg_smenu_first(tbcfg);
+	PCUT_ASSERT_NOT_NULL(e);
+
+	caption = smenu_entry_get_caption(e);
+	PCUT_ASSERT_STR_EQUALS("A", caption);
+	cmd = smenu_entry_get_cmd(e);
+	PCUT_ASSERT_STR_EQUALS("a", cmd);
+
+	/* Set properties */
+	rc = smenu_entry_set_caption(e, "B");
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+	rc = smenu_entry_set_cmd(e, "b");
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = smenu_entry_save(e);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	/* Check that properties have been set */
+	caption = smenu_entry_get_caption(e);
+	PCUT_ASSERT_STR_EQUALS("B", caption);
+	cmd = smenu_entry_get_cmd(e);
+	PCUT_ASSERT_STR_EQUALS("b", cmd);
+
+	tbarcfg_close(tbcfg);
+
+	/* Re-open repository */
+
+	rc = tbarcfg_open(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	e = tbarcfg_smenu_first(tbcfg);
+	PCUT_ASSERT_NOT_NULL(e);
+
+	/* Check that new values of properties have persisted */
+	caption = smenu_entry_get_caption(e);
+	PCUT_ASSERT_STR_EQUALS("B", caption);
+	cmd = smenu_entry_get_cmd(e);
+	PCUT_ASSERT_STR_EQUALS("b", cmd);
+
+	tbarcfg_close(tbcfg);
+	remove(fname);
+}
+
+/** Create start menu entry */
+PCUT_TEST(entry_create)
+{
+	errno_t rc;
+	tbarcfg_t *tbcfg;
+	char fname[L_tmpnam], *p;
+	smenu_entry_t *e;
+	const char *caption;
+	const char *cmd;
+
+	p = tmpnam(fname);
+	PCUT_ASSERT_NOT_NULL(p);
+
+	rc = tbarcfg_create(fname, &tbcfg);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = smenu_entry_create(tbcfg, "A", "a");
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	e = tbarcfg_smenu_first(tbcfg);
+	PCUT_ASSERT_NOT_NULL(e);
+
+	caption = smenu_entry_get_caption(e);
+	PCUT_ASSERT_STR_EQUALS("A", caption);
+	cmd = smenu_entry_get_cmd(e);
+	PCUT_ASSERT_STR_EQUALS("a", cmd);
+
+	tbarcfg_close(tbcfg);
+	remove(fname);
 }
 
