You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by ca...@apache.org on 2008/02/15 11:18:22 UTC
svn commit: r627996 - in /logging/log4cxx/trunk/src: main/cpp/mdc.cpp
test/cpp/filetestcase.cpp test/cpp/helpers/messagebuffertest.cpp
test/cpp/leveltestcase.cpp test/cpp/logunit.cpp test/cpp/logunit.h
test/cpp/streamtestcase.cpp
Author: carnold
Date: Fri Feb 15 02:18:20 2008
New Revision: 627996
URL: http://svn.apache.org/viewvc?rev=627996&view=rev
Log:
LOGCXX-85: Add missing log4cxx:: on UniChar references
Modified:
logging/log4cxx/trunk/src/main/cpp/mdc.cpp
logging/log4cxx/trunk/src/test/cpp/filetestcase.cpp
logging/log4cxx/trunk/src/test/cpp/helpers/messagebuffertest.cpp
logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp
logging/log4cxx/trunk/src/test/cpp/logunit.cpp
logging/log4cxx/trunk/src/test/cpp/logunit.h
logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp
Modified: logging/log4cxx/trunk/src/main/cpp/mdc.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/mdc.cpp?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/mdc.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/mdc.cpp Fri Feb 15 02:18:20 2008
@@ -154,7 +154,7 @@
putLS(key, v);
}
-std::basic_string<UniChar> MDC::get(const std::basic_string<UniChar>& key)
+std::basic_string<log4cxx::UniChar> MDC::get(const std::basic_string<log4cxx::UniChar>& key)
{
LOG4CXX_DECODE_UNICHAR(lkey, key);
LogString lvalue;
@@ -165,7 +165,7 @@
return std::basic_string<UniChar>();
}
-void MDC::put(const std::basic_string<UniChar>& key, const std::basic_string<UniChar>& value)
+void MDC::put(const std::basic_string<UniChar>& key, const std::basic_string<log4cxx::UniChar>& value)
{
LOG4CXX_DECODE_UNICHAR(lkey, key);
LOG4CXX_DECODE_UNICHAR(lvalue, value);
@@ -173,7 +173,7 @@
}
-std::basic_string<UniChar> MDC::remove(const std::basic_string<UniChar>& key)
+std::basic_string<log4cxx::UniChar> MDC::remove(const std::basic_string<log4cxx::UniChar>& key)
{
LOG4CXX_DECODE_UNICHAR(lkey, key);
LogString lvalue;
Modified: logging/log4cxx/trunk/src/test/cpp/filetestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/filetestcase.cpp?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/filetestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/filetestcase.cpp Fri Feb 15 02:18:20 2008
@@ -100,7 +100,7 @@
#if LOG4CXX_UNICHAR_API
void unicharConstructor() {
- const UniChar filename[] = { 'i', 'n', 'p', 'u', 't', '/',
+ const log4cxx::UniChar filename[] = { 'i', 'n', 'p', 'u', 't', '/',
'p', 'a', 't', 't', 'e', 'r', 'n', 'L', 'a', 'y', 'o', 'u', 't', '1', '.',
'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's', 0 };
File propFile(filename);
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/messagebuffertest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/messagebuffertest.cpp?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/messagebuffertest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/messagebuffertest.cpp Fri Feb 15 02:18:20 2008
@@ -154,24 +154,24 @@
#if LOG4CXX_UNICHAR_API
void testInsertConstUStr() {
MessageBuffer buf;
- const UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
- const UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
- const UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
+ const log4cxx::UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
+ const log4cxx::UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
+ const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
UniCharMessageBuffer& retval = buf << hello << world;
- LOGUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(greeting), buf.str(retval));
+ LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval));
LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
}
void testInsertUString() {
MessageBuffer buf;
- const UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
- const UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
- const UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
+ const log4cxx::UniChar hello[] = { 'H', 'e', 'l', 'l', 'o', 0 };
+ const log4cxx::UniChar world[] = { ',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
+ const log4cxx::UniChar greeting[] = { 'H', 'e', 'l', 'l', 'o',
',', ' ', 'W', 'o', 'r', 'l', 'd', 0 };
- UniCharMessageBuffer& retval = buf << std::basic_string<UniChar>(hello)
- << std::basic_string<UniChar>(world);
- LOGUNIT_ASSERT_EQUAL(std::basic_string<UniChar>(greeting), buf.str(retval));
+ UniCharMessageBuffer& retval = buf << std::basic_string<log4cxx::UniChar>(hello)
+ << std::basic_string<log4cxx::UniChar>(world);
+ LOGUNIT_ASSERT_EQUAL(std::basic_string<log4cxx::UniChar>(greeting), buf.str(retval));
LOGUNIT_ASSERT_EQUAL(false, buf.hasStream());
}
Modified: logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/leveltestcase.cpp Fri Feb 15 02:18:20 2008
@@ -99,7 +99,7 @@
* Tests Level.toLevel("TRACE");
*/
void testUniCharStringToTrace() {
- const UniChar name[] = { 'T', 'R', 'A', 'C', 'E', 0 };
+ const log4cxx::UniChar name[] = { 'T', 'R', 'A', 'C', 'E', 0 };
LevelPtr trace(Level::toLevel(name));
LOGUNIT_ASSERT(trace->toString() == LOG4CXX_STR("TRACE"));
}
Modified: logging/log4cxx/trunk/src/test/cpp/logunit.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.cpp?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.cpp Fri Feb 15 02:18:20 2008
@@ -173,8 +173,8 @@
}
#endif
#if LOG4CXX_LOGCHAR_IS_UNICHAR || LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
-void TestFixture::assertEquals(const std::basic_string<UniChar> expected,
- const std::basic_string<UniChar> actual,
+void TestFixture::assertEquals(const std::basic_string<log4cxx::UniChar> expected,
+ const std::basic_string<log4cxx::UniChar> actual,
const char* expectedExpr,
const char* actualExpr,
int lineno) {
Modified: logging/log4cxx/trunk/src/test/cpp/logunit.h
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.h?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.h (original)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.h Fri Feb 15 02:18:20 2008
@@ -21,7 +21,7 @@
#if defined(_MSC_VER)
#pragma warning (push)
-#pragma warning ( disable: 4231 4251 4275 4786 )
+#pragma warning ( disable: 4231 4251 4275 4786 )
#endif
#include "abts.h"
@@ -29,6 +29,7 @@
#include <map>
#include <string>
#include <vector>
+
#include <log4cxx/logstring.h>
namespace LogUnit {
@@ -78,8 +79,8 @@
int lineno);
#endif
#if LOG4CXX_LOGCHAR_IS_UNICHAR || LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
- void assertEquals(const std::basic_string<UniChar> expected,
- const std::basic_string<UniChar> actual,
+ void assertEquals(const std::basic_string<log4cxx::UniChar> expected,
+ const std::basic_string<log4cxx::UniChar> actual,
const char* expectedExpr,
const char* actualExpr, int lineno);
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp?rev=627996&r1=627995&r2=627996&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/streamtestcase.cpp Fri Feb 15 02:18:20 2008
@@ -426,24 +426,24 @@
#if LOG4CXX_UNICHAR_API
void testUniChar() {
LoggerPtr root(Logger::getRootLogger());
- const UniChar msg[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
+ const log4cxx::UniChar msg[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
LOG4CXX_INFO(root, msg);
LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testUniCharAppend() {
LoggerPtr root(Logger::getRootLogger());
- const UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
- const UniChar msg2[] = { ':', ' ', 'D', 'e', 't', 'a', 'i', 'l', 's', ' ', 't', 'o', ' ', 'f', 'o', 'l', 'l', 'o', 'w', 0 };
+ const log4cxx::UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
+ const log4cxx::UniChar msg2[] = { ':', ' ', 'D', 'e', 't', 'a', 'i', 'l', 's', ' ', 't', 'o', ' ', 'f', 'o', 'l', 'l', 'o', 'w', 0 };
LOG4CXX_INFO(root, msg1 << msg2);
LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testUniCharWidth() {
LoggerPtr root(Logger::getRootLogger());
- const UniChar openBracket[] = { '[', 0 };
- const UniChar closeBracket[] = { ']', 0 };
- LOG4CXX_INFO(root, openBracket << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill((UniChar) '_') << 10.0 << closeBracket);
+ const log4cxx::UniChar openBracket[] = { '[', 0 };
+ const log4cxx::UniChar closeBracket[] = { ']', 0 };
+ LOG4CXX_INFO(root, openBracket << std::fixed << std::setprecision(2) << std::setw(7) << std::right << std::setfill((log4cxx::UniChar) '_') << 10.0 << closeBracket);
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
@@ -451,15 +451,15 @@
void testULogStreamSimple() {
ulogstream root(Logger::getRootLogger(), Level::getInfo());
- const UniChar msg[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
+ const log4cxx::UniChar msg[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
root << msg << LOG4CXX_ENDMSG;
LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
void testULogStreamMultiple() {
ulogstream root(Logger::getRootLogger(), Level::getInfo());
- const UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
- const UniChar msg2[] = { ':', ' ', 'D', 'e', 't', 'a', 'i', 'l', 's', ' ', 't', 'o', ' ', 'f', 'o', 'l', 'l', 'o', 'w', 0 };
+ const log4cxx::UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0 };
+ const log4cxx::UniChar msg2[] = { ':', ' ', 'D', 'e', 't', 'a', 'i', 'l', 's', ' ', 't', 'o', ' ', 'f', 'o', 'l', 'l', 'o', 'w', 0 };
root << msg1 << msg2 << LOG4CXX_ENDMSG;
LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
}
@@ -505,20 +505,20 @@
void testULogStreamWidth() {
LoggerPtr root(Logger::getRootLogger());
ulogstream os(root, Level::getInfo());
- const UniChar openBracket[] = { '[', 0 };
- const UniChar closeBracket[] = { ']', 0 };
+ const log4cxx::UniChar openBracket[] = { '[', 0 };
+ const log4cxx::UniChar closeBracket[] = { ']', 0 };
os << openBracket << std::fixed << std::setprecision(2) << std::setw(7) << std::right
- << std::setfill((UniChar) '_') << 10.0 << closeBracket << LOG4CXX_ENDMSG;
+ << std::setfill((log4cxx::UniChar) '_') << 10.0 << closeBracket << LOG4CXX_ENDMSG;
LOGUNIT_ASSERT_EQUAL((size_t) 1, vectorAppender->getVector().size());
spi::LoggingEventPtr event(vectorAppender->getVector()[0]);
LogString msg(event->getMessage());
LOGUNIT_ASSERT_EQUAL(LogString(LOG4CXX_STR("[__10.00]")), msg);
}
- void ureport(std::basic_ostream<UniChar>& os) {
- const UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'j', 'u', 's', 't', ' ' , 'i', 'n', ':', ' ' , '\n', 0 };
- const UniChar msg2[] = { 'U', 's', 'e', ' ', 'l', 'o', 'g', 's', 't', 'r', 'e', 'a', 'm', '\n', 0 };
+ void ureport(std::basic_ostream<log4cxx::UniChar>& os) {
+ const log4cxx::UniChar msg1[] = { 'T', 'h', 'i', 's', ' ', 'j', 'u', 's', 't', ' ' , 'i', 'n', ':', ' ' , '\n', 0 };
+ const log4cxx::UniChar msg2[] = { 'U', 's', 'e', ' ', 'l', 'o', 'g', 's', 't', 'r', 'e', 'a', 'm', '\n', 0 };
os << msg1;
os << msg2;
}