Changeset e63e74a in mainline for uspace/lib/tbarcfg/test/tbarcfg.c
- Timestamp:
- 2024-02-21T20:26:35Z (12 months ago)
- Branches:
- master
- Children:
- 95e2967
- Parents:
- 5f3188b8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/tbarcfg/test/tbarcfg.c
r5f3188b8 re63e74a 135 135 } 136 136 137 /** Separator entry */ 138 PCUT_TEST(separator) 139 { 140 errno_t rc; 141 tbarcfg_t *tbcfg; 142 char fname[L_tmpnam], *p; 143 const char *caption; 144 const char *cmd; 145 smenu_entry_t *e1 = NULL, *e2 = NULL; 146 smenu_entry_t *e; 147 148 p = tmpnam(fname); 149 PCUT_ASSERT_NOT_NULL(p); 150 151 rc = tbarcfg_create(fname, &tbcfg); 152 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 153 154 rc = smenu_entry_create(tbcfg, "A", "a", false, &e1); 155 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 156 PCUT_ASSERT_NOT_NULL(e1); 157 158 rc = smenu_entry_sep_create(tbcfg, &e2); 159 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 160 PCUT_ASSERT_NOT_NULL(e2); 161 162 PCUT_ASSERT_FALSE(smenu_entry_get_separator(e1)); 163 PCUT_ASSERT_TRUE(smenu_entry_get_separator(e2)); 164 165 tbarcfg_close(tbcfg); 166 167 /* Re-open repository */ 168 169 rc = tbarcfg_open(fname, &tbcfg); 170 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 171 172 e = tbarcfg_smenu_first(tbcfg); 173 PCUT_ASSERT_NOT_NULL(e); 174 175 /* Check that new values of properties have persisted */ 176 PCUT_ASSERT_FALSE(smenu_entry_get_separator(e)); 177 caption = smenu_entry_get_caption(e); 178 PCUT_ASSERT_STR_EQUALS("A", caption); 179 cmd = smenu_entry_get_cmd(e); 180 PCUT_ASSERT_STR_EQUALS("a", cmd); 181 182 e = tbarcfg_smenu_next(e); 183 184 /* Check that entry is still a separator */ 185 PCUT_ASSERT_TRUE(smenu_entry_get_separator(e)); 186 187 tbarcfg_close(tbcfg); 188 remove(fname); 189 } 190 137 191 /** Getting menu entry properties */ 138 192 PCUT_TEST(get_caption_cmd_term)
Note:
See TracChangeset
for help on using the changeset viewer.