Changeset cd8ad52 in mainline
- Timestamp:
- 2008-06-03T14:58:05Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b63f8569
- Parents:
- 7ac426e
- Location:
- kernel/test
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/avltree/avltree1.c
r7ac426e rcd8ad52 62 62 tmp = test_tree_parents(node->lft); 63 63 if (tmp != node) { 64 printf("Bad parent pointer key: % d, address: %p\n",64 printf("Bad parent pointer key: %" PRIu64 ", address: %p\n", 65 65 tmp->key, node->lft); 66 66 } … … 69 69 tmp = test_tree_parents(node->rgt); 70 70 if (tmp != node) { 71 printf("Bad parent pointer key: % d, address: %p\n",71 printf("Bad parent pointer key: %" PRIu64 ", address: %p\n", 72 72 tmp->key,node->rgt); 73 73 } … … 110 110 return; 111 111 112 printf("% d[%d]", node->key, node->balance);112 printf("%" PRIu64 "[%" PRIu8 "]", node->key, node->balance); 113 113 if (node->lft != NULL || node->rgt != NULL) { 114 114 printf("("); … … 192 192 193 193 if (!quiet) 194 printf("Inserting % dnodes...", node_count);194 printf("Inserting %" PRIc " nodes...", node_count); 195 195 196 196 for (i = 0; i < node_count; i++) { -
kernel/test/fpu/fpu1.c
r7ac426e rcd8ad52 127 127 if ((int) (100000000 * e) != E_10e8) { 128 128 if (!sh_quiet) 129 printf("tid% llu: e*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8);129 printf("tid%" PRIu64 ": e*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * e), (unative_t) E_10e8); 130 130 atomic_inc(&threads_fault); 131 131 break; … … 162 162 if ((int) (1000000 * pi) != PI_10e8) { 163 163 if (!sh_quiet) 164 printf("tid% llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100));164 printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (1000000 * pi), (unative_t) (PI_10e8 / 100)); 165 165 atomic_inc(&threads_fault); 166 166 break; … … 169 169 if ((int) (100000000 * pi) != PI_10e8) { 170 170 if (!sh_quiet) 171 printf("tid% llu: pi*10e8=%zd should be %zd\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8);171 printf("tid%" PRIu64 ": pi*10e8=%zd should be %" PRIun "\n", THREAD->tid, (unative_t) (100000000 * pi), (unative_t) PI_10e8); 172 172 atomic_inc(&threads_fault); 173 173 break; … … 188 188 189 189 if (!quiet) 190 printf("Creating % dthreads... ", 2 * THREADS);190 printf("Creating %u threads... ", 2 * THREADS); 191 191 192 192 for (i = 0; i < THREADS; i++) { … … 195 195 if (!(t = thread_create(e, NULL, TASK, 0, "e", false))) { 196 196 if (!quiet) 197 printf("could not create thread % d\n", 2 * i);197 printf("could not create thread %u\n", 2 * i); 198 198 break; 199 199 } … … 203 203 if (!(t = thread_create(pi, NULL, TASK, 0, "pi", false))) { 204 204 if (!quiet) 205 printf("could not create thread % d\n", 2 * i + 1);205 printf("could not create thread %u\n", 2 * i + 1); 206 206 break; 207 207 } -
kernel/test/fpu/mips2.c
r7ac426e rcd8ad52 73 73 if (arg != after_arg) { 74 74 if (!sh_quiet) 75 printf("General reg tid% llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);75 printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 76 76 atomic_inc(&threads_fault); 77 77 break; … … 105 105 if (arg != after_arg) { 106 106 if (!sh_quiet) 107 printf("General reg tid% llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);107 printf("General reg tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 108 108 atomic_inc(&threads_fault); 109 109 break; … … 124 124 125 125 if (!quiet) 126 printf("Creating % dthreads... ", 2 * THREADS);126 printf("Creating %u threads... ", 2 * THREADS); 127 127 128 128 for (i = 0; i < THREADS; i++) { … … 131 131 if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) { 132 132 if (!quiet) 133 printf("could not create thread % d\n", 2 * i);133 printf("could not create thread %u\n", 2 * i); 134 134 break; 135 135 } … … 139 139 if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) { 140 140 if (!quiet) 141 printf("could not create thread % d\n", 2 * i + 1);141 printf("could not create thread %u\n", 2 * i + 1); 142 142 break; 143 143 } -
kernel/test/fpu/sse1.c
r7ac426e rcd8ad52 73 73 if (arg != after_arg) { 74 74 if (!sh_quiet) 75 printf("tid% llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);75 printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 76 76 atomic_inc(&threads_fault); 77 77 break; … … 105 105 if (arg != after_arg) { 106 106 if (!sh_quiet) 107 printf("tid% llu: arg(%d) != %d\n", THREAD->tid, arg, after_arg);107 printf("tid%" PRIu64 ": arg(%d) != %d\n", THREAD->tid, arg, after_arg); 108 108 atomic_inc(&threads_fault); 109 109 break; … … 124 124 125 125 if (!quiet) 126 printf("Creating % dthreads... ", 2 * THREADS);126 printf("Creating %u threads... ", 2 * THREADS); 127 127 128 128 for (i = 0; i < THREADS; i++) { … … 131 131 if (!(t = thread_create(testit1, (void *) ((unative_t) 2 * i), TASK, 0, "testit1", false))) { 132 132 if (!quiet) 133 printf("could not create thread % d\n", 2 * i);133 printf("could not create thread %u\n", 2 * i); 134 134 break; 135 135 } … … 139 139 if (!(t = thread_create(testit2, (void *) ((unative_t) 2 * i + 1), TASK, 0, "testit2", false))) { 140 140 if (!quiet) 141 printf("could not create thread % d\n", 2 * i + 1);141 printf("could not create thread %u\n", 2 * i + 1); 142 142 break; 143 143 } -
kernel/test/mm/falloc2.c
r7ac426e rcd8ad52 59 59 if (frames == NULL) { 60 60 if (!sh_quiet) 61 printf("Thread #% llu (cpu%d): Unable to allocate frames\n", THREAD->tid, CPU->id);61 printf("Thread #%" PRIu64 " (cpu%u): Unable to allocate frames\n", THREAD->tid, CPU->id); 62 62 atomic_inc(&thread_fail); 63 63 atomic_dec(&thread_count); … … 70 70 for (order = 0; order <= MAX_ORDER; order++) { 71 71 if (!sh_quiet) 72 printf("Thread #% llu (cpu%d): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order);72 printf("Thread #%" PRIu64 " (cpu%u): Allocating %d frames blocks ... \n", THREAD->tid, CPU->id, 1 << order); 73 73 74 74 allocated = 0; … … 83 83 84 84 if (!sh_quiet) 85 printf("Thread #% llu (cpu%d): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated);85 printf("Thread #%" PRIu64 " (cpu%u): %d blocks allocated.\n", THREAD->tid, CPU->id, allocated); 86 86 87 87 if (!sh_quiet) 88 printf("Thread #% llu (cpu%d): Deallocating ... \n", THREAD->tid, CPU->id);88 printf("Thread #%" PRIu64 " (cpu%u): Deallocating ... \n", THREAD->tid, CPU->id); 89 89 90 90 for (i = 0; i < allocated; i++) { … … 92 92 if (((uint8_t *) frames[i])[k] != val) { 93 93 if (!sh_quiet) 94 printf("Thread #% llu (cpu%d): Unexpected data (%d) in block %p offset %#zx\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);94 printf("Thread #%" PRIu64 " (cpu%u): Unexpected data (%c) in block %p offset %#" PRIi "\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k); 95 95 atomic_inc(&thread_fail); 96 96 goto cleanup; … … 101 101 102 102 if (!sh_quiet) 103 printf("Thread #% llu (cpu%d): Finished run.\n", THREAD->tid, CPU->id);103 printf("Thread #%" PRIu64 " (cpu%u): Finished run.\n", THREAD->tid, CPU->id); 104 104 } 105 105 } … … 109 109 110 110 if (!sh_quiet) 111 printf("Thread #% llu (cpu%d): Exiting\n", THREAD->tid, CPU->id);111 printf("Thread #%" PRIu64 " (cpu%u): Exiting\n", THREAD->tid, CPU->id); 112 112 atomic_dec(&thread_count); 113 113 } … … 125 125 if (!thrd) { 126 126 if (!quiet) 127 printf("Could not create thread % d\n", i);127 printf("Could not create thread %u\n", i); 128 128 break; 129 129 } … … 133 133 while (atomic_get(&thread_count) > 0) { 134 134 if (!quiet) 135 printf("Threads left: % d\n", atomic_get(&thread_count));135 printf("Threads left: %ld\n", atomic_get(&thread_count)); 136 136 thread_sleep(1); 137 137 } -
kernel/test/mm/slab1.c
r7ac426e rcd8ad52 138 138 139 139 if (!sh_quiet) 140 printf("Starting thread #% llu...\n", THREAD->tid);140 printf("Starting thread #%" PRIu64 "...\n", THREAD->tid); 141 141 142 142 for (j = 0; j < 10; j++) { … … 152 152 153 153 if (!sh_quiet) 154 printf("Thread # %llufinished\n", THREAD->tid);154 printf("Thread #" PRIu64 " finished\n", THREAD->tid); 155 155 156 156 semaphore_up(&thr_sem); -
kernel/test/mm/slab2.c
r7ac426e rcd8ad52 151 151 152 152 if (!sh_quiet) 153 printf("Starting thread #% llu...\n",THREAD->tid);153 printf("Starting thread #%" PRIu64 "...\n", THREAD->tid); 154 154 155 155 /* Alloc all */ 156 156 if (!sh_quiet) 157 printf("Thread #% lluallocating...\n", THREAD->tid);157 printf("Thread #%" PRIu64 " allocating...\n", THREAD->tid); 158 158 159 159 while (1) { … … 167 167 168 168 if (!sh_quiet) 169 printf("Thread #% llureleasing...\n", THREAD->tid);169 printf("Thread #%" PRIu64 " releasing...\n", THREAD->tid); 170 170 171 171 while (data) { … … 177 177 178 178 if (!sh_quiet) 179 printf("Thread #% lluallocating...\n", THREAD->tid);179 printf("Thread #%" PRIu64 " allocating...\n", THREAD->tid); 180 180 181 181 while (1) { … … 189 189 190 190 if (!sh_quiet) 191 printf("Thread #% llureleasing...\n", THREAD->tid);191 printf("Thread #%" PRIu64 " releasing...\n", THREAD->tid); 192 192 193 193 while (data) { … … 199 199 200 200 if (!sh_quiet) 201 printf("Thread #% llufinished\n", THREAD->tid);201 printf("Thread #%" PRIu64 " finished\n", THREAD->tid); 202 202 203 203 slab_print_list(); -
kernel/test/print/print1.c
r7ac426e rcd8ad52 45 45 printf(" very long text 8.10s %8.10s \n", "very long text"); 46 46 47 printf(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n", 'a', 'b', 'c', 'd', 'e');48 printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n", 1, 1, 1, 1, 1);49 printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n", -1, -1, -1, -1, -1);50 printf(" 0xint: x '%#x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n", 17, 17, 17, 17, 17);47 printf(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n", 'a', 'b', 'c', 'd', 'e'); 48 printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n", 1, 1, 1, 1, 1); 49 printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n", -1, -1, -1, -1, -1); 50 printf(" 0xint: x '%#x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n", 17, 17, 17, 17, 17); 51 51 52 printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, unative_t '%# zx'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );52 printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, unative_t '%#" PRIxn "'. '%#llx' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" ); 53 53 54 54 printf(" Print to NULL '%s'\n", NULL); -
kernel/test/synch/rwlock3.c
r7ac426e rcd8ad52 46 46 47 47 if (!sh_quiet) 48 printf("cpu% d, tid %llu: trying to lock rwlock for reading....\n", CPU->id, THREAD->tid);48 printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for reading....\n", CPU->id, THREAD->tid); 49 49 50 50 rwlock_read_lock(&rwlock); … … 52 52 53 53 if (!sh_quiet) { 54 printf("cpu% d, tid %llu: success\n", CPU->id, THREAD->tid);55 printf("cpu% d, tid %llu: trying to lock rwlock for writing....\n", CPU->id, THREAD->tid);54 printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid); 55 printf("cpu%u, tid %" PRIu64 ": trying to lock rwlock for writing....\n", CPU->id, THREAD->tid); 56 56 } 57 57 … … 60 60 61 61 if (!sh_quiet) 62 printf("cpu% d, tid %llu: success\n", CPU->id, THREAD->tid);62 printf("cpu%u, tid %" PRIu64 ": success\n", CPU->id, THREAD->tid); 63 63 64 64 atomic_dec(&thread_count); … … 89 89 while (atomic_get(&thread_count) > 0) { 90 90 if (!quiet) 91 printf("Threads left: % d\n", atomic_get(&thread_count));91 printf("Threads left: %ld\n", atomic_get(&thread_count)); 92 92 thread_sleep(1); 93 93 } -
kernel/test/synch/rwlock4.c
r7ac426e rcd8ad52 75 75 76 76 if (!sh_quiet) 77 printf("cpu% d, tid %lluw+ (%d)\n", CPU->id, THREAD->tid, to);77 printf("cpu%u, tid %" PRIu64 " w+ (%d)\n", CPU->id, THREAD->tid, to); 78 78 79 79 rc = rwlock_write_lock_timeout(&rwlock, to); 80 80 if (SYNCH_FAILED(rc)) { 81 81 if (!sh_quiet) 82 printf("cpu% d, tid %lluw!\n", CPU->id, THREAD->tid);82 printf("cpu%u, tid %" PRIu64 " w!\n", CPU->id, THREAD->tid); 83 83 atomic_dec(&thread_count); 84 84 return; … … 86 86 87 87 if (!sh_quiet) 88 printf("cpu% d, tid %lluw=\n", CPU->id, THREAD->tid);88 printf("cpu%u, tid %" PRIu64 " w=\n", CPU->id, THREAD->tid); 89 89 90 90 if (rwlock.readers_in) { … … 107 107 108 108 if (!sh_quiet) 109 printf("cpu% d, tid %lluw-\n", CPU->id, THREAD->tid);109 printf("cpu%u, tid %" PRIu64 " w-\n", CPU->id, THREAD->tid); 110 110 atomic_dec(&thread_count); 111 111 } … … 120 120 121 121 if (!sh_quiet) 122 printf("cpu% d, tid %llur+ (%d)\n", CPU->id, THREAD->tid, to);122 printf("cpu%u, tid %" PRIu64 " r+ (%d)\n", CPU->id, THREAD->tid, to); 123 123 124 124 rc = rwlock_read_lock_timeout(&rwlock, to); 125 125 if (SYNCH_FAILED(rc)) { 126 126 if (!sh_quiet) 127 printf("cpu% d, tid %llur!\n", CPU->id, THREAD->tid);127 printf("cpu%u, tid %" PRIu64 " r!\n", CPU->id, THREAD->tid); 128 128 atomic_dec(&thread_count); 129 129 return; … … 131 131 132 132 if (!sh_quiet) 133 printf("cpu% d, tid %llur=\n", CPU->id, THREAD->tid);133 printf("cpu%u, tid %" PRIu64 " r=\n", CPU->id, THREAD->tid); 134 134 135 135 thread_usleep(30000); … … 137 137 138 138 if (!sh_quiet) 139 printf("cpu% d, tid %llur-\n", CPU->id, THREAD->tid);139 printf("cpu%u, tid %" PRIu64 " r-\n", CPU->id, THREAD->tid); 140 140 atomic_dec(&thread_count); 141 141 } … … 160 160 context_save(&ctx); 161 161 if (!quiet) { 162 printf("sp=%#x, readers_in=% d\n", ctx.sp, rwlock.readers_in);163 printf("Creating % dreaders\n", rd);162 printf("sp=%#x, readers_in=%" PRIc "\n", ctx.sp, rwlock.readers_in); 163 printf("Creating %" PRIu32 " readers\n", rd); 164 164 } 165 165 … … 169 169 thread_ready(thrd); 170 170 else if (!quiet) 171 printf("Could not create reader % d\n", i);171 printf("Could not create reader %" PRIu32 "\n", i); 172 172 } 173 173 174 174 if (!quiet) 175 printf("Creating % dwriters\n", wr);175 printf("Creating %" PRIu32 " writers\n", wr); 176 176 177 177 for (i = 0; i < wr; i++) { … … 180 180 thread_ready(thrd); 181 181 else if (!quiet) 182 printf("Could not create writer % d\n", i);182 printf("Could not create writer %" PRIu32 "\n", i); 183 183 } 184 184 … … 188 188 while (atomic_get(&thread_count) > 0) { 189 189 if (!quiet) 190 printf("Threads left: % d\n", atomic_get(&thread_count));190 printf("Threads left: %ld\n", atomic_get(&thread_count)); 191 191 thread_sleep(1); 192 192 } -
kernel/test/synch/rwlock5.c
r7ac426e rcd8ad52 109 109 110 110 while ((items_read.count != readers) || (items_written.count != writers)) { 111 printf("% zd readers remaining, %zd writers remaining, readers_in=%zd\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);111 printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in); 112 112 thread_usleep(100000); 113 113 } -
kernel/test/synch/semaphore2.c
r7ac426e rcd8ad52 68 68 69 69 to = random(20000); 70 printf("cpu% d, tid %lludown+ (%d)\n", CPU->id, THREAD->tid, to);70 printf("cpu%u, tid %" PRIu64 " down+ (%d)\n", CPU->id, THREAD->tid, to); 71 71 rc = semaphore_down_timeout(&sem, to); 72 72 if (SYNCH_FAILED(rc)) { 73 printf("cpu% d, tid %lludown!\n", CPU->id, THREAD->tid);73 printf("cpu%u, tid %" PRIu64 " down!\n", CPU->id, THREAD->tid); 74 74 return; 75 75 } 76 76 77 printf("cpu% d, tid %lludown=\n", CPU->id, THREAD->tid);77 printf("cpu%u, tid %" PRIu64 " down=\n", CPU->id, THREAD->tid); 78 78 thread_usleep(random(30000)); 79 79 80 80 semaphore_up(&sem); 81 printf("cpu% d, tid %lluup\n", CPU->id, THREAD->tid);81 printf("cpu%u, tid %" PRIu64 " up\n", CPU->id, THREAD->tid); 82 82 } 83 83 … … 92 92 93 93 k = random(7) + 1; 94 printf("Creating % dconsumers\n", k);94 printf("Creating %" PRIu32 " consumers\n", k); 95 95 for (i = 0; i < k; i++) { 96 96 thrd = thread_create(consumer, NULL, TASK, 0, "consumer", false); -
kernel/test/test.h
r7ac426e rcd8ad52 37 37 38 38 #include <arch/types.h> 39 #include <typedefs.h> 39 40 40 typedef char * (*test_entry_t)(bool);41 typedef char *(*test_entry_t)(bool); 41 42 42 43 typedef struct { 43 char * 44 char * 44 char *name; 45 char *desc; 45 46 test_entry_t entry; 46 47 bool safe; -
kernel/test/thread/thread1.c
r7ac426e rcd8ad52 49 49 while (atomic_get(&finish)) { 50 50 if (!sh_quiet) 51 printf("% llu", THREAD->tid);51 printf("%" PRIu64 " ", THREAD->tid); 52 52 thread_usleep(100000); 53 53 }
Note:
See TracChangeset
for help on using the changeset viewer.