This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch test_robustly
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit 3ad6c5ea8024685625a8c8b1bdda7ccd88faea72
Author: Stephen Webb <[email protected]>
AuthorDate: Mon Jul 20 16:20:41 2026 +1000

    Prevent supurious 2GB test failure
---
 src/test/cpp/patternlayouttest.cpp | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/test/cpp/patternlayouttest.cpp 
b/src/test/cpp/patternlayouttest.cpp
index e505709e..cb651e8a 100644
--- a/src/test/cpp/patternlayouttest.cpp
+++ b/src/test/cpp/patternlayouttest.cpp
@@ -35,7 +35,7 @@
 #include <log4cxx/helpers/transcoder.h>
 #include <log4cxx/helpers/pool.h>
 #include <apr_strings.h>
-#include <log4cxx/helpers/pool.h>
+#include <log4cxx/helpers/loglog.h>
 #include "testchar.h"
 #include "logunit.h"
 #include <log4cxx/spi/loggerrepository.h>
@@ -106,7 +106,16 @@ public:
 
        void test2GbMessageFormatting()
        {
-               LogString msg(size_t(INT_MAX) + 1000, 'E');
+               LogString msg;
+               try
+               {
+                       msg.append(size_t(INT_MAX) + 1000, 'E');
+               }
+               catch (const std::exception& ex)
+               {
+                       LOGLOG_DEBUG(logger, ex.what() << " - skipping 2Gb 
message formatting test");
+                       return;
+               }
                msg[msg.length() - 1] = 'X';
                LogString output1;
                PatternLayout l1{ LOG4CXX_STR("%-5p %c{2} - %.30m") };

Reply via email to