Changeset 46c20c8 in mainline for kernel/test
- Timestamp:
- 2010-11-26T20:08:10Z (15 years ago)
- 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. - Location:
- kernel/test
- Files:
-
- 2 added
- 10 deleted
- 29 edited
-
atomic/atomic1.c (modified) (1 diff)
-
avltree/avltree1.c (modified) (3 diffs)
-
btree/btree1.c (modified) (1 diff)
-
debug/mips1.c (modified) (1 diff)
-
debug/mips1_skip.c (modified) (1 diff)
-
fault/fault1.c (modified) (1 diff)
-
fpu/fpu1_ia64.c (modified) (2 diffs)
-
fpu/fpu1_skip.c (modified) (1 diff)
-
fpu/fpu1_x86.c (modified) (4 diffs)
-
fpu/mips2.c (modified) (2 diffs)
-
fpu/mips2_skip.c (modified) (1 diff)
-
fpu/sse1.c (modified) (2 diffs)
-
fpu/sse1_skip.c (modified) (1 diff)
-
mm/falloc1.c (modified) (3 diffs)
-
mm/falloc2.c (modified) (4 diffs)
-
mm/mapping1.c (modified) (5 diffs)
-
mm/purge1.c (modified) (2 diffs)
-
mm/purge1_skip.c (modified) (1 diff)
-
mm/slab1.c (modified) (1 diff)
-
mm/slab2.c (modified) (1 diff)
-
print/print1.c (modified) (2 diffs)
-
print/print2.c (modified) (2 diffs)
-
print/print3.c (modified) (1 diff)
-
print/print4.c (modified) (3 diffs)
-
print/print5.c (added)
-
print/print5.def (added)
-
synch/rwlock1.c (deleted)
-
synch/rwlock1.def (deleted)
-
synch/rwlock2.def (deleted)
-
synch/rwlock3.c (deleted)
-
synch/rwlock3.def (deleted)
-
synch/rwlock4.c (deleted)
-
synch/rwlock4.def (deleted)
-
synch/rwlock5.c (deleted)
-
synch/rwlock5.def (deleted)
-
synch/semaphore1.c (modified) (3 diffs)
-
synch/semaphore2.c (modified) (2 diffs)
-
sysinfo/sysinfo1.def (deleted)
-
test.c (modified) (2 diffs)
-
test.h (modified) (2 diffs)
-
thread/thread1.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/atomic/atomic1.c
rfb150d78 r46c20c8 32 32 #include <debug.h> 33 33 34 c har *test_atomic1(void)34 const char *test_atomic1(void) 35 35 { 36 36 atomic_t a; -
kernel/test/avltree/avltree1.c
rfb150d78 r46c20c8 31 31 #include <adt/avl.h> 32 32 #include <debug.h> 33 #include < arch/types.h>33 #include <typedefs.h> 34 34 35 35 #define NODE_COUNT 100 … … 202 202 avltree_create(tree); 203 203 204 TPRINTF("Inserting % " PRIs "nodes...", node_count);204 TPRINTF("Inserting %zu nodes...", node_count); 205 205 206 206 for (i = 0; i < node_count; i++) { … … 265 265 } 266 266 267 c har *test_avltree1(void)267 const char *test_avltree1(void) 268 268 { 269 269 alloc_avltree_node_prepare(); -
kernel/test/btree/btree1.c
rfb150d78 r46c20c8 34 34 static void *data = (void *) 0xdeadbeef; 35 35 36 c har *test_btree1(void)36 const char *test_btree1(void) 37 37 { 38 38 btree_t t; -
kernel/test/debug/mips1.c
rfb150d78 r46c20c8 37 37 #include <arch.h> 38 38 39 c har *test_mips1(void)39 const char *test_mips1(void) 40 40 { 41 41 TPRINTF("If kconsole is compiled in, you should enter debug mode now.\n"); -
kernel/test/debug/mips1_skip.c
rfb150d78 r46c20c8 29 29 #include <test.h> 30 30 31 c har *test_mips1(void)31 const char *test_mips1(void) 32 32 { 33 33 return NULL; -
kernel/test/fault/fault1.c
rfb150d78 r46c20c8 37 37 #include <arch.h> 38 38 39 c har *test_fault1(void)39 const char *test_fault1(void) 40 40 { 41 41 ((int *)(0))[1] = 0; -
kernel/test/fpu/fpu1_ia64.c
rfb150d78 r46c20c8 126 126 } 127 127 128 c har *test_fpu1(void)128 const char *test_fpu1(void) 129 129 { 130 unsigned int i, total = 0; 130 unsigned int i; 131 atomic_count_t total = 0; 131 132 132 133 waitq_initialize(&can_start); … … 159 160 waitq_wakeup(&can_start, WAKEUP_ALL); 160 161 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)); 163 165 thread_sleep(1); 164 166 } -
kernel/test/fpu/fpu1_skip.c
rfb150d78 r46c20c8 29 29 #include <test.h> 30 30 31 c har *test_fpu1(void)31 const char *test_fpu1(void) 32 32 { 33 33 return NULL; -
kernel/test/fpu/fpu1_x86.c
rfb150d78 r46c20c8 82 82 83 83 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); 85 86 atomic_inc(&threads_fault); 86 87 break; … … 115 116 116 117 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); 118 120 atomic_inc(&threads_fault); 119 121 break; … … 123 125 } 124 126 125 c har *test_fpu1(void)127 const char *test_fpu1(void) 126 128 { 127 unsigned int i, total = 0; 129 unsigned int i; 130 atomic_count_t total = 0; 128 131 129 132 waitq_initialize(&can_start); … … 156 159 waitq_wakeup(&can_start, WAKEUP_ALL); 157 160 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)); 160 163 thread_sleep(1); 161 164 } -
kernel/test/fpu/mips2.c
rfb150d78 r46c20c8 109 109 110 110 111 c har *test_mips2(void)111 const char *test_mips2(void) 112 112 { 113 unsigned int i, total = 0; 113 unsigned int i; 114 atomic_count_t total = 0; 114 115 115 116 waitq_initialize(&can_start); … … 138 139 139 140 TPRINTF("ok\n"); 140 141 141 142 thread_sleep(1); 142 143 waitq_wakeup(&can_start, WAKEUP_ALL); 143 144 144 while (atomic_get(&threads_ok) != (long)total) {145 while (atomic_get(&threads_ok) != total) { 145 146 TPRINTF("Threads left: %d\n", total - atomic_get(&threads_ok)); 146 147 thread_sleep(1); -
kernel/test/fpu/mips2_skip.c
rfb150d78 r46c20c8 29 29 #include <test.h> 30 30 31 c har *test_mips2(void)31 const char *test_mips2(void) 32 32 { 33 33 return NULL; -
kernel/test/fpu/sse1.c
rfb150d78 r46c20c8 107 107 } 108 108 109 c har *test_sse1(void)109 const char *test_sse1(void) 110 110 { 111 unsigned int i, total = 0; 111 unsigned int i; 112 atomic_count_t total = 0; 112 113 113 114 waitq_initialize(&can_start); … … 140 141 waitq_wakeup(&can_start, WAKEUP_ALL); 141 142 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)); 144 145 thread_sleep(1); 145 146 } -
kernel/test/fpu/sse1_skip.c
rfb150d78 r46c20c8 29 29 #include <test.h> 30 30 31 c har *test_sse1(void)31 const char *test_sse1(void) 32 32 { 33 33 return NULL; -
kernel/test/mm/falloc1.c
rfb150d78 r46c20c8 33 33 #include <mm/slab.h> 34 34 #include <arch/mm/page.h> 35 #include < arch/types.h>35 #include <typedefs.h> 36 36 #include <debug.h> 37 37 #include <align.h> … … 41 41 #define TEST_RUNS 2 42 42 43 c har *test_falloc1(void) {43 const char *test_falloc1(void) { 44 44 uintptr_t *frames 45 45 = (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), 0); … … 64 64 65 65 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); 67 68 return "Test failed"; 68 69 } -
kernel/test/mm/falloc2.c
rfb150d78 r46c20c8 33 33 #include <mm/slab.h> 34 34 #include <arch/mm/page.h> 35 #include < arch/types.h>35 #include <typedefs.h> 36 36 #include <atomic.h> 37 37 #include <debug.h> … … 85 85 for (k = 0; k <= (((size_t) FRAME_SIZE << order) - 1); k++) { 86 86 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); 88 89 atomic_inc(&thread_fail); 89 90 goto cleanup; … … 104 105 } 105 106 106 c har *test_falloc2(void)107 const char *test_falloc2(void) 107 108 { 108 109 unsigned int i; … … 121 122 122 123 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)); 124 125 thread_sleep(1); 125 126 } -
kernel/test/mm/mapping1.c
rfb150d78 r46c20c8 33 33 #include <mm/as.h> 34 34 #include <arch/mm/page.h> 35 #include < arch/types.h>35 #include <typedefs.h> 36 36 #include <debug.h> 37 37 … … 39 39 #define PAGE1 (PAGE0 + PAGE_SIZE) 40 40 41 #define VALUE0 0x0123456742 #define VALUE1 0x89abcdef41 #define VALUE0 UINT32_C(0x01234567) 42 #define VALUE1 UINT32_C(0x89abcdef) 43 43 44 c har *test_mapping1(void)44 const char *test_mapping1(void) 45 45 { 46 46 uintptr_t frame0, frame1; … … 50 50 frame1 = (uintptr_t) frame_alloc(ONE_FRAME, FRAME_KA); 51 51 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)); 53 54 *((uint32_t *) frame0) = VALUE0; 54 55 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)); 56 58 *((uint32_t *) frame1) = VALUE1; 57 59 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)); 59 62 page_mapping_insert(AS_KERNEL, PAGE0, KA2PA(frame0), PAGE_PRESENT | PAGE_WRITE); 60 63 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)); 62 66 page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE); 63 67 64 68 v0 = *((uint32_t *) PAGE0); 65 69 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); 68 74 69 75 if (v0 != VALUE0) … … 72 78 return "Value at v1 not equal to VALUE1"; 73 79 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); 75 82 *((uint32_t *) PAGE0) = 0; 76 83 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); 78 86 *((uint32_t *) PAGE1) = 0; 79 87 … … 81 89 v1 = *((uint32_t *) PAGE1); 82 90 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)); 85 95 86 96 if (v0 != 0) -
kernel/test/mm/purge1.c
rfb150d78 r46c20c8 34 34 #include <arch/mm/page.h> 35 35 #include <arch/mm/tlb.h> 36 #include < arch/types.h>36 #include <typedefs.h> 37 37 #include <debug.h> 38 38 … … 40 40 extern void tlb_invalidate_pages(asid_t asid, uintptr_t va, size_t cnt); 41 41 42 c har *test_purge1(void)42 const char *test_purge1(void) 43 43 { 44 44 tlb_entry_t entryi; -
kernel/test/mm/purge1_skip.c
rfb150d78 r46c20c8 29 29 #include <test.h> 30 30 31 c har *test_purge1(void)31 const char *test_purge1(void) 32 32 { 33 33 return NULL; -
kernel/test/mm/slab1.c
rfb150d78 r46c20c8 170 170 } 171 171 172 c har *test_slab1(void)172 const char *test_slab1(void) 173 173 { 174 174 testsimple(); -
kernel/test/mm/slab2.c
rfb150d78 r46c20c8 226 226 } 227 227 228 c har *test_slab2(void)228 const char *test_slab2(void) 229 229 { 230 230 TPRINTF("Running reclaim single-thread test .. pass 1\n"); -
kernel/test/print/print1.c
rfb150d78 r46c20c8 30 30 #include <test.h> 31 31 32 c har *test_print1(void)32 const char *test_print1(void) 33 33 { 34 34 TPRINTF("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n"); … … 48 48 TPRINTF("Real output: \"%8.10s\"\n\n", "very long text"); 49 49 50 TPRINTF("Testing printf(\"%%s\", NULL):\n");51 TPRINTF("Expected output: \"(NULL)\"\n");52 TPRINTF("Real output: \"%s\"\n\n", NULL);53 54 50 return NULL; 55 51 } -
kernel/test/print/print2.c
rfb150d78 r46c20c8 30 30 #include <test.h> 31 31 32 c har *test_print2(void)32 const char *test_print2(void) 33 33 { 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'); 37 37 38 38 TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n"); … … 48 48 TPRINTF("Real output: [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21); 49 49 50 unative_t nat = 0x12345678u;50 unative_t nat = UINTN_C(0x12345678); 51 51 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"); 53 53 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"); 55 55 56 56 return NULL; -
kernel/test/print/print3.c
rfb150d78 r46c20c8 33 33 #define BUFFER_SIZE 32 34 34 35 c har *test_print3(void)35 const char *test_print3(void) 36 36 { 37 37 char buffer[BUFFER_SIZE]; -
kernel/test/print/print4.c
rfb150d78 r46c20c8 30 30 #include <test.h> 31 31 32 c har *test_print4(void)32 const char *test_print4(void) 33 33 { 34 34 TPRINTF("ASCII printable characters (32 - 127) using printf(\"%%c\") and printf(\"%%lc\"):\n"); … … 44 44 TPRINTF(" "); 45 45 for (index = 0; index < 32; index++) 46 TPRINTF("%lc", (w char_t) ((group << 5) + index));46 TPRINTF("%lc", (wint_t) ((group << 5) + index)); 47 47 48 48 TPRINTF("\n"); … … 56 56 uint8_t index; 57 57 for (index = 0; index < 32; index++) 58 TPRINTF("%lc", (w char_t) ((group << 5) + index));58 TPRINTF("%lc", (wint_t) ((group << 5) + index)); 59 59 60 60 TPRINTF("\n"); -
kernel/test/synch/semaphore1.c
rfb150d78 r46c20c8 70 70 } 71 71 72 c har *test_semaphore1(void)72 const char *test_semaphore1(void) 73 73 { 74 74 int i, j, k; 75 int consumers, producers; 75 atomic_count_t consumers; 76 atomic_count_t producers; 76 77 77 78 waitq_initialize(&can_start); … … 87 88 producers = (4 - i) * PRODUCERS; 88 89 89 TPRINTF("Creating %d consumers and %d producers...", consumers, producers); 90 TPRINTF("Creating %" PRIua " consumers and %" PRIua " producers...", 91 consumers, producers); 90 92 91 93 for (j = 0; j < (CONSUMERS + PRODUCERS) / 2; j++) { … … 112 114 113 115 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); 115 118 thread_sleep(1); 116 119 } -
kernel/test/synch/semaphore2.c
rfb150d78 r46c20c8 32 32 #include <print.h> 33 33 #include <proc/thread.h> 34 #include < arch/types.h>34 #include <typedefs.h> 35 35 #include <arch/context.h> 36 36 … … 82 82 } 83 83 84 c har *test_semaphore2(void)84 const char *test_semaphore2(void) 85 85 { 86 86 uint32_t i, k; -
kernel/test/test.c
rfb150d78 r46c20c8 51 51 #include <mm/slab1.def> 52 52 #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>58 53 #include <synch/semaphore1.def> 59 54 #include <synch/semaphore2.def> … … 62 57 #include <print/print3.def> 63 58 #include <print/print4.def> 59 #include <print/print5.def> 64 60 #include <thread/thread1.def> 65 #include <sysinfo/sysinfo1.def>66 61 { 67 62 .name = NULL, -
kernel/test/test.h
rfb150d78 r46c20c8 36 36 #define KERN_TEST_H_ 37 37 38 #include <arch/types.h>39 38 #include <typedefs.h> 40 39 … … 48 47 } 49 48 50 typedef c har *(*test_entry_t)(void);49 typedef const char *(*test_entry_t)(void); 51 50 52 51 typedef struct { 53 c har *name;54 c har *desc;52 const char *name; 53 const char *desc; 55 54 test_entry_t entry; 56 55 bool safe; 57 56 } test_t; 58 57 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); 58 extern const char *test_atomic1(void); 59 extern const char *test_avltree1(void); 60 extern const char *test_btree1(void); 61 extern const char *test_mips1(void); 62 extern const char *test_fault1(void); 63 extern const char *test_fpu1(void); 64 extern const char *test_sse1(void); 65 extern const char *test_mips2(void); 66 extern const char *test_falloc1(void); 67 extern const char *test_falloc2(void); 68 extern const char *test_mapping1(void); 69 extern const char *test_purge1(void); 70 extern const char *test_slab1(void); 71 extern const char *test_slab2(void); 72 extern const char *test_semaphore1(void); 73 extern const char *test_semaphore2(void); 74 extern const char *test_print1(void); 75 extern const char *test_print2(void); 76 extern const char *test_print3(void); 77 extern const char *test_print4(void); 78 extern const char *test_print5(void); 79 extern const char *test_thread1(void); 86 80 87 81 extern test_t tests[]; -
kernel/test/thread/thread1.c
rfb150d78 r46c20c8 53 53 } 54 54 55 c har *test_thread1(void)55 const char *test_thread1(void) 56 56 { 57 unsigned int i, total = 0; 57 unsigned int i; 58 atomic_count_t total = 0; 58 59 59 60 atomic_set(&finish, 1); 60 61 atomic_set(&threads_finished, 0); 61 62 62 for (i = 0; i < THREADS; i++) { 63 for (i = 0; i < THREADS; i++) { 63 64 thread_t *t; 64 65 if (!(t = thread_create(threadtest, NULL, TASK, 0, "threadtest", false))) { … … 74 75 75 76 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)); 78 79 thread_sleep(1); 79 80 }
Note:
See TracChangeset
for help on using the changeset viewer.
