Skip to content

Commit 17df51a

Browse files
committed
tests/propertyconfig_test/main.cxx: Use LOG4CPLUS_ASSERT, reformat a bit.
1 parent 24e0d13 commit 17df51a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/propertyconfig_test/main.cxx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@ main()
1919
LogLog::getLogLog()->setInternalDebugging(true);
2020
Logger root = Logger::getRoot();
2121
try {
22-
PropertyConfigurator::doConfigure(LOG4CPLUS_TEXT("log4cplus.properties"));
22+
PropertyConfigurator::doConfigure(
23+
LOG4CPLUS_TEXT("log4cplus.properties"));
2324
Logger fileCat = Logger::getInstance(LOG4CPLUS_TEXT("filelogger"));
2425

2526
LOG4CPLUS_WARN(root, LOG4CPLUS_TEXT("Testing...."));
26-
2727
LOG4CPLUS_WARN(root, LOG4CPLUS_TEXT("Writing messages to log...."));
28-
for(int i=0; i<10000; ++i) {
29-
LOG4CPLUS_WARN(fileCat, LOG4CPLUS_TEXT("This is a WARNING...") << i);
30-
}
28+
for (int i=0; i<10000; ++i)
29+
LOG4CPLUS_WARN(fileCat, LOG4CPLUS_TEXT("This is a WARNING...")
30+
<< i);
3131

3232
// Test that DOS EOLs in property files get removed.
33-
3433
#define TEST_TEXT LOG4CPLUS_TEXT ("this is a test with DOS EOL-->")
35-
tistringstream propsStream (
36-
"text=" TEST_TEXT "\r\n");
34+
tistringstream propsStream ("text=" TEST_TEXT "\r\n");
3735
Properties props (propsStream);
38-
if (props.getProperty (LOG4CPLUS_TEXT ("text")) != TEST_TEXT)
39-
LOG4CPLUS_ERROR (root, LOG4CPLUS_TEXT ("DOS EOLs test has failed"));
36+
LOG4CPLUS_ASSERT (root,
37+
props.getProperty (LOG4CPLUS_TEXT ("text")) == TEST_TEXT);
4038
}
4139
catch(...) {
4240
tcout << LOG4CPLUS_TEXT("Exception...") << endl;

0 commit comments

Comments
 (0)