[Yunq] Add basic test for repeated fields.
This commit is contained in:
parent
65e9fa1767
commit
27c39d05e8
5 changed files with 80 additions and 1 deletions
|
|
@ -86,3 +86,15 @@ TEST_CASE("Cap Serialization Sidebuffer", "[yunq]") {
|
|||
|
||||
REQUIRE(b.cap() == 1234);
|
||||
}
|
||||
|
||||
TEST_CASE("Repeated Setter/Getter", "[yunq]") {
|
||||
ex::Repeated r;
|
||||
r.mutable_unsigned_ints().PushBack(1);
|
||||
r.add_unsigned_ints(2);
|
||||
uint64_t c = 3;
|
||||
r.add_unsigned_ints(glcr::Move(c));
|
||||
|
||||
REQUIRE(r.unsigned_ints()[0] == 1);
|
||||
REQUIRE(r.unsigned_ints()[1] == 2);
|
||||
REQUIRE(r.unsigned_ints()[2] == 3);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue