diff options
Diffstat (limited to 'src/unit/archive.unit')
-rw-r--r-- | src/unit/archive.unit | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/unit/archive.unit b/src/unit/archive.unit index 58f7d2b..6b975ac 100644 --- a/src/unit/archive.unit +++ b/src/unit/archive.unit | |||
@@ -8,17 +8,17 @@ | |||
8 | 8 | ||
9 | #include "bu/membuf.h" | 9 | #include "bu/membuf.h" |
10 | #include "bu/array.h" | 10 | #include "bu/array.h" |
11 | #include "bu/archive.h" | 11 | #include "bu/archivebinary.h" |
12 | 12 | ||
13 | using namespace Bu; | 13 | using namespace Bu; |
14 | 14 | ||
15 | suite Archive | 15 | suite ArchiveBinary |
16 | { | 16 | { |
17 | test primitives | 17 | test primitives |
18 | { | 18 | { |
19 | MemBuf mb; | 19 | MemBuf mb; |
20 | { | 20 | { |
21 | Archive ar( mb, Archive::save ); | 21 | ArchiveBinary ar( mb, ArchiveBinary::save ); |
22 | ar << (int8_t)1; | 22 | ar << (int8_t)1; |
23 | ar << (uint8_t)2; | 23 | ar << (uint8_t)2; |
24 | ar << (int16_t)3; | 24 | ar << (int16_t)3; |
@@ -41,7 +41,7 @@ suite Archive | |||
41 | } | 41 | } |
42 | mb.setPos( 0 ); | 42 | mb.setPos( 0 ); |
43 | { | 43 | { |
44 | Archive ar( mb, Archive::load ); | 44 | ArchiveBinary ar( mb, ArchiveBinary::load ); |
45 | int8_t p1; | 45 | int8_t p1; |
46 | uint8_t p2; | 46 | uint8_t p2; |
47 | int16_t p3; | 47 | int16_t p3; |
@@ -104,7 +104,7 @@ suite Archive | |||
104 | { | 104 | { |
105 | MemBuf mb; | 105 | MemBuf mb; |
106 | { | 106 | { |
107 | Archive ar( mb, Archive::save ); | 107 | ArchiveBinary ar( mb, ArchiveBinary::save ); |
108 | String sStr("This is a test string."); | 108 | String sStr("This is a test string."); |
109 | List<int> lList; | 109 | List<int> lList; |
110 | lList.append( 10 ); | 110 | lList.append( 10 ); |
@@ -117,7 +117,7 @@ suite Archive | |||
117 | } | 117 | } |
118 | mb.setPos( 0 ); | 118 | mb.setPos( 0 ); |
119 | { | 119 | { |
120 | Archive ar( mb, Archive::load ); | 120 | ArchiveBinary ar( mb, ArchiveBinary::load ); |
121 | String sStr; | 121 | String sStr; |
122 | List<int> lList; | 122 | List<int> lList; |
123 | ar >> sStr; | 123 | ar >> sStr; |
@@ -137,7 +137,7 @@ suite Archive | |||
137 | { | 137 | { |
138 | MemBuf mb; | 138 | MemBuf mb; |
139 | { | 139 | { |
140 | Archive ar( mb, Archive::save ); | 140 | ArchiveBinary ar( mb, ArchiveBinary::save ); |
141 | String sStr("This is a test string."); | 141 | String sStr("This is a test string."); |
142 | Array<int> lArray; | 142 | Array<int> lArray; |
143 | lArray.append( 10 ); | 143 | lArray.append( 10 ); |
@@ -150,7 +150,7 @@ suite Archive | |||
150 | } | 150 | } |
151 | mb.setPos( 0 ); | 151 | mb.setPos( 0 ); |
152 | { | 152 | { |
153 | Archive ar( mb, Archive::load ); | 153 | ArchiveBinary ar( mb, ArchiveBinary::load ); |
154 | String sStr; | 154 | String sStr; |
155 | Array<int> lArray; | 155 | Array<int> lArray; |
156 | ar >> sStr; | 156 | ar >> sStr; |
@@ -170,7 +170,7 @@ suite Archive | |||
170 | { | 170 | { |
171 | MemBuf mb; | 171 | MemBuf mb; |
172 | { | 172 | { |
173 | Archive ar( mb, Archive::save ); | 173 | ArchiveBinary ar( mb, ArchiveBinary::save ); |
174 | Array<String> lArray; | 174 | Array<String> lArray; |
175 | lArray.append( "10" ); | 175 | lArray.append( "10" ); |
176 | lArray.append( "20" ); | 176 | lArray.append( "20" ); |
@@ -181,7 +181,7 @@ suite Archive | |||
181 | } | 181 | } |
182 | mb.setPos( 0 ); | 182 | mb.setPos( 0 ); |
183 | { | 183 | { |
184 | Archive ar( mb, Archive::load ); | 184 | ArchiveBinary ar( mb, ArchiveBinary::load ); |
185 | Array<String> lArray; | 185 | Array<String> lArray; |
186 | ar >> lArray; | 186 | ar >> lArray; |
187 | unitTest( lArray.getSize() == 4 ); | 187 | unitTest( lArray.getSize() == 4 ); |