Commit f34b88ff authored by Kenton Varda's avatar Kenton Varda

Add David's overflow test (it passes). Fixes #195

parent 9ada015e
......@@ -591,6 +591,25 @@ TEST(Encoding, SetListToEmpty) {
#undef CHECK_EMPTY_NONNULL
}
#if CAPNP_EXPENSIVE_TESTS
TEST(Encoding, LongList) {
// This test allocates 512MB of contiguous memory and takes several seconds, so we usually don't
// run it. It is run before release, though.
MallocMessageBuilder builder;
auto root = builder.initRoot<TestAllTypes>();
uint length = 1 << 27;
auto list = root.initUInt64List(length);
for (uint ii = 0; ii < length; ++ii) {
list.set(ii, ii);
}
for (uint ii = 0; ii < length; ++ii) {
ASSERT_EQ(list[ii], ii);
}
}
#endif
// =======================================================================================
TEST(Encoding, ListUpgrade) {
......
......@@ -219,7 +219,8 @@ done
# because GCC warns about code that I know is OK. Disable sign-compare because I've fixed more
# sign-compare warnings than probably all other warnings combined and I've never seen it flag a
# real problem. Disable unused parameters because it's stupidly noisy and never a real problem.
export CXXFLAGS="-O2 -DDEBUG -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-sign-compare -Wno-unused-parameter"
# Enable expensive release-gating tests.
export CXXFLAGS="-O2 -DDEBUG -Wall -Wextra -Werror -Wno-strict-aliasing -Wno-sign-compare -Wno-unused-parameter -DCAPNP_EXPENSIVE_TESTS=1"
STAGING=$PWD/tmp-staging
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment