diff options
Diffstat (limited to '')
| -rw-r--r-- | src/tests/md5.cpp | 27 | ||||
| -rw-r--r-- | src/tests/stdstream.cpp | 4 |
2 files changed, 29 insertions, 2 deletions
diff --git a/src/tests/md5.cpp b/src/tests/md5.cpp new file mode 100644 index 0000000..dea957b --- /dev/null +++ b/src/tests/md5.cpp | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #include "bu/sio.h" | ||
| 2 | #include "bu/file.h" | ||
| 3 | #include "bu/md5.h" | ||
| 4 | |||
| 5 | using Bu::sio; | ||
| 6 | |||
| 7 | int main( int argc, char *argv[] ) | ||
| 8 | { | ||
| 9 | argv++, argc--; | ||
| 10 | for(; *argv; argv++ ) | ||
| 11 | { | ||
| 12 | Bu::File fIn( *argv, Bu::File::Read ); | ||
| 13 | Bu::Md5 m; | ||
| 14 | |||
| 15 | char buf[1000]; | ||
| 16 | for(;;) | ||
| 17 | { | ||
| 18 | int iRead = fIn.read( buf, 1000 ); | ||
| 19 | m.addData( buf, iRead ); | ||
| 20 | if( iRead < 1000 ) | ||
| 21 | break; | ||
| 22 | } | ||
| 23 | |||
| 24 | sio << m.getResult() << " *" << *argv << sio.nl; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
diff --git a/src/tests/stdstream.cpp b/src/tests/stdstream.cpp index cb22e22..0949a8c 100644 --- a/src/tests/stdstream.cpp +++ b/src/tests/stdstream.cpp | |||
| @@ -24,8 +24,8 @@ int main() | |||
| 24 | sio << 0.123 << sio.nl; | 24 | sio << 0.123 << sio.nl; |
| 25 | sio << true << " and then " << false << sio.nl; | 25 | sio << true << " and then " << false << sio.nl; |
| 26 | 26 | ||
| 27 | //for( int j = 2; j <= 36; j++ ) | 27 | for( int j = 2; j <= 36; j++ ) |
| 28 | // sio << "radix(" << j << ") = " << Fmt().radix( j ) << 255 << sio.nl; | 28 | sio << "radix(" << j << ") = " << Fmt().radix( j ).width( 8 ).align( Fmt::Right ) << 255 << sio.nl; |
| 29 | 29 | ||
| 30 | return 0; | 30 | return 0; |
| 31 | } | 31 | } |
