Skip to content

Commit c932282

Browse files
committed
add tests
1 parent 927e8fe commit c932282

4 files changed

Lines changed: 83 additions & 0 deletions

File tree

tests/bson/test_vectorstring.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <iostream>
2+
#include <rfl.hpp>
3+
#include <string>
4+
#include <vector>
5+
6+
#include "write_and_read.hpp"
7+
8+
namespace test_vectorstring {
9+
10+
struct TestStruct {
11+
rfl::Vectorstring vectorstring;
12+
std::vector<rfl::Vectorstring> vectorstrings;
13+
};
14+
15+
TEST(bson, test_vectorstring) {
16+
const auto vstr = rfl::Vectorstring(
17+
{'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'});
18+
const auto test = TestStruct{
19+
.vectorstring = vstr,
20+
.vectorstrings = std::vector<rfl::Vectorstring>({vstr, vstr, vstr})};
21+
write_and_read(test);
22+
}
23+
} // namespace test_vectorstring

tests/cbor/test_vectorstring.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
#include <rfl.hpp>
3+
#include <string>
4+
#include <vector>
5+
6+
#include "write_and_read.hpp"
7+
8+
namespace test_vectorstring {
9+
10+
struct TestStruct {
11+
rfl::Vectorstring vectorstring;
12+
};
13+
14+
TEST(cbor, test_vectorstring) {
15+
const auto test = TestStruct{
16+
.vectorstring = rfl::Vectorstring({'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'})};
17+
18+
write_and_read(test);
19+
}
20+
} // namespace test_vectorstring
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
#include <rfl.hpp>
3+
#include <string>
4+
#include <vector>
5+
6+
#include "write_and_read.hpp"
7+
8+
namespace test_vectorstring {
9+
10+
struct TestStruct {
11+
rfl::Vectorstring vectorstring;
12+
};
13+
14+
TEST(msgpack, test_vectorstring) {
15+
const auto test =
16+
TestStruct{.vectorstring = rfl::Vectorstring({'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'})};
17+
18+
write_and_read(test);
19+
}
20+
} // namespace test_vectorstring

tests/ubjson/test_vectorstring.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <iostream>
2+
#include <rfl.hpp>
3+
#include <string>
4+
#include <vector>
5+
6+
#include "write_and_read.hpp"
7+
8+
namespace test_vectorstring {
9+
10+
struct TestStruct {
11+
rfl::Vectorstring vectorstring;
12+
};
13+
14+
TEST(ubjson, test_vectorstring) {
15+
const auto test =
16+
TestStruct{.vectorstring = rfl::Vectorstring({'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'})};
17+
18+
write_and_read(test);
19+
}
20+
} // namespace test_vectorstring

0 commit comments

Comments
 (0)