Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1195 → Rev 1196

/kernel/trunk/test/synch/rwlock4/test.c
132,7 → 132,7
thread_t *thrd;
context_save(&ctx);
printf("sp=%X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
printf("sp=%#X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
k = random(7) + 1;
printf("Creating %d readers\n", k);
/kernel/trunk/test/synch/rwlock5/test.c
91,7 → 91,7
readers = i*READERS;
writers = (4-i)*WRITERS;
 
printf("Creating %d readers and %d writers...", readers, writers);
printf("Creating %ld readers and %ld writers...", readers, writers);
for (j=0; j<(READERS+WRITERS)/2; j++) {
for (k=0; k<i; k++) {
116,7 → 116,7
waitq_wakeup(&can_start, WAKEUP_ALL);
while (items_read.count != readers || items_written.count != writers) {
printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
printf("%zd readers remaining, %zd writers remaining, readers_in=%zd\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
thread_usleep(100000);
}
}
/kernel/trunk/test/mm/falloc1/test.c
59,7 → 59,7
frames[allocated] = PA2KA(PFN2ADDR(frame_alloc_rc(order, FRAME_ATOMIC | FRAME_KA, &status)));
if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
panic("Test failed. Block at address %X (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
panic("Test failed. Block at address %P (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
}
if (status == 0) {
/kernel/trunk/test/mm/falloc2/test.c
77,7 → 77,7
for (i = 0; i < allocated; i++) {
for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
if (((__u8 *) frames[i])[k] != val) {
printf("Thread #%d (cpu%d): Unexpected data (%d) in block %P offset %X\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
printf("Thread #%d (cpu%d): Unexpected data (%d) in block %P offset %#zX\n", THREAD->tid, CPU->id, ((char *) frames[i])[k], frames[i], k);
failed();
}
}
/kernel/trunk/test/mm/mapping1/test.c
50,9 → 50,9
frame0 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
frame1 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
 
printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
printf("Writing %#X to physical address %P.\n", VALUE0, KA2PA(frame0));
*((__u32 *) frame0) = VALUE0;
printf("Writing %L to physical address %P.\n", VALUE1, KA2PA(frame1));
printf("Writing %#X to physical address %P.\n", VALUE1, KA2PA(frame1));
*((__u32 *) frame1) = VALUE1;
printf("Mapping virtual address %P to physical address %P.\n", PAGE0, KA2PA(frame0));
60,22 → 60,22
printf("Mapping virtual address %P to physical address %P.\n", PAGE1, KA2PA(frame1));
page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
printf("Value at virtual address %P is %L.\n", PAGE0, v0 = *((__u32 *) PAGE0));
printf("Value at virtual address %P is %L.\n", PAGE1, v1 = *((__u32 *) PAGE1));
printf("Value at virtual address %P is %#X.\n", PAGE0, v0 = *((__u32 *) PAGE0));
printf("Value at virtual address %P is %#X.\n", PAGE1, v1 = *((__u32 *) PAGE1));
ASSERT(v0 == VALUE0);
ASSERT(v1 == VALUE1);
 
printf("Writing %X to virtual address %P.\n", 0, PAGE0);
printf("Writing %#X to virtual address %P.\n", 0, PAGE0);
*((__u32 *) PAGE0) = 0;
printf("Writing %X to virtual address %P.\n", 0, PAGE1);
printf("Writing %#X to virtual address %P.\n", 0, PAGE1);
*((__u32 *) PAGE1) = 0;
 
v0 = *((__u32 *) PAGE0);
v1 = *((__u32 *) PAGE1);
printf("Value at virtual address %P is %X.\n", PAGE0, *((__u32 *) PAGE0));
printf("Value at virtual address %P is %X.\n", PAGE1, *((__u32 *) PAGE1));
printf("Value at virtual address %P is %#X.\n", PAGE0, *((__u32 *) PAGE0));
printf("Value at virtual address %P is %#X.\n", PAGE1, *((__u32 *) PAGE1));
 
ASSERT(v0 == 0);
ASSERT(v1 == 0);
/kernel/trunk/test/fpu/fpu1/test.c
93,10 → 93,10
}
 
if((int)(100000000*e)!=E_10e8)
panic("tid%d: e*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
}
 
printf("tid%d: e*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
atomic_inc(&threads_ok);
}
 
131,15 → 131,15
 
#ifdef __ia64_ARCH_H__
if((int)(1000000*pi)!=PI_10e8)
panic("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
#else
if((int)(100000000*pi)!=PI_10e8)
panic("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
#endif
 
}
 
printf("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
atomic_inc(&threads_ok);
}
 
/kernel/trunk/test/print/print1/test.c
30,13 → 30,21
 
void test(void)
{
__native nat = 0x12345678u;
printf(" Printf test \n");
printf(" Q %Q %q \n",0x1111111111111111ull, 0x2222222222222222ull);
printf(" Q,l %Q %l \n", 0x3333333333333333ull, 0x01234567);
printf(" l,Q %l %Q \n", 0x01234567, 0x4444444444444444ull);
printf(" L %L %l \n",0x01234567 ,0x01234567);
printf(" W %W %w \n",0x0123 ,0x0123);
printf(" B %B %b \n",0x01 ,0x01);
printf(" text 10.8s %*.*s \n", 5, 3, "text");
printf(" very long text 10.8s %10.8s \n", "very long text");
printf(" text 8.10s %8.10s \n", "text");
printf(" very long text 8.10s %8.10s \n", "very long text");
 
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' );
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 );
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 );
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 );
 
printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, __native '%#zX'. '%#llX' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
printf(" Print to NULL '%s'\n",NULL);
return;
}