From 76e10d8d10a9743444942fd0ba5d0f58a122f370 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 19 Feb 2009 22:46:37 +0000 Subject: Hey, this code isn't being used by anyone anymore, ever, anywhere, but I made it compile to get some old tests, and I figured I may as well not throw all that away. --- src/tests/fstring.cpp | 2 +- src/tests/md5test.cpp | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'src/tests') diff --git a/src/tests/fstring.cpp b/src/tests/fstring.cpp index 271738c..92f8cc4 100644 --- a/src/tests/fstring.cpp +++ b/src/tests/fstring.cpp @@ -18,7 +18,7 @@ void thing( FString str ) } #define pem printf("---------\n%08X: %s\n%08X: %s\n", (unsigned int)str.c_str(), str.c_str(), (unsigned int)str2.c_str(), str2.c_str() ); -int main( int argc, char *argv ) +int main( int argc, char **argv ) { FString str("th"); diff --git a/src/tests/md5test.cpp b/src/tests/md5test.cpp index 6f832df..2cc8868 100644 --- a/src/tests/md5test.cpp +++ b/src/tests/md5test.cpp @@ -2,18 +2,31 @@ #include #include "md5.h" -int main() + #include + #include + #include + + +int main( int argc, char *argv[] ) { md5 mproc; md5sum sum; char hexstr[33]; + struct stat s; + stat( argv[1], &s ); + char *buf = new char[s.st_size]; + FILE *fh = fopen( argv[1], "rb" ); + fread( buf, 1, s.st_size, fh ); + fclose( fh ); + memset( hexstr, 0, 33 ); - mproc.sumString( &sum, "qwertyuiopasdfgh" ); + mproc.sumData( &sum, buf, s.st_size ); mproc.sumToHex( &sum, hexstr ); printf("sum: %s\n", hexstr ); - printf("chk: 1ebfc043d8880b758b13ddc8aa1638ef\n"); + + delete[] buf; return 0; } -- cgit v1.2.3