Search
lxdream.org :: lxdream/test/lib.c
lxdream 0.9.1
released Jun 29
Download Now
filename test/lib.c
changeset 185:6755a04c447f
next190:f7653df5e832
author nkeynes
date Tue Jul 11 01:35:27 2006 +0000 (15 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
view annotate diff log raw
     1 #include "lib.h"
     3 void fwrite_dump( FILE *f, char *buf, int length)
     4 {
     5     int i,j;
     6     for( i=0; i<length; i+=16 ) {
     7 	fprintf( f, "%08X: ", i );
     8         for( j=0; j<16 && i+j < length; j+=4 ) {
     9 	    unsigned int val = *((volatile unsigned int *)(buf+i+j));
    10 	    fprintf( f, "%02X %02X %02X %02X  ", val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF, (val>>24)&0xFF );
    11         }
    12         for( ;j<16; j+= 4 ) {
    13             fprintf( f, "             " );
    14         }
    15 	for( j=0; j<16 && i+j < length; j++ ) {
    16 	    fprintf( f, "%c", isprint(buf[i+j]) ? buf[i+j] : '.' );
    17 	}
    18 	fprintf( f, "\n");
    19     }
    20 }
.