Changeset ee3b28a9 in mainline for uspace/lib/tbarcfg/test/tbarcfg.c
- Timestamp:
- 2024-02-26T13:30:48Z (12 months ago)
- Branches:
- master
- Children:
- d92b8e8f
- Parents:
- 90ba06c
- git-author:
- Jiri Svoboda <jiri@…> (2024-02-25 16:12:29)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-02-26 13:30:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/tbarcfg/test/tbarcfg.c
r90ba06c ree3b28a9 30 30 #include <pcut/pcut.h> 31 31 #include <tbarcfg/tbarcfg.h> 32 #include <stdbool.h> 32 33 #include <stdio.h> 33 34 … … 35 36 36 37 PCUT_TEST_SUITE(tbarcfg); 38 39 typedef struct { 40 bool notified; 41 } tbarcfg_test_resp_t; 42 43 static void test_cb(void *); 37 44 38 45 /** Creating, opening and closing taskbar configuration */ … … 554 561 } 555 562 563 /** Notifications can be delivered from tbarcfg_notify() to a listener. */ 564 PCUT_TEST(notify) 565 { 566 errno_t rc; 567 tbarcfg_listener_t *lst; 568 tbarcfg_test_resp_t test_resp; 569 570 test_resp.notified = false; 571 572 printf("create listener resp=%p\n", (void *)&test_resp); 573 rc = tbarcfg_listener_create(TBARCFG_NOTIFY_DEFAULT, 574 test_cb, &test_resp, &lst); 575 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 576 577 rc = tbarcfg_notify(TBARCFG_NOTIFY_DEFAULT); 578 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 579 580 PCUT_ASSERT_TRUE(test_resp.notified); 581 tbarcfg_listener_destroy(lst); 582 } 583 584 static void test_cb(void *arg) 585 { 586 tbarcfg_test_resp_t *resp = (tbarcfg_test_resp_t *)arg; 587 588 printf("test_cb: executing resp=%p\n", (void *)resp); 589 resp->notified = true; 590 } 591 556 592 PCUT_EXPORT(tbarcfg);
Note:
See TracChangeset
for help on using the changeset viewer.