Skip to content

Commit b559b8d

Browse files
committed
[RDF] Make Snapshot test more readable, add a test for collection size.
Instead of testing in a for loop, (which possibly prints 10k failures), use std::all_of to make a test output more readable. Furthermore, test the size of the 3rd collection, which maybe just got forgotten.
1 parent 40f8428 commit b559b8d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tree/dataframe/test/dataframe_snapshot.cxx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,10 @@ void ReadWriteCarray(const char *outFileNameBase)
750750
EXPECT_TRUE(r.Next());
751751
EXPECT_EQ(rv.GetSize(), 100000u);
752752
EXPECT_EQ(rvb.GetSize(), 100000u);
753-
for (auto e : rv)
754-
EXPECT_EQ(e, 84);
755-
for (auto e : rvb)
756-
EXPECT_TRUE(e);
757-
for (auto e : rvl)
758-
EXPECT_EQ(e, 42);
753+
EXPECT_EQ(rvl.GetSize(), 100000u);
754+
EXPECT_TRUE(std::all_of(rv.begin(), rv.end(), [](auto elm){ return elm == 84; })) << rv[0] << " " << rv[1] << " " << rv[2];
755+
EXPECT_TRUE(std::all_of(rvb.begin(), rvb.end(), [](auto elm){ return elm; })) << rvb[0] << " " << rvb[1] << " " << rvb[2];
756+
EXPECT_TRUE(std::all_of(rvl.begin(), rvl.end(), [](auto elm){ return elm == 42; })) << rvl[0] << " " << rvl[1] << " " << rvl[2];
759757

760758
// Size 3
761759
EXPECT_TRUE(r.Next());

0 commit comments

Comments
 (0)