diff options
Diffstat (limited to 'tests/gtests')
-rw-r--r-- | tests/gtests/functions/FN_cpp_type_test.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/gtests/functions/FN_cpp_type_test.cc b/tests/gtests/functions/FN_cpp_type_test.cc index 1297ca471b7..6b6b1c846be 100644 --- a/tests/gtests/functions/FN_cpp_type_test.cc +++ b/tests/gtests/functions/FN_cpp_type_test.cc @@ -17,6 +17,7 @@ #include "testing/testing.h" #include "FN_cpp_type.hh" +#include "FN_cpp_types.hh" namespace blender::fn { @@ -69,6 +70,12 @@ struct TestType { other.value = move_assigned_from_value; return *this; } + + friend std::ostream &operator<<(std::ostream &stream, const TestType &value) + { + stream << value.value; + return stream; + } }; MAKE_CPP_TYPE(TestType, TestType) @@ -305,4 +312,13 @@ TEST(cpp_type, FillUninitialized) EXPECT_EQ(buffer2[9], 0); } +TEST(cpp_type, DebugPrint) +{ + int value = 42; + std::stringstream ss; + CPPType_int32.debug_print((void *)&value, ss); + std::string text = ss.str(); + EXPECT_EQ(text, "42"); +} + } // namespace blender::fn |