13 #include "eckit/testing/Test.h"
14 #include "eckit/filesystem/PathName.h"
15 #include "eckit/config/Resource.h"
19 using namespace eckit::testing;
25 eckit::Resource<eckit::PathName>
testDataPath(
"$TEST_DATA_DIRECTORY",
"..");
27 CASE(
"Test access Table iterator") {
29 eckit::PathName filename =
testDataPath /
"2000010106.odb";
31 std::unique_ptr<eckit::DataHandle> dh(filename.fileHandle());
35 auto it = reader.
begin();
36 auto end = reader.
end();
39 size_t tableCount = 0;
40 eckit::Offset lastOffset = 0;
42 EXPECT(dh->estimate() == eckit::Length(155557962));
47 EXPECT(it->rowCount() == (tableCount == 333? 1753 : 10000));
48 EXPECT(it->nextPosition() > lastOffset);
49 EXPECT(it->nextPosition() <= dh->estimate());
50 EXPECT(dh->estimate() == eckit::Length(155557962));
51 lastOffset = it->nextPosition();
53 numRows += it->rowCount();
57 EXPECT(dh->estimate() == eckit::Length(155557962));
58 EXPECT(lastOffset == eckit::Offset(155557962));
59 EXPECT(numRows == 3321753);
66 int main(
int argc,
char* argv[]) {
67 return run_tests(argc, argv);
int main(int argc, char *argv[])
eckit::Resource< eckit::PathName > testDataPath("$TEST_DATA_DIRECTORY", "..")
CASE("Test access Table iterator")