diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2009-02-19 22:46:37 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2009-02-19 22:46:37 +0000 |
| commit | 76e10d8d10a9743444942fd0ba5d0f58a122f370 (patch) | |
| tree | f2e65c6e6baad263391dd7dc981a7f8e167bb707 /src/tests | |
| parent | 0a8a63f836fe8fc6f8b21517d8a5b012544f5e89 (diff) | |
| download | libbu++-76e10d8d10a9743444942fd0ba5d0f58a122f370.tar.gz libbu++-76e10d8d10a9743444942fd0ba5d0f58a122f370.tar.bz2 libbu++-76e10d8d10a9743444942fd0ba5d0f58a122f370.tar.xz libbu++-76e10d8d10a9743444942fd0ba5d0f58a122f370.zip | |
Hey, this code isn't being used by anyone anymore, ever, anywhere, but I madeoriginal
it compile to get some old tests, and I figured I may as well not throw all that
away.
Diffstat (limited to '')
| -rw-r--r-- | src/tests/fstring.cpp | 2 | ||||
| -rw-r--r-- | src/tests/md5test.cpp | 19 |
2 files changed, 17 insertions, 4 deletions
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 ) | |||
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | #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() ); | 20 | #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() ); |
| 21 | int main( int argc, char *argv ) | 21 | int main( int argc, char **argv ) |
| 22 | { | 22 | { |
| 23 | FString str("th"); | 23 | FString str("th"); |
| 24 | 24 | ||
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 @@ | |||
| 2 | #include <string.h> | 2 | #include <string.h> |
| 3 | #include "md5.h" | 3 | #include "md5.h" |
| 4 | 4 | ||
| 5 | int main() | 5 | #include <sys/types.h> |
| 6 | #include <sys/stat.h> | ||
| 7 | #include <unistd.h> | ||
| 8 | |||
| 9 | |||
| 10 | int main( int argc, char *argv[] ) | ||
| 6 | { | 11 | { |
| 7 | md5 mproc; | 12 | md5 mproc; |
| 8 | md5sum sum; | 13 | md5sum sum; |
| 9 | char hexstr[33]; | 14 | char hexstr[33]; |
| 10 | 15 | ||
| 16 | struct stat s; | ||
| 17 | stat( argv[1], &s ); | ||
| 18 | char *buf = new char[s.st_size]; | ||
| 19 | FILE *fh = fopen( argv[1], "rb" ); | ||
| 20 | fread( buf, 1, s.st_size, fh ); | ||
| 21 | fclose( fh ); | ||
| 22 | |||
| 11 | memset( hexstr, 0, 33 ); | 23 | memset( hexstr, 0, 33 ); |
| 12 | 24 | ||
| 13 | mproc.sumString( &sum, "qwertyuiopasdfgh" ); | 25 | mproc.sumData( &sum, buf, s.st_size ); |
| 14 | mproc.sumToHex( &sum, hexstr ); | 26 | mproc.sumToHex( &sum, hexstr ); |
| 15 | printf("sum: %s\n", hexstr ); | 27 | printf("sum: %s\n", hexstr ); |
| 16 | printf("chk: 1ebfc043d8880b758b13ddc8aa1638ef\n"); | 28 | |
| 29 | delete[] buf; | ||
| 17 | 30 | ||
| 18 | return 0; | 31 | return 0; |
| 19 | } | 32 | } |
