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/md5test.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/tests/md5test.cpp') 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