Changeset 205832b in mainline for kernel/test


Ignore:
Timestamp:
2012-11-05T15:37:39Z (13 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f048658
Parents:
6b99156
Message:

Replaced 0 with NULL where appropriate (in rcu, cht, uspace hashtable, smp_call, workqueue).

Location:
kernel/test
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/cht/cht1.c

    r6b99156 r205832b  
    9797static const char * do_sanity_test(cht_t *h)
    9898{
    99         if (cht_find_lazy(h, 0))
     99        if (cht_find_lazy(h, (void*)0))
    100100                return "Found lazy in empty table.";
    101101       
    102         if (cht_find(h, 0))
     102        if (cht_find(h, (void*)0))
    103103                return "Found in empty table.";
    104104       
    105         if (cht_remove_key(h, 0))
     105        if (cht_remove_key(h, (void*)0))
    106106                return "Removed from empty table.";
    107107       
    108108        const int val_cnt = 6;
    109         val_t *v[6] = {0};
     109        val_t *v[6] = { NULL };
    110110       
    111111        for (int i = 0; i < val_cnt; ++i)
     
    145145       
    146146        if (cht_find(h, (void*)0))
    147                 return "Fantom find.";
     147                return "Phantom find.";
    148148       
    149149        cht_link_t *item = cht_find(h, (void*)v[5]->unique_id);
     
    226226        }
    227227
    228         return 0;
     228        return NULL;
    229229}
    230230
     
    559559                return "CHT stress test failed.";
    560560        else
    561                 return 0;
    562 }
     561                return NULL;
     562}
  • kernel/test/smpcall/smpcall1.c

    r6b99156 r205832b  
    8585        /* Number of received calls that were sent by cpu[i]. */
    8686        size_t call_cnt[MAX_CPUS] = {0};
    87         thread_t *thread[MAX_CPUS] = {0};
     87        thread_t *thread[MAX_CPUS] = { NULL };
    8888       
    8989        unsigned int cpu_count = min(config.cpu_active, MAX_CPUS);
  • kernel/test/synch/rcu1.c

    r6b99156 r205832b  
    4343
    4444static int one_idx = 0;
    45 static thread_t *thread[MAX_THREADS] = {0};
     45static thread_t *thread[MAX_THREADS] = { NULL };
    4646
    4747typedef struct {
     
    100100       
    101101        for (size_t i = 0; i < thread_cnt; ++i) {
    102                 run_thread(i, func, 0);
     102                run_thread(i, func, NULL);
    103103        }
    104104}
     
    123123                       
    124124                        thread_detach(thread[i]);
    125                         thread[i] = 0;
     125                        thread[i] = NULL;
    126126                }
    127127        }
     
    145145                thread_join(thread[one_idx]);
    146146                thread_detach(thread[one_idx]);
    147                 thread[one_idx] = 0;
     147                thread[one_idx] = NULL;
    148148        }
    149149}
     
    337337       
    338338        TPRINTF("\nRun a single reader that posts one callback.\n");
    339         run_one(one_cb_reader, 0);
     339        run_one(one_cb_reader, NULL);
    340340        join_one();
    341341       
     
    10151015                { 0, do_expedite, "do_expedite" },
    10161016                { 1, do_stress, "do_stress" },
    1017                 { 0, 0, 0 }
     1017                { 0, NULL, NULL }
    10181018        };
    10191019       
     
    10231023        uint64_t delta_gps = 0;
    10241024       
    1025         for (int i = 0; test_func[i].func != 0; ++i) {
     1025        for (int i = 0; test_func[i].func; ++i) {
    10261026                if (!test_func[i].include) {
    10271027                        TPRINTF("\nSubtest %s() skipped.\n", test_func[i].desc);
     
    10471047
    10481048        if (success)
    1049                 return 0;
     1049                return NULL;
    10501050        else
    10511051                return "One of the tests failed.";
  • kernel/test/synch/workqueue2.c

    r6b99156 r205832b  
    116116        test_custom_workq_impl(true, "test-workq-stop");
    117117        /* Errors are expected. */
    118         return 0;
     118        return NULL;
    119119}
    120120
     
    122122const char *test_workqueue_all(void)
    123123{
    124         const char *err = 0;
     124        const char *err = NULL;
    125125        const char *res;
    126126       
  • kernel/test/synch/workqueue3.c

    r6b99156 r205832b  
    5656static const char *do_test(bool exit_early)
    5757{
    58         const char *err = 0;
     58        const char *err = NULL;
    5959        TPRINTF("Stress testing system queue.\n");
    6060        TPRINTF("First run:\n");
Note: See TracChangeset for help on using the changeset viewer.