Fixed vector test on Windows

This commit is contained in:
Wouter van Oortmerssen
2017-02-08 15:59:52 -08:00
parent c57ab92e60
commit a9514de978
2 changed files with 7 additions and 2 deletions

View File

@@ -946,6 +946,11 @@ class Builder FLATBUFFERS_FINAL_CLASS {
EndVector(start, false, false);
}
}
template<typename T> void Vector(const char *key, const T *elems,
size_t len) {
Key(key);
Vector(elems, len);
}
template<typename T> void Vector(const std::vector<T> &vec) {
Vector(vec.data(), vec.size());
}

View File

@@ -1373,8 +1373,8 @@ void FlexBuffersTest() {
slb.IndirectFloat(4.0f);
});
int ints[] = { 1, 2, 3 };
slb.Add("bar", ints);
slb.FixedTypedVector("bar3", ints, sizeof(ints) / sizeof(int));
slb.Vector("bar", ints, 3);
slb.FixedTypedVector("bar3", ints, 3);
slb.Double("foo", 100);
slb.Map("mymap", [&]() {
slb.String("foo", "Fred"); // Testing key and string reuse.