tests: the parallel unmerged MTZ table is compared bitwise again
UnmergedMtzTable's columns hold NaN for missing values, and vector<float> == compares NaN unequal to itself, so the serial-vs-parallel check could fail spuriously. Each column is compared with memcmp, as the test did before the MtzTable change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13a3d7c873
commit
55184eb096
1 file changed
+6
-2
@@ -187,8 +187,12 @@ TEST_CASE("Unmerged MTZ: built on several workers, the same rows as on one", "[w
|
||||
OutputProvenance{}, 8);
|
||||
REQUIRE(serial.columns[0].values.size() > 100000);
|
||||
REQUIRE(parallel.columns.size() == serial.columns.size());
|
||||
for (size_t c = 0; c < serial.columns.size(); c++)
|
||||
CHECK(parallel.columns[c].values == serial.columns[c].values);
|
||||
// Bitwise, so the NaN of a missing value compares equal to itself.
|
||||
for (size_t c = 0; c < serial.columns.size(); c++) {
|
||||
REQUIRE(parallel.columns[c].values.size() == serial.columns[c].values.size());
|
||||
CHECK(std::memcmp(parallel.columns[c].values.data(), serial.columns[c].values.data(),
|
||||
serial.columns[c].values.size() * sizeof(float)) == 0);
|
||||
}
|
||||
REQUIRE(parallel.batches.size() == serial.batches.size());
|
||||
CHECK(parallel.batches.front().number == serial.batches.front().number);
|
||||
CHECK(parallel.batches.back().number == serial.batches.back().number);
|
||||
|
||||
Reference in new issue
Block a user