Commit 94ef360c authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Increase size of one of the test files so I can use it for testing incremental...

Increase size of one of the test files so I can use it for testing incremental builds. Needs to be large enough to leave some clean bricks.
parent 282789ca
...@@ -246,8 +246,8 @@ std::ostream& operator<<(std::ostream& os, TestTwiceFlags value) ...@@ -246,8 +246,8 @@ std::ostream& operator<<(std::ostream& os, TestTwiceFlags value)
static bool static bool
do_test_reopen(const std::string& filename, TestTwiceFlags flags) do_test_reopen(const std::string& filename, TestTwiceFlags flags)
{ {
// Size (10,100,100) -> 100,000 samples // Size (66,100,100) -> 660,000 samples
// Bricksize (8,32,64) -> size in bricks 2,4,2 -> nlods 3 // Bricksize (8,32,64) -> size in bricks 9,4,2 -> nlods 5
// Valuerange (-100,+155) -> If int8: zero-centric. Ignored for float. // Valuerange (-100,+155) -> If int8: zero-centric. Ignored for float.
// Writes will be a combination of: // Writes will be a combination of:
// - Full bricks. // - Full bricks.
...@@ -275,7 +275,7 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags) ...@@ -275,7 +275,7 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags)
// If not finalized on the last close there will be no lowres, stats, histo. // If not finalized on the last close there will be no lowres, stats, histo.
const int expect_nlods = const int expect_nlods =
(flagset(TestTwiceFlags::step2_finalize) ? 3 : (flagset(TestTwiceFlags::step2_finalize) ? 5 :
1); 1);
const bool expect_finalized = const bool expect_finalized =
...@@ -357,7 +357,7 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags) ...@@ -357,7 +357,7 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags)
const std::int64_t expect_15 = (written_1015_r1) / (7*13) + (written_1015_r2) / (7*13); const std::int64_t expect_15 = (written_1015_r1) / (7*13) + (written_1015_r2) / (7*13);
const std::int64_t expect_10 = (written_1015_r1 + written_1015_r2 - expect_15); const std::int64_t expect_10 = (written_1015_r1 + written_1015_r2 - expect_15);
const std::int64_t expect_stat_cnt = expect_finalized ? 10*100*100 : 0; const std::int64_t expect_stat_cnt = expect_finalized ? 66*100*100 : 0;
const double expect_stat_sum = !expect_finalized ? 0 : const double expect_stat_sum = !expect_finalized ? 0 :
(expect_41 * 41) + (expect_41 * 41) +
...@@ -380,7 +380,7 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags) ...@@ -380,7 +380,7 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags)
ZgyWriterArgs firstargs = ZgyWriterArgs() ZgyWriterArgs firstargs = ZgyWriterArgs()
.iocontext(Test_Utils::default_context()) .iocontext(Test_Utils::default_context())
.filename(filename) .filename(filename)
.size(10, 100, 100) .size(66, 100, 100)
.bricksize(8, 32, 64) .bricksize(8, 32, 64)
.datatype((flags & TestTwiceFlags::step1_vt_int8) != TestTwiceFlags::nothing ? .datatype((flags & TestTwiceFlags::step1_vt_int8) != TestTwiceFlags::nothing ?
SampleDataType::int8 : SampleDataType::float32) SampleDataType::int8 : SampleDataType::float32)
...@@ -514,7 +514,6 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags) ...@@ -514,7 +514,6 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags)
// Output human readable result. // Output human readable result.
if (verbose()) { if (verbose()) {
SampleStatistics stat(reader->statistics());
std::stringstream stat_ss; std::stringstream stat_ss;
stat_ss << "cnt = " << actual_stat.cnt stat_ss << "cnt = " << actual_stat.cnt
<< " min = " << actual_stat.min << " min = " << actual_stat.min
...@@ -552,15 +551,15 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags) ...@@ -552,15 +551,15 @@ do_test_reopen(const std::string& filename, TestTwiceFlags flags)
ok = TEST_EQUAL(actual_lod1first, expect_lod1first) && ok; ok = TEST_EQUAL(actual_lod1first, expect_lod1first) && ok;
ok = TEST_EQUAL(actual_lod0second, expect_lod0second) && ok; ok = TEST_EQUAL(actual_lod0second, expect_lod0second) && ok;
ok = TEST_EQUAL(actual_lod1second, expect_lod1second) && ok; ok = TEST_EQUAL(actual_lod1second, expect_lod1second) && ok;
ok = TEST_EQUAL(actual_coord, expect_coord) && ok; ok = TEST_EQUAL_FLOAT(actual_coord, expect_coord, 0.001) && ok;
ok = TEST_EQUAL(actual_samplerate, expect_samplerate) && ok; ok = TEST_EQUAL_FLOAT(actual_samplerate, expect_samplerate, 0.001) && ok;
ok = TEST_EQUAL(actual_41, expect_41) && ok; ok = TEST_EQUAL(actual_41, expect_41) && ok;
ok = TEST_EQUAL(actual_42, expect_42) && ok; ok = TEST_EQUAL(actual_42, expect_42) && ok;
ok = TEST_EQUAL(actual_10, expect_10) && ok; ok = TEST_EQUAL(actual_10, expect_10) && ok;
ok = TEST_EQUAL(actual_15, expect_15) && ok; ok = TEST_EQUAL(actual_15, expect_15) && ok;
ok = TEST_EQUAL(actual_stat.cnt, expect_stat_cnt) && ok; ok = TEST_EQUAL(actual_stat.cnt, expect_stat_cnt) && ok;
ok = TEST_EQUAL(actual_stat.sum, expect_stat_sum) && ok; ok = TEST_EQUAL_FLOAT(actual_stat.sum, expect_stat_sum, 0.1) && ok;
ok = TEST_EQUAL(actual_stat.ssq, expect_stat_ssq) && ok; ok = TEST_EQUAL_FLOAT(actual_stat.ssq, expect_stat_ssq, 0.1) && ok;
// TODO-@@@ FAILS because this is one place where incremental rebuild // TODO-@@@ FAILS because this is one place where incremental rebuild
// does make a difference. The range can only grow. Actually I should // does make a difference. The range can only grow. Actually I should
// modify this test to try out both incremental and full rebuild, // modify this test to try out both incremental and full rebuild,
...@@ -1319,6 +1318,8 @@ test_reopen_track_changes() ...@@ -1319,6 +1318,8 @@ test_reopen_track_changes()
// LOD3: 3 x 3 x 1 33 x 69 x 26 // LOD3: 3 x 3 x 1 33 x 69 x 26
// LOD4: 2 x 2 x 1 17 x 35 x 13 // LOD4: 2 x 2 x 1 17 x 35 x 13
// LOD5: 1 x 1 x 1 9 x 18 x 7 // LOD5: 1 x 1 x 1 9 x 18 x 7
//
// Sum 2142 fullres and 388 lowres = 2530 total.
{ {
// Create empty file with 6 lod levels // Create empty file with 6 lod levels
...@@ -1403,10 +1404,10 @@ test_reopen_track_changes() ...@@ -1403,10 +1404,10 @@ test_reopen_track_changes()
* If that is changed then the asserts in the test need to be relaxed. * If that is changed then the asserts in the test need to be relaxed.
*/ */
static void static void
test_reopen_bad_histo() test_reopen_bad_histogram()
{ {
typedef TestTwiceFlags F; typedef TestTwiceFlags F;
LocalFileAutoDelete lad("reopen_bad_histo.zgy"); LocalFileAutoDelete lad("reopen_bad_histogram.zgy");
TEST_CHECK(do_test_reopen(lad.name(), TEST_CHECK(do_test_reopen(lad.name(),
F::step1_write | F::step1_write |
F::step1_finalize | F::step1_finalize |
...@@ -1612,7 +1613,7 @@ public: ...@@ -1612,7 +1613,7 @@ public:
register_test("reopen.update_too_old", test_reopen_update_too_old); register_test("reopen.update_too_old", test_reopen_update_too_old);
register_test("reopen.update_bad_vt", test_reopen_update_bad_vt); register_test("reopen.update_bad_vt", test_reopen_update_bad_vt);
register_test("reopen.empty", test_reopen_empty); register_test("reopen.empty", test_reopen_empty);
register_test("reopen.reopen_bad_histo", test_reopen_bad_histo); register_test("reopen.bad_histogram", test_reopen_bad_histogram);
register_test("reopen.reopen", test_reopen); register_test("reopen.reopen", test_reopen);
register_test("reopen.zgypublic", test_reopen_zgypublic); register_test("reopen.zgypublic", test_reopen_zgypublic);
register_test("reopen.track_changes", test_reopen_track_changes); register_test("reopen.track_changes", test_reopen_track_changes);
......
Supports Markdown
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