MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / StringFloatVecClose

Function StringFloatVecClose

tests/testutils/UnitTest.cpp:44–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44bool StringFloatVecClose(std::string value, std::string expected, float eps)
45{
46 std::vector<float> a;
47 std::vector<float> b;
48 if (StringVecToFloatVec(a, StringUtils::SplitByWhiteSpaces(value)) &&
49 StringVecToFloatVec(b, StringUtils::SplitByWhiteSpaces(expected)))
50 {
51 if (a.size() == b.size())
52 {
53 for(unsigned int i = 0; i < a.size(); i++)
54 {
55 if (std::abs(a[i] - b[i]) >= eps)
56 {
57 return false;
58 }
59 }
60 return true;
61 }
62 }
63 return false;
64}
65
66
67int unit_test_failures{ 0 };

Callers

nothing calls this directly

Calls 3

SplitByWhiteSpacesFunction · 0.85
StringVecToFloatVecFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected