Changeset 46c20c8 in mainline for kernel/test


Ignore:
Timestamp:
2010-11-26T20:08:10Z (15 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/fix-logger-deadlock, topic/msim-upgrade, topic/simplify-dev-export
Children:
45df59a
Parents:
fb150d78 (diff), ffdd2b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

Location:
kernel/test
Files:
2 added
10 deleted
29 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/atomic/atomic1.c

    rfb150d78 r46c20c8  
    3232#include <debug.h>
    3333
    34 char *test_atomic1(void)
     34const char *test_atomic1(void)
    3535{
    3636        atomic_t a;
  • kernel/test/avltree/avltree1.c

    rfb150d78 r46c20c8  
    3131#include <adt/avl.h>
    3232#include <debug.h>
    33 #include <arch/types.h>
     33#include <typedefs.h>
    3434
    3535#define NODE_COUNT 100
     
    202202        avltree_create(tree);
    203203       
    204         TPRINTF("Inserting %" PRIs " nodes...", node_count);
     204        TPRINTF("Inserting %zu nodes...", node_count);
    205205       
    206206        for (i = 0; i < node_count; i++) {
     
    265265}
    266266
    267 char *test_avltree1(void)
     267const char *test_avltree1(void)
    268268{
    269269        alloc_avltree_node_prepare();
  • kernel/test/btree/btree1.c

    rfb150d78 r46c20c8  
    3434static void *data = (void *) 0xdeadbeef;
    3535
    36 char *test_btree1(void)
     36const char *test_btree1(void)
    3737{
    3838        btree_t t;
  • kernel/test/debug/mips1.c

    rfb150d78 r46c20c8  
    3737#include <arch.h>
    3838
    39 char *test_mips1(void)
     39const char *test_mips1(void)
    4040{
    4141        TPRINTF("If kconsole is compiled in, you should enter debug mode now.\n");
  • kernel/test/debug/mips1_skip.c

    rfb150d78 r46c20c8  
    2929#include <test.h>
    3030
    31 char *test_mips1(void)
     31const char *test_mips1(void)
    3232{
    3333        return NULL;
  • kernel/test/fault/fault1.c

    rfb150d78 r46c20c8  
    3737#include <arch.h>
    3838
    39 char *test_fault1(void)
     39const char *test_fault1(void)
    4040{
    4141        ((int *)(0))[1] = 0;
  • kernel/test/fpu/fpu1_ia64.c

    rfb150d78 r46c20c8  
    126126}
    127127
    128 char *test_fpu1(void)
     128const char *test_fpu1(void)
    129129{
    130         unsigned int i, total = 0;
     130        unsigned int i;
     131        atomic_count_t total = 0;
    131132       
    132133        waitq_initialize(&can_start);
     
    159160        waitq_wakeup(&can_start, WAKEUP_ALL);
    160161       
    161         while (atomic_get(&threads_ok) != (long) total) {
    162                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
     162        while (atomic_get(&threads_ok) != total) {
     163                TPRINTF("Threads left: %" PRIua "\n",
     164                    total - atomic_get(&threads_ok));
    163165                thread_sleep(1);
    164166        }
  • kernel/test/fpu/fpu1_skip.c

    rfb150d78 r46c20c8  
    2929#include <test.h>
    3030
    31 char *test_fpu1(void)
     31const char *test_fpu1(void)
    3232{
    3333        return NULL;
  • kernel/test/fpu/fpu1_x86.c

    rfb150d78 r46c20c8  
    8282               
    8383                if ((int) (100000000 * e) != E_10e8) {
    84                         TPRINTF("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
     84                        TPRINTF("tid%" PRIu64 ": e*10e8=%" PRIun " should be %" PRIun "\n",
     85                            THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);
    8586                        atomic_inc(&threads_fault);
    8687                        break;
     
    115116               
    116117                if ((int) (100000000 * pi) != PI_10e8) {
    117                         TPRINTF("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
     118                        TPRINTF("tid%" PRIu64 ": pi*10e8=%" PRIun " should be %" PRIun "\n",
     119                            THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);
    118120                        atomic_inc(&threads_fault);
    119121                        break;
     
    123125}
    124126
    125 char *test_fpu1(void)
     127const char *test_fpu1(void)
    126128{
    127         unsigned int i, total = 0;
     129        unsigned int i;
     130        atomic_count_t total = 0;
    128131       
    129132        waitq_initialize(&can_start);
     
    156159        waitq_wakeup(&can_start, WAKEUP_ALL);
    157160       
    158         while (atomic_get(&threads_ok) != (long) total) {
    159                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
     161        while (atomic_get(&threads_ok) != total) {
     162                TPRINTF("Threads left: %" PRIua "\n", total - atomic_get(&threads_ok));
    160163                thread_sleep(1);
    161164        }
  • kernel/test/fpu/mips2.c

    rfb150d78 r46c20c8  
    109109
    110110
    111 char *test_mips2(void)
     111const char *test_mips2(void)
    112112{
    113         unsigned int i, total = 0;
     113        unsigned int i;
     114        atomic_count_t total = 0;
    114115       
    115116        waitq_initialize(&can_start);
     
    138139       
    139140        TPRINTF("ok\n");
    140                
     141       
    141142        thread_sleep(1);
    142143        waitq_wakeup(&can_start, WAKEUP_ALL);
    143144       
    144         while (atomic_get(&threads_ok) != (long) total) {
     145        while (atomic_get(&threads_ok) != total) {
    145146                TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
    146147                thread_sleep(1);
  • kernel/test/fpu/mips2_skip.c

    rfb150d78 r46c20c8  
    2929#include <test.h>
    3030
    31 char *test_mips2(void)
     31const char *test_mips2(void)
    3232{
    3333        return NULL;
  • kernel/test/fpu/sse1.c

    rfb150d78 r46c20c8  
    107107}
    108108
    109 char *test_sse1(void)
     109const char *test_sse1(void)
    110110{
    111         unsigned int i, total = 0;
     111        unsigned int i;
     112        atomic_count_t total = 0;
    112113       
    113114        waitq_initialize(&can_start);
     
    140141        waitq_wakeup(&can_start, WAKEUP_ALL);
    141142       
    142         while (atomic_get(&threads_ok) != (long) total) {
    143                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok));
     143        while (atomic_get(&threads_ok) != total) {
     144                TPRINTF("Threads left: %" PRIua "\n", total - atomic_get(&threads_ok));
    144145                thread_sleep(1);
    145146        }
  • kernel/test/fpu/sse1_skip.c

    rfb150d78 r46c20c8  
    2929#include <test.h>
    3030
    31 char *test_sse1(void)
     31const char *test_sse1(void)
    3232{
    3333        return NULL;
  • kernel/test/mm/falloc1.c

    rfb150d78 r46c20c8  
    3333#include <mm/slab.h>
    3434#include <arch/mm/page.h>
    35 #include <arch/types.h>
     35#include <typedefs.h>
    3636#include <debug.h>
    3737#include <align.h>
     
    4141#define TEST_RUNS   2
    4242
    43 char *test_falloc1(void) {
     43const char *test_falloc1(void) {
    4444        uintptr_t *frames
    4545            = (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), 0);
     
    6464                               
    6565                                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
    66                                         TPRINTF("Block at address %p (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
     66                                        TPRINTF("Block at address %p (size %dK) is not aligned\n",
     67                                            (void *) frames[allocated], (FRAME_SIZE << order) >> 10);
    6768                                        return "Test failed";
    6869                                }
  • kernel/test/mm/falloc2.c

    rfb150d78 r46c20c8  
    3333#include <mm/slab.h>
    3434#include <arch/mm/page.h>
    35 #include <arch/types.h>
     35#include <typedefs.h>
    3636#include <atomic.h>
    3737#include <debug.h>
     
    8585                                for (k = 0; k <= (((size_t) FRAME_SIZE << order) - 1); k++) {
    8686                                        if (((uint8_t *) frames[i])[k] != val) {
    87                                                 TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIs "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
     87                                                TPRINTF("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %zu\n",
     88                                                    THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
    8889                                                atomic_inc(&thread_fail);
    8990                                                goto cleanup;
     
    104105}
    105106
    106 char *test_falloc2(void)
     107const char *test_falloc2(void)
    107108{
    108109        unsigned int i;
     
    121122       
    122123        while (atomic_get(&thread_count) > 0) {
    123                 TPRINTF("Threads left: %ld\n", atomic_get(&thread_count));
     124                TPRINTF("Threads left: %" PRIua "\n", atomic_get(&thread_count));
    124125                thread_sleep(1);
    125126        }
  • kernel/test/mm/mapping1.c

    rfb150d78 r46c20c8  
    3333#include <mm/as.h>
    3434#include <arch/mm/page.h>
    35 #include <arch/types.h>
     35#include <typedefs.h>
    3636#include <debug.h>
    3737
     
    3939#define PAGE1  (PAGE0 + PAGE_SIZE)
    4040
    41 #define VALUE0  0x01234567
    42 #define VALUE1  0x89abcdef
     41#define VALUE0  UINT32_C(0x01234567)
     42#define VALUE1  UINT32_C(0x89abcdef)
    4343
    44 char *test_mapping1(void)
     44const char *test_mapping1(void)
    4545{
    4646        uintptr_t frame0, frame1;
     
    5050        frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA);
    5151       
    52         TPRINTF("Writing %#x to physical address %p.\n", VALUE0, KA2PA(frame0));
     52        TPRINTF("Writing %#" PRIx32 " to physical address %p.\n",
     53            (uint32_t) VALUE0, (void *) KA2PA(frame0));
    5354        *((uint32_t *) frame0) = VALUE0;
    5455       
    55         TPRINTF("Writing %#x to physical address %p.\n", VALUE1, KA2PA(frame1));
     56        TPRINTF("Writing %#" PRIx32 " to physical address %p.\n",
     57            (uint32_t) VALUE1, (void *) KA2PA(frame1));
    5658        *((uint32_t *) frame1) = VALUE1;
    5759       
    58         TPRINTF("Mapping virtual address %p to physical address %p.\n", PAGE0, KA2PA(frame0));
     60        TPRINTF("Mapping virtual address %p to physical address %p.\n",
     61            (void *) PAGE0, (void *) KA2PA(frame0));
    5962        page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE);
    6063       
    61         TPRINTF("Mapping virtual address %p to physical address %p.\n", PAGE1, KA2PA(frame1));
     64        TPRINTF("Mapping virtual address %p to physical address %p.\n",
     65            (void *) PAGE1, (void *) KA2PA(frame1));
    6266        page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
    6367       
    6468        v0 = *((uint32_t *) PAGE0);
    6569        v1 = *((uint32_t *) PAGE1);
    66         TPRINTF("Value at virtual address %p is %#x.\n", PAGE0, v0);
    67         TPRINTF("Value at virtual address %p is %#x.\n", PAGE1, v1);
     70        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     71            (void *) PAGE0, v0);
     72        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     73            (void *) PAGE1, v1);
    6874       
    6975        if (v0 != VALUE0)
     
    7278                return "Value at v1 not equal to VALUE1";
    7379       
    74         TPRINTF("Writing %#x to virtual address %p.\n", 0, PAGE0);
     80        TPRINTF("Writing %#" PRIx32 " to virtual address %p.\n",
     81            (uint32_t) 0, (void *) PAGE0);
    7582        *((uint32_t *) PAGE0) = 0;
    7683       
    77         TPRINTF("Writing %#x to virtual address %p.\n", 0, PAGE1);
     84        TPRINTF("Writing %#" PRIx32 " to virtual address %p.\n",
     85            (uint32_t) 0, (void *) PAGE1);
    7886        *((uint32_t *) PAGE1) = 0;
    7987       
     
    8189        v1 = *((uint32_t *) PAGE1);
    8290       
    83         TPRINTF("Value at virtual address %p is %#x.\n", PAGE0, *((uint32_t *) PAGE0));
    84         TPRINTF("Value at virtual address %p is %#x.\n", PAGE1, *((uint32_t *) PAGE1));
     91        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     92            (void *) PAGE0, *((uint32_t *) PAGE0));
     93        TPRINTF("Value at virtual address %p is %#" PRIx32 ".\n",
     94            (void *) PAGE1, *((uint32_t *) PAGE1));
    8595       
    8696        if (v0 != 0)
  • kernel/test/mm/purge1.c

    rfb150d78 r46c20c8  
    3434#include <arch/mm/page.h>
    3535#include <arch/mm/tlb.h>
    36 #include <arch/types.h>
     36#include <typedefs.h>
    3737#include <debug.h>
    3838
     
    4040extern void tlb_invalidate_pages(asid_t asid, uintptr_t va, size_t cnt);
    4141
    42 char *test_purge1(void)
     42const char *test_purge1(void)
    4343{
    4444        tlb_entry_t entryi;
  • kernel/test/mm/purge1_skip.c

    rfb150d78 r46c20c8  
    2929#include <test.h>
    3030
    31 char *test_purge1(void)
     31const char *test_purge1(void)
    3232{
    3333        return NULL;
  • kernel/test/mm/slab1.c

    rfb150d78 r46c20c8  
    170170}
    171171
    172 char *test_slab1(void)
     172const char *test_slab1(void)
    173173{
    174174        testsimple();
  • kernel/test/mm/slab2.c

    rfb150d78 r46c20c8  
    226226}
    227227
    228 char *test_slab2(void)
     228const char *test_slab2(void)
    229229{
    230230        TPRINTF("Running reclaim single-thread test .. pass 1\n");
  • kernel/test/print/print1.c

    rfb150d78 r46c20c8  
    3030#include <test.h>
    3131
    32 char *test_print1(void)
     32const char *test_print1(void)
    3333{
    3434        TPRINTF("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n");
     
    4848        TPRINTF("Real output:     \"%8.10s\"\n\n", "very long text");
    4949       
    50         TPRINTF("Testing printf(\"%%s\", NULL):\n");
    51         TPRINTF("Expected output: \"(NULL)\"\n");
    52         TPRINTF("Real output:     \"%s\"\n\n", NULL);
    53        
    5450        return NULL;
    5551}
  • kernel/test/print/print2.c

    rfb150d78 r46c20c8  
    3030#include <test.h>
    3131
    32 char *test_print2(void)
     32const char *test_print2(void)
    3333{
    34         TPRINTF("Testing printf(\"%%c %%3.2c %%-3.2c %%2.3c %%-2.3c\", 'a', 'b', 'c', 'd', 'e'):\n");
    35         TPRINTF("Expected output: [a] [  b] [c  ] [ d] [e ]\n");
    36         TPRINTF("Real output:     [%c] [%3.2c] [%-3.2c] [%2.3c] [%-2.3c]\n\n", 'a', 'b', 'c', 'd', 'e');
     34        TPRINTF("Testing printf(\"%%c\", 'a'):\n");
     35        TPRINTF("Expected output: [a]\n");
     36        TPRINTF("Real output:     [%c]\n\n", 'a');
    3737       
    3838        TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n");
     
    4848        TPRINTF("Real output:     [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21);
    4949       
    50         unative_t nat = 0x12345678u;
     50        unative_t nat = UINTN_C(0x12345678);
    5151       
    52         TPRINTF("Testing printf(\"%%#" PRIx64 " %%#" PRIx32 " %%#" PRIx16 " %%#" PRIx8 " %%#" PRIxn " %%#" PRIx64 " %%s\", 0x1234567887654321ll, 0x12345678, 0x1234, 0x12, nat, 0x1234567887654321ull, \"Lovely string\"):\n");
     52        TPRINTF("Testing printf(\"%%#" PRIx64 " %%#" PRIx32 " %%#" PRIx16 " %%#" PRIx8 " %%#" PRIxn " %%#" PRIx64 " %%s\", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), \"Lovely string\"):\n");
    5353        TPRINTF("Expected output: [0x1234567887654321] [0x12345678] [0x1234] [0x12] [0x12345678] [0x1234567887654321] \"Lovely string\"\n");
    54         TPRINTF("Real output:     [%#" PRIx64 "] [%#" PRIx32 "] [%#" PRIx16 "] [%#" PRIx8 "] [%#" PRIxn "] [%#" PRIx64 "] \"%s\"\n\n", 0x1234567887654321ll, 0x12345678, 0x1234, 0x12, nat, 0x1234567887654321ull, "Lovely string");
     54        TPRINTF("Real output:     [%#" PRIx64 "] [%#" PRIx32 "] [%#" PRIx16 "] [%#" PRIx8 "] [%#" PRIxn "] [%#" PRIx64 "] \"%s\"\n\n", (uint64_t) UINT64_C(0x1234567887654321), (uint32_t) UINT32_C(0x12345678), (uint16_t) UINT16_C(0x1234), (uint8_t) UINT8_C(0x12), nat, (uint64_t) UINT64_C(0x1234567887654321), "Lovely string");
    5555       
    5656        return NULL;
  • kernel/test/print/print3.c

    rfb150d78 r46c20c8  
    3333#define BUFFER_SIZE  32
    3434
    35 char *test_print3(void)
     35const char *test_print3(void)
    3636{
    3737        char buffer[BUFFER_SIZE];
  • kernel/test/print/print4.c

    rfb150d78 r46c20c8  
    3030#include <test.h>
    3131
    32 char *test_print4(void)
     32const char *test_print4(void)
    3333{
    3434        TPRINTF("ASCII printable characters (32 - 127) using printf(\"%%c\") and printf(\"%%lc\"):\n");
     
    4444                TPRINTF("  ");
    4545                for (index = 0; index < 32; index++)
    46                         TPRINTF("%lc", (wchar_t) ((group << 5) + index));
     46                        TPRINTF("%lc", (wint_t) ((group << 5) + index));
    4747               
    4848                TPRINTF("\n");
     
    5656                uint8_t index;
    5757                for (index = 0; index < 32; index++)
    58                         TPRINTF("%lc", (wchar_t) ((group << 5) + index));
     58                        TPRINTF("%lc", (wint_t) ((group << 5) + index));
    5959               
    6060                TPRINTF("\n");
  • kernel/test/synch/semaphore1.c

    rfb150d78 r46c20c8  
    7070}
    7171
    72 char *test_semaphore1(void)
     72const char *test_semaphore1(void)
    7373{
    7474        int i, j, k;
    75         int consumers, producers;
     75        atomic_count_t consumers;
     76        atomic_count_t producers;
    7677       
    7778        waitq_initialize(&can_start);
     
    8788                producers = (4 - i) * PRODUCERS;
    8889               
    89                 TPRINTF("Creating %d consumers and %d producers...", consumers, producers);
     90                TPRINTF("Creating %" PRIua " consumers and %" PRIua " producers...",
     91                    consumers, producers);
    9092               
    9193                for (j = 0; j < (CONSUMERS + PRODUCERS) / 2; j++) {
     
    112114               
    113115                while ((items_consumed.count != consumers) || (items_produced.count != producers)) {
    114                         TPRINTF("%d consumers remaining, %d producers remaining\n", consumers - items_consumed.count, producers - items_produced.count);
     116                        TPRINTF("%" PRIua " consumers remaining, %" PRIua " producers remaining\n",
     117                            consumers - items_consumed.count, producers - items_produced.count);
    115118                        thread_sleep(1);
    116119                }
  • kernel/test/synch/semaphore2.c

    rfb150d78 r46c20c8  
    3232#include <print.h>
    3333#include <proc/thread.h>
    34 #include <arch/types.h>
     34#include <typedefs.h>
    3535#include <arch/context.h>
    3636
     
    8282}
    8383
    84 char *test_semaphore2(void)
     84const char *test_semaphore2(void)
    8585{
    8686        uint32_t i, k;
  • kernel/test/test.c

    rfb150d78 r46c20c8  
    5151#include <mm/slab1.def>
    5252#include <mm/slab2.def>
    53 #include <synch/rwlock1.def>
    54 #include <synch/rwlock2.def>
    55 #include <synch/rwlock3.def>
    56 #include <synch/rwlock4.def>
    57 #include <synch/rwlock5.def>
    5853#include <synch/semaphore1.def>
    5954#include <synch/semaphore2.def>
     
    6257#include <print/print3.def>
    6358#include <print/print4.def>
     59#include <print/print5.def>
    6460#include <thread/thread1.def>
    65 #include <sysinfo/sysinfo1.def>
    6661        {
    6762                .name = NULL,
  • kernel/test/test.h

    rfb150d78 r46c20c8  
    3636#define KERN_TEST_H_
    3737
    38 #include <arch/types.h>
    3938#include <typedefs.h>
    4039
     
    4847        }
    4948
    50 typedef char *(*test_entry_t)(void);
     49typedef const char *(*test_entry_t)(void);
    5150
    5251typedef struct {
    53         char *name;
    54         char *desc;
     52        const char *name;
     53        const char *desc;
    5554        test_entry_t entry;
    5655        bool safe;
    5756} test_t;
    5857
    59 extern char *test_atomic1(void);
    60 extern char *test_avltree1(void);
    61 extern char *test_btree1(void);
    62 extern char *test_mips1(void);
    63 extern char *test_fault1(void);
    64 extern char *test_fpu1(void);
    65 extern char *test_sse1(void);
    66 extern char *test_mips2(void);
    67 extern char *test_falloc1(void);
    68 extern char *test_falloc2(void);
    69 extern char *test_mapping1(void);
    70 extern char *test_purge1(void);
    71 extern char *test_slab1(void);
    72 extern char *test_slab2(void);
    73 extern char *test_rwlock1(void);
    74 extern char *test_rwlock2(void);
    75 extern char *test_rwlock3(void);
    76 extern char *test_rwlock4(void);
    77 extern char *test_rwlock5(void);
    78 extern char *test_semaphore1(void);
    79 extern char *test_semaphore2(void);
    80 extern char *test_print1(void);
    81 extern char *test_print2(void);
    82 extern char *test_print3(void);
    83 extern char *test_print4(void);
    84 extern char *test_thread1(void);
    85 extern char *test_sysinfo1(void);
     58extern const char *test_atomic1(void);
     59extern const char *test_avltree1(void);
     60extern const char *test_btree1(void);
     61extern const char *test_mips1(void);
     62extern const char *test_fault1(void);
     63extern const char *test_fpu1(void);
     64extern const char *test_sse1(void);
     65extern const char *test_mips2(void);
     66extern const char *test_falloc1(void);
     67extern const char *test_falloc2(void);
     68extern const char *test_mapping1(void);
     69extern const char *test_purge1(void);
     70extern const char *test_slab1(void);
     71extern const char *test_slab2(void);
     72extern const char *test_semaphore1(void);
     73extern const char *test_semaphore2(void);
     74extern const char *test_print1(void);
     75extern const char *test_print2(void);
     76extern const char *test_print3(void);
     77extern const char *test_print4(void);
     78extern const char *test_print5(void);
     79extern const char *test_thread1(void);
    8680
    8781extern test_t tests[];
  • kernel/test/thread/thread1.c

    rfb150d78 r46c20c8  
    5353}
    5454
    55 char *test_thread1(void)
     55const char *test_thread1(void)
    5656{
    57         unsigned int i, total = 0;
     57        unsigned int i;
     58        atomic_count_t total = 0;
    5859       
    5960        atomic_set(&finish, 1);
    6061        atomic_set(&threads_finished, 0);
    6162       
    62         for (i = 0; i < THREADS; i++) { 
     63        for (i = 0; i < THREADS; i++) {
    6364                thread_t *t;
    6465                if (!(t = thread_create(threadtest, NULL, TASK, 0, "threadtest", false))) {
     
    7475       
    7576        atomic_set(&finish, 0);
    76         while (atomic_get(&threads_finished) < ((long) total)) {
    77                 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_finished));
     77        while (atomic_get(&threads_finished) < total) {
     78                TPRINTF("Threads left: %" PRIua "\n", total - atomic_get(&threads_finished));
    7879                thread_sleep(1);
    7980        }
Note: See TracChangeset for help on using the changeset viewer.