From 2510c1619a5962e340d56f08103621b1ce7d9796 Mon Sep 17 00:00:00 2001 From: Stephen Webb Date: Tue, 1 Aug 2023 10:39:02 +1000 Subject: [PATCH] Convert CFString without using std::basic_string --- src/test/cpp/helpers/messagebuffertest.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/test/cpp/helpers/messagebuffertest.cpp b/src/test/cpp/helpers/messagebuffertest.cpp index a34dfb5b4..0d6a0177a 100644 --- a/src/test/cpp/helpers/messagebuffertest.cpp +++ b/src/test/cpp/helpers/messagebuffertest.cpp @@ -203,7 +203,18 @@ LOGUNIT_CLASS(MessageBufferTest) LOGUNIT_ASSERT_EQUAL(std::basic_string(greeting), buf.str(retval)); LOGUNIT_ASSERT_EQUAL(false, buf.hasStream()); } - +#elif LOG4CXX_CFSTRING_API + void testInsertCFString() + { + MessageBuffer buf; + const log4cxx::logchar greeting[] = { 'H', 'e', 'l', 'l', 'o', + ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 + }; + CharMessageBuffer& retval = buf << CFSTR("Hello") + << CFSTR(", World"); + LOGUNIT_ASSERT_EQUAL(std::basic_string(greeting), buf.str(retval)); + LOGUNIT_ASSERT_EQUAL(false, buf.hasStream()); + } #endif };