aboutsummaryrefslogtreecommitdiff
path: root/tests/main.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-08-02 21:49:52 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-08-02 21:49:59 +0200
commit3cab1b89229409225c5a45ee1d0308e45c309433 (patch)
tree9b10fabf243d76f26be4f96a990bf37637e4e435 /tests/main.cpp
parent75768a21955cb6570c31ca87d48fc0b6a2f8490b (diff)
Add skip method to deserializer1.0.3
Diffstat (limited to 'tests/main.cpp')
-rw-r--r--tests/main.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/main.cpp b/tests/main.cpp
index 7cb9c1d..0521e50 100644
--- a/tests/main.cpp
+++ b/tests/main.cpp
@@ -21,6 +21,7 @@ void testDeserialize(sibs::SafeSerializer &serializer)
REQUIRE(deserializer.extract<uint32_t>() == 3563634);
REQUIRE(deserializer.extract<uint64_t>() == 204232532533423632);
REQUIRE(deserializer.extract<uint8_t>() == 2);
+ deserializer.skip(4);
char str[6];
str[5] = '\0';
deserializer.extract((uint8_t*)str, 5);
@@ -58,9 +59,10 @@ int main()
serializer.add((uint32_t)3563634);
serializer.add((uint64_t)204232532533423632);
serializer.add((uint8_t)2);
+ serializer.add("skip", 4);
serializer.add((uint8_t*)"hello", 5);
serializer.add(expectedTestStruct);
- REQUIRE(serializer.getBuffer().size() == 18 + sizeof(expectedTestStruct));
+ REQUIRE(serializer.getBuffer().size() == 22 + sizeof(expectedTestStruct));
testDeserialize(serializer);
sibs::SafeSerializer movedSerializer(std::move(serializer));