Search
lxdream.org :: lxdream/test/lib.c :: diff
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 (16 years ago)
permissions -rw-r--r--
last change First commit of system test framework. 3 initial test cases (incomplete):
testide, testmath, and testta
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/lib.c Tue Jul 11 01:35:27 2006 +0000
1.3 @@ -0,0 +1,20 @@
1.4 +#include "lib.h"
1.5 +
1.6 +void fwrite_dump( FILE *f, char *buf, int length)
1.7 +{
1.8 + int i,j;
1.9 + for( i=0; i<length; i+=16 ) {
1.10 + fprintf( f, "%08X: ", i );
1.11 + for( j=0; j<16 && i+j < length; j+=4 ) {
1.12 + unsigned int val = *((volatile unsigned int *)(buf+i+j));
1.13 + fprintf( f, "%02X %02X %02X %02X ", val&0xFF, (val>>8)&0xFF, (val>>16)&0xFF, (val>>24)&0xFF );
1.14 + }
1.15 + for( ;j<16; j+= 4 ) {
1.16 + fprintf( f, " " );
1.17 + }
1.18 + for( j=0; j<16 && i+j < length; j++ ) {
1.19 + fprintf( f, "%c", isprint(buf[i+j]) ? buf[i+j] : '.' );
1.20 + }
1.21 + fprintf( f, "\n");
1.22 + }
1.23 +}
.