diff options
Diffstat (limited to 'test/gtest/possible-contents.cpp')
-rw-r--r-- | test/gtest/possible-contents.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/test/gtest/possible-contents.cpp b/test/gtest/possible-contents.cpp index 63486e7a9..ea2a0c0f0 100644 --- a/test/gtest/possible-contents.cpp +++ b/test/gtest/possible-contents.cpp @@ -25,17 +25,24 @@ template<typename T> void assertNotEqualSymmetric(const T& a, const T& b) { // Asserts a combined with b (in any order) is equal to c. template<typename T> void assertCombination(const T& a, const T& b, const T& c) { - T temp1 = a; - temp1.combine(b); + T temp1 = PossibleContents::combine(a, b); assertEqualSymmetric(temp1, c); // Also check the type, as nulls will compare equal even if their types // differ. We want to make sure even the types are identical. assertEqualSymmetric(temp1.getType(), c.getType()); - T temp2 = b; - temp2.combine(a); + T temp2 = PossibleContents::combine(b, a); assertEqualSymmetric(temp2, c); assertEqualSymmetric(temp2.getType(), c.getType()); + + // Verify the shorthand API works like the static one. + T temp3 = a; + temp3.combine(b); + assertEqualSymmetric(temp3, temp1); + + T temp4 = b; + temp4.combine(a); + assertEqualSymmetric(temp4, temp2); } // Parse a module from text and return it. |