diff options
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/myriadfs.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/tests/myriadfs.cpp b/src/tests/myriadfs.cpp index cb6c6c3..1266e4b 100644 --- a/src/tests/myriadfs.cpp +++ b/src/tests/myriadfs.cpp | |||
@@ -30,6 +30,14 @@ int main() | |||
30 | Bu::MyriadStream ms = mfs.open("/etc/hello", Bu::MyriadFs::Read ); | 30 | Bu::MyriadStream ms = mfs.open("/etc/hello", Bu::MyriadFs::Read ); |
31 | ms.write("world, again!"); | 31 | ms.write("world, again!"); |
32 | } | 32 | } |
33 | { | ||
34 | Bu::MyriadStream ms = mfs.open("/etc/trunc", Bu::MyriadFs::Write ); | ||
35 | ms.write("[longer text shouldn't be seen]"); | ||
36 | } | ||
37 | { | ||
38 | Bu::MyriadStream ms = mfs.open("/etc/trunc", Bu::MyriadFs::Write|Bu::MyriadFs::Create|Bu::MyriadFs::Truncate ); | ||
39 | ms.write("[short text]"); | ||
40 | } | ||
33 | 41 | ||
34 | sio << "Reading files..." << sio.nl; | 42 | sio << "Reading files..." << sio.nl; |
35 | { | 43 | { |
@@ -44,5 +52,11 @@ int main() | |||
44 | buf[ms.read( buf, 512 )] = '\0'; | 52 | buf[ms.read( buf, 512 )] = '\0'; |
45 | sio << "read: '" << buf << "'" << sio.nl; | 53 | sio << "read: '" << buf << "'" << sio.nl; |
46 | } | 54 | } |
55 | { | ||
56 | Bu::MyriadStream ms = mfs.open("/etc/trunc", Bu::MyriadFs::Read ); | ||
57 | char buf[512]; | ||
58 | buf[ms.read( buf, 512 )] = '\0'; | ||
59 | sio << "read: '" << buf << "'" << sio.nl; | ||
60 | } | ||
47 | } | 61 | } |
48 | 62 | ||