Skip to content

Commit

Permalink
DPL Test: use some float numbers that don't require optimization-spec…
Browse files Browse the repository at this point in the history
…ific rounding
  • Loading branch information
davidrohr authored and ktf committed Mar 7, 2024
1 parent c944a62 commit afe8b51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Framework/Core/test/test_Variants.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ TEST_CASE("VariantTest")
REQUIRE(vstrings[i] == (vscca.get<std::string*>())[i]);
}

float m[3][4] = {{0.1, 0.2, 0.3, 0.4}, {0.5, 0.6, 0.7, 0.8}, {0.9, 1.0, 1.1, 1.2}};
float m[3][4] = {{0.5, 0.25, 0.125, 0.0625}, {1.0, 2.0, 3.0, 4.0}, {2.0, 0.5, 4.0, 0.25}};
Array2D mm(&m[0][0], 3, 4);
Variant vmm(mm);
auto const& mmc = vmm.get<Array2D<float>>();
Expand All @@ -167,7 +167,7 @@ TEST_CASE("VariantTest")
}
std::stringstream ssm;
ssm << vmma;
REQUIRE(ssm.str() == "{\"values\":[[0.10000000149011612,0.20000000298023225,0.30000001192092898,0.4000000059604645],[0.5,0.6000000238418579,0.699999988079071,0.800000011920929],[0.8999999761581421,1.0,1.100000023841858,1.2000000476837159]]}");
REQUIRE(ssm.str() == "{\"values\":[[0.5,0.25,0.125,0.0625],[1.0,2.0,3.0,4.0],[2.0,0.5,4.0,0.25]]}");

LabeledArray<float> laf{&m[0][0], 3, 4, {"r1", "r2", "r3"}, {"c1", "c2", "c3", "c4"}};
Variant vlaf(laf);
Expand Down

0 comments on commit afe8b51

Please sign in to comment.