95TEST(OstreamHelpers, pointers) {
96 auto helped_representation = [](
const auto& val) {
97 std::ostringstream os;
101 auto expected_representation = [&](
const auto& ptr) {
102 using gem5::stl_helpers::operator<<;
103 std::ostringstream os;
104 auto* raw_ptr = &*ptr;
105 os <<
'(' << raw_ptr <<
": " << *ptr <<
')';
111 EXPECT_EQ(helped_representation(ptr), expected_representation(ptr));
113 auto uptr = std::make_unique<std::string>(
"Hello, World!");
114 EXPECT_EQ(helped_representation(uptr), expected_representation(uptr));
116 auto sptr = std::make_shared<std::optional<bool>>();
117 EXPECT_EQ(helped_representation(sptr), expected_representation(sptr));