Changeset 280a27e in mainline for test


Ignore:
Timestamp:
2006-04-16T13:16:44Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50de918
Parents:
c624b96
Message:

Printf ported back from uspace to kernel.
Printf calls changed to match new conventions.

Location:
test
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • test/fpu/fpu1/test.c

    rc624b96 r280a27e  
    9494
    9595                if((int)(100000000*e)!=E_10e8)
    96                         panic("tid%d: e*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
     96                        panic("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
    9797        }
    9898
    99         printf("tid%d: e*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
     99        printf("tid%d: e*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*e),(__native) E_10e8);
    100100        atomic_inc(&threads_ok);
    101101}
     
    132132#ifdef __ia64_ARCH_H__
    133133                if((int)(1000000*pi)!=PI_10e8)
    134                         panic("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
     134                        panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (1000000*pi),(__native) (PI_10e8/100));
    135135#else
    136136                if((int)(100000000*pi)!=PI_10e8)
    137                         panic("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
     137                        panic("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
    138138#endif
    139139
    140140        }
    141141
    142         printf("tid%d: pi*10e8=%d should be %d\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
     142        printf("tid%d: pi*10e8=%zd should be %zd\n", THREAD->tid, (__native) (100000000*pi),(__native) PI_10e8);
    143143        atomic_inc(&threads_ok);
    144144}
  • test/mm/falloc1/test.c

    rc624b96 r280a27e  
    6060                               
    6161                                if (ALIGN_UP(frames[allocated], FRAME_SIZE << order) != frames[allocated]) {
    62                                         panic("Test failed. Block at address %X (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
     62                                        panic("Test failed. Block at address %P (size %dK) is not aligned\n", frames[allocated], (FRAME_SIZE << order) >> 10);
    6363                                }
    6464                               
  • test/mm/falloc2/test.c

    rc624b96 r280a27e  
    7878                                for (k = 0; k <= ((FRAME_SIZE << order) - 1); k++) {
    7979                                        if (((__u8 *) frames[i])[k] != val) {
    80                                                 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);
     80                                                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);
    8181                                                failed();
    8282                                        }
  • test/mm/mapping1/test.c

    rc624b96 r280a27e  
    5151        frame1 = PA2KA(PFN2ADDR(frame_alloc(ONE_FRAME, FRAME_KA)));
    5252
    53         printf("Writing %L to physical address %P.\n", VALUE0, KA2PA(frame0));
     53        printf("Writing %#X to physical address %P.\n", VALUE0, KA2PA(frame0));
    5454        *((__u32 *) frame0) = VALUE0;
    55         printf("Writing %L to physical address %P.\n", VALUE1, KA2PA(frame1));
     55        printf("Writing %#X to physical address %P.\n", VALUE1, KA2PA(frame1));
    5656        *((__u32 *) frame1) = VALUE1;
    5757       
     
    6161        page_mapping_insert(AS_KERNEL, PAGE1, KA2PA(frame1), PAGE_PRESENT | PAGE_WRITE);
    6262       
    63         printf("Value at virtual address %P is %L.\n", PAGE0, v0 = *((__u32 *) PAGE0));
    64         printf("Value at virtual address %P is %L.\n", PAGE1, v1 = *((__u32 *) PAGE1));
     63        printf("Value at virtual address %P is %#X.\n", PAGE0, v0 = *((__u32 *) PAGE0));
     64        printf("Value at virtual address %P is %#X.\n", PAGE1, v1 = *((__u32 *) PAGE1));
    6565       
    6666        ASSERT(v0 == VALUE0);
    6767        ASSERT(v1 == VALUE1);
    6868
    69         printf("Writing %X to virtual address %P.\n", 0, PAGE0);
     69        printf("Writing %#X to virtual address %P.\n", 0, PAGE0);
    7070        *((__u32 *) PAGE0) = 0;
    71         printf("Writing %X to virtual address %P.\n", 0, PAGE1);
     71        printf("Writing %#X to virtual address %P.\n", 0, PAGE1);
    7272        *((__u32 *) PAGE1) = 0;
    7373
     
    7575        v1 = *((__u32 *) PAGE1);
    7676       
    77         printf("Value at virtual address %P is %X.\n", PAGE0, *((__u32 *) PAGE0));     
    78         printf("Value at virtual address %P is %X.\n", PAGE1, *((__u32 *) PAGE1));
     77        printf("Value at virtual address %P is %#X.\n", PAGE0, *((__u32 *) PAGE0));     
     78        printf("Value at virtual address %P is %#X.\n", PAGE1, *((__u32 *) PAGE1));
    7979
    8080        ASSERT(v0 == 0);
  • test/print/print1/test.c

    rc624b96 r280a27e  
    3131void test(void)
    3232{
     33        __native nat = 0x12345678u;
    3334        printf(" Printf test \n");
    34         printf(" Q  %Q  %q \n",0x1111111111111111ull, 0x2222222222222222ull);
    35         printf(" Q,l  %Q  %l \n", 0x3333333333333333ull, 0x01234567);
    36         printf(" l,Q  %l  %Q \n", 0x01234567, 0x4444444444444444ull);
    37         printf(" L  %L  %l \n",0x01234567 ,0x01234567);   
    38         printf(" W  %W  %w \n",0x0123 ,0x0123);   
    39         printf(" B  %B  %b \n",0x01 ,0x01);
     35       
     36        printf(" text 10.8s %*.*s \n", 5, 3, "text");
     37        printf(" very long text 10.8s %10.8s \n", "very long text");
     38        printf(" text 8.10s %8.10s \n", "text");
     39        printf(" very long text 8.10s %8.10s \n", "very long text");
     40
     41        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' );
     42        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 );
     43        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 );
     44        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 );
     45
     46        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" );
     47       
    4048        printf(" Print to NULL '%s'\n",NULL);
    4149        return;
  • test/synch/rwlock4/test.c

    rc624b96 r280a27e  
    133133               
    134134                context_save(&ctx);
    135                 printf("sp=%X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
     135                printf("sp=%#X, readers_in=%d\n", ctx.sp, rwlock.readers_in);
    136136               
    137137                k = random(7) + 1;
  • test/synch/rwlock5/test.c

    rc624b96 r280a27e  
    9292                writers = (4-i)*WRITERS;
    9393
    94                 printf("Creating %d readers and %d writers...", readers, writers);
     94                printf("Creating %ld readers and %ld writers...", readers, writers);
    9595               
    9696                for (j=0; j<(READERS+WRITERS)/2; j++) {
     
    117117       
    118118                while (items_read.count != readers || items_written.count != writers) {
    119                         printf("%d readers remaining, %d writers remaining, readers_in=%d\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
     119                        printf("%zd readers remaining, %zd writers remaining, readers_in=%zd\n", readers - items_read.count, writers - items_written.count, rwlock.readers_in);
    120120                        thread_usleep(100000);
    121121                }
Note: See TracChangeset for help on using the changeset viewer.