Mercurial > ecos
annotate packages/language/cxx/ustl/current/tests/bvt25.cpp @ 3201:f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
uSTL HEAD.
* cdl/ustl.cdl: Build interactive tests under control of a CDL
option. Build ROM filesystem for bvt25 test under control of a
CDL option.
* tests/bvt25.cpp: Use ROM filesystem if available.
* tests/bvt05.cpp, tests/bvt16.cpp: Reduce data structure sizes
for embedded use.
| author | jld |
|---|---|
| date | Thu, 21 Feb 2013 08:34:10 +0000 |
| parents | 4885e0722884 |
| children |
| rev | line source |
|---|---|
| 2904 | 1 // This file is part of the uSTL library, an STL implementation. |
| 2 // | |
| 3152 | 3 // Copyright (c) 2005 by Mike Sharov <msharov@users.sourceforge.net> |
| 2904 | 4 // This file is free software, distributed under the MIT License. |
| 5 | |
| 6 #include "stdtest.h" | |
| 7 | |
|
3201
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
8 #ifdef CYGIMP_USTL_TESTS_BVT25_ROMFS |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
9 # include <cyg/fileio/fileio.h> |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
10 # if (CYG_BYTEORDER == CYG_LSBFIRST) |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
11 # include <cyg/ustl/bvt25fs_le.h> |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
12 # else |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
13 # include <cyg/ustl/bvt25fs_be.h> |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
14 # endif |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
15 MTAB_ENTRY(romfs_mte1, "/", "romfs", "", (CYG_ADDRWORD) &filedata[0]); |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
16 #endif |
|
f5d2adaa8595
* src/fstream.cpp: Fix processing of fstream openmode. Patch from
jld
parents:
3152
diff
changeset
|
17 |
| 2904 | 18 void TestFStream (void) |
| 19 { | |
| 20 fstream fs ("bvt/bvt25.std", ios::in | ios::nocreate); | |
| 21 if (!fs && !(fs.open("bvt25.std", ios::in | ios::nocreate),fs)) | |
| 22 cout << "Failed to open bvt25.std" << endl; | |
| 23 string buf; | |
| 24 buf.resize (fs.size()); | |
| 25 if (buf.size() != 71) | |
| 26 cout << "fstream.size() returned " << buf.size() << endl; | |
| 27 fs.read (buf.begin(), buf.size()); | |
| 28 cout << buf; | |
| 29 fs.close(); | |
| 30 } | |
| 31 | |
| 32 StdBvtMain (TestFStream) |
