summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/nids.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/tests/nids.cpp b/src/tests/nids.cpp
deleted file mode 100644
index 22bf450..0000000
--- a/src/tests/nids.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * Copyright (C) 2007-2010 Xagasoft, All rights reserved.
3 *
4 * This file is part of the libbu++ library and is released under the
5 * terms of the license contained in the file LICENSE.
6 */
7
8#include "bu/file.h"
9#include "bu/nids.h"
10#include "bu/nidsstream.h"
11
12int main( int argc, char *argv[] )
13{
14 if( argc < 3 )
15 {
16 printf("usage: %s [r|w] <output>\n\n", argv[0] );
17 return 1;
18 }
19
20 if( argv[1][0] == 'w' )
21 {
22 Bu::File fOut( argv[2],
23 Bu::File::ReadWrite|Bu::File::Create|Bu::File::Truncate );
24 Bu::Nids n( fOut );
25
26 n.initialize( 32, 1 );
27/* Bu::NidsStream s = n.openStream( n.createStream() );
28
29 Bu::FString sBuf( 350 );
30 memset( sBuf.getStr(), 'a', 350 );
31 s.write( sBuf );*/
32 }
33 else if( argv[1][0] == 'r' )
34 {
35 Bu::File fOut( argv[2], Bu::File::Read );
36 Bu::Nids n( fOut );
37 n.initialize();
38/*
39 Bu::NidsStream s = n.openStream( 0 );
40 char buf[75];
41 for( int j = 0; j < 3; j++ )
42 {
43 int iRead = s.read( buf, 75 );
44 fwrite( buf, 1, iRead, stdout );
45 printf("\n(read %d chars)\n", iRead );
46 }
47 printf("Position: %ld\n", s.tell() );
48 */
49 }
50 else
51 {
52 printf("r or w, those are your choices.\n");
53 }
54
55 return 0;
56}
57