Ignore:
Timestamp:
2025-03-06T14:35:33Z (4 days ago)
Author:
Matěj Volf <git@…>
Children:
af28af6
Parents:
7064e71
git-author:
Matěj Volf <git@…> (2025-03-05 23:13:58)
git-committer:
Matěj Volf <git@…> (2025-03-06 14:35:33)
Message:

fix ccheck

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/test/fibril/exit_hook.c

    r7064e71 r25ee7ec5  
    3636static int value;
    3737
    38 static void exit_hook(void) {
    39     value = 5;
     38static void exit_hook(void)
     39{
     40        value = 5;
    4041}
    4142
    42 static errno_t fibril_basic(void* _arg) {
    43     fibril_add_exit_hook(exit_hook);
    44     return EOK;
     43static errno_t fibril_basic(void *_arg)
     44{
     45        fibril_add_exit_hook(exit_hook);
     46        return EOK;
    4547}
    4648
    47 PCUT_TEST(exit_hook_basic) {
    48     value = 0;
    49     fid_t other = fibril_create(fibril_basic, NULL);
    50     fibril_start(other);
     49PCUT_TEST(exit_hook_basic)
     50{
     51        value = 0;
     52        fid_t other = fibril_create(fibril_basic, NULL);
     53        fibril_start(other);
    5154
    52     fibril_yield();
     55        fibril_yield();
    5356
    54     PCUT_ASSERT_INT_EQUALS(5, value);
     57        PCUT_ASSERT_INT_EQUALS(5, value);
    5558}
    5659
    5760/*
    58 static errno_t fibril_to_be_killed(void* _arg) {
    59     fibril_add_exit_hook(exit_hook);
    60 
    61     while (true)
    62         firbil_yield();
    63 
    64     assert(0 && "unreachable");
    65 }
    66 
    67 PCUT_TEST(exit_hook_kill) {
    68     value = 0;
    69     fid_t other = fibril_create(fibril_to_be_killed, NULL);
    70     fibril_start(other);
    71 
    72     fibril_yield();
    73 
    74     fibril_kill(other); // anything like this doesn't exist yet
    75 
    76     PCUT_ASSERT_INT_EQUALS(5, value);
    77 }
    78 */
    79 
     61 * static errno_t fibril_to_be_killed(void* _arg) {
     62 *     fibril_add_exit_hook(exit_hook);
     63 *
     64 *     while (true)
     65 *         firbil_yield();
     66 *
     67 *     assert(0 && "unreachable");
     68 * }
     69 *
     70 * PCUT_TEST(exit_hook_kill) {
     71 *     value = 0;
     72 *     fid_t other = fibril_create(fibril_to_be_killed, NULL);
     73 *     fibril_start(other);
     74 *
     75 *     fibril_yield();
     76 *
     77 *     fibril_kill(other); // anything like this doesn't exist yet
     78 *
     79 *     PCUT_ASSERT_INT_EQUALS(5, value);
     80 * }
     81 */
    8082
    8183PCUT_EXPORT(fibril_exit_hook);
Note: See TracChangeset for help on using the changeset viewer.