diff --git a/src/util/format/formatter.cpp b/src/util/format/formatter.cpp index f4abebf..8536f0f 100644 --- a/src/util/format/formatter.cpp +++ b/src/util/format/formatter.cpp @@ -97,7 +97,7 @@ void Formatter::format(Builder& builder, const char* value) const { Formatter::format( builder, - value != nullptr ? std::string_view { value, strlen(value) } : "(nil)"); + value != nullptr ? std::string_view { value, strlen(value) } : "nullptr"); } // Pointer diff --git a/src/util/format/formatter.h b/src/util/format/formatter.h index 64e0088..6664a09 100644 --- a/src/util/format/formatter.h +++ b/src/util/format/formatter.h @@ -149,7 +149,7 @@ struct Formatter { void format(Builder& builder, T* value) const { value == nullptr - ? builder.putString("0x0") + ? builder.putString("nullptr") : builder.putPointer(static_cast(value)); } }; diff --git a/test/unit/testutilformat.cpp b/test/unit/testutilformat.cpp index 0a3ed4f..ddcd55a 100644 --- a/test/unit/testutilformat.cpp +++ b/test/unit/testutilformat.cpp @@ -26,7 +26,7 @@ TEST_CASE(FormatBasicTypes) EXPECT_EQ(result, ""); result = Util::format("{}", nullptr); - EXPECT_EQ(result, "(nil)"); + EXPECT_EQ(result, "nullptr"); int* number = new int(3); result = Util::format("{}", number);