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/01/25 00:47:24 UTC

svn commit: r615082 - in /logging/log4cxx/trunk/src/test/cpp: patternlayouttest.cpp util/threadfilter.cpp util/xmlthreadfilter.cpp

Author: carnold
Date: Thu Jan 24 15:47:19 2008
New Revision: 615082

URL: http://svn.apache.org/viewvc?rev=615082&view=rev
Log:
LOGCXX-221: Tweak patterns for decimal threads tests

Modified:
    logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp
    logging/log4cxx/trunk/src/test/cpp/util/threadfilter.cpp
    logging/log4cxx/trunk/src/test/cpp/util/xmlthreadfilter.cpp

Modified: logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp?rev=615082&r1=615081&r2=615082&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/patternlayouttest.cpp Thu Jan 24 15:47:19 2008
@@ -45,16 +45,16 @@
 
 
 #define REGEX_STR(x) x
-#define PAT0 REGEX_STR("\\[0\\?x\\?[0-9A-F]+]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message [0-9]\\{1,2\\}")
+#define PAT0 REGEX_STR("\\[[0-9A-FXx]*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* - Message [0-9]\\{1,2\\}")
 #define PAT1 ISO8601_PAT REGEX_STR(" ") PAT0
 #define PAT2 ABSOLUTE_DATE_AND_TIME_PAT REGEX_STR(" ") PAT0
 #define PAT3 ABSOLUTE_TIME_PAT REGEX_STR(" ") PAT0
 #define PAT4 RELATIVE_TIME_PAT REGEX_STR(" ") PAT0
-#define PAT5 REGEX_STR("\\[0\\?x\\?[0-9A-F]+]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* : Message [0-9]\\{1,2\\}")
-#define PAT6 REGEX_STR("\\[0\\?x\\?[0-9A-F]+]\\ (DEBUG|INFO |WARN |ERROR|FATAL) .*patternlayouttest.cpp\\([0-9]\\{1,4\\}\\): Message [0-9]\\{1,3\\}")
-#define PAT11a REGEX_STR("^(DEBUG|INFO |WARN |ERROR|FATAL) \\[0\\?x\\?[0-9A-F]+]\\ log4j.PatternLayoutTest: Message [0-9]\\{1,2\\}")
-#define PAT11b REGEX_STR("^(DEBUG|INFO |WARN |ERROR|FATAL) \\[0\\?x\\?[0-9A-F]+]\\ root: Message [0-9]\\{1,2\\}")
-#define PAT12 REGEX_STR("^\\[0\\?x\\?[0-9A-F]+]\\ (DEBUG|INFO |WARN |ERROR|FATAL) ")\
+#define PAT5 REGEX_STR("\\[[0-9A-FXx]*]\\ (DEBUG|INFO|WARN|ERROR|FATAL) .* : Message [0-9]\\{1,2\\}")
+#define PAT6 REGEX_STR("\\[[0-9A-FXx]*]\\ (DEBUG|INFO |WARN |ERROR|FATAL) .*patternlayouttest.cpp\\([0-9]\\{1,4\\}\\): Message [0-9]\\{1,3\\}")
+#define PAT11a REGEX_STR("^(DEBUG|INFO |WARN |ERROR|FATAL) \\[[0-9A-FXx]*]\\ log4j.PatternLayoutTest: Message [0-9]\\{1,2\\}")
+#define PAT11b REGEX_STR("^(DEBUG|INFO |WARN |ERROR|FATAL) \\[[0-9A-FXx]*]\\ root: Message [0-9]\\{1,2\\}")
+#define PAT12 REGEX_STR("^\\[[0-9A-FXx]*]\\ (DEBUG|INFO |WARN |ERROR|FATAL) ")\
     REGEX_STR(".*patternlayouttest.cpp([0-9]\\{1,4\\}): ")\
     REGEX_STR("Message [0-9]\\{1,2\\}")
 #define PAT_MDC_1 REGEX_STR("")
@@ -285,7 +285,7 @@
                 filter1 << PAT4;
                 //
                 //   combo of relative time and thread identifier
-                //     
+                //     (the \\\\1 preserve a leading space)
                 Filter filter2(".*]", "[main]");
 
                 std::vector<Filter *> filters;

Modified: logging/log4cxx/trunk/src/test/cpp/util/threadfilter.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/util/threadfilter.cpp?rev=615082&r1=615081&r2=615082&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/util/threadfilter.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/util/threadfilter.cpp Thu Jan 24 15:47:19 2008
@@ -20,4 +20,4 @@
 using namespace log4cxx;
 using namespace log4cxx::helpers;
 
-ThreadFilter::ThreadFilter() : Filter("\\[0\\?x\\?[0-9A-Fa-f]\\+]", "\\[main]") {}
+ThreadFilter::ThreadFilter() : Filter("\\[[0-9A-Fa-fXx]*]", "\\[main]") {}

Modified: logging/log4cxx/trunk/src/test/cpp/util/xmlthreadfilter.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/util/xmlthreadfilter.cpp?rev=615082&r1=615081&r2=615082&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/util/xmlthreadfilter.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/util/xmlthreadfilter.cpp Thu Jan 24 15:47:19 2008
@@ -21,5 +21,5 @@
 using namespace log4cxx::helpers;
 
 XMLThreadFilter::XMLThreadFilter()
-     : Filter("thread=\\\"0\\?x\\?[0-9A-Fa-f]\\+", "thread=\\\"main") {
+     : Filter("thread=\\\"[0-9A-Fa-fXx]*", "thread=\\\"main") {
 }