Author: carnold
Date: Sun Feb 3 14:54:57 2008
New Revision: 618116
URL: http://svn.apache.org/viewvc?rev=618116&view=rev
Log:
LOGCXX-225: Add assertEquals(const char*), add missing const
Modified:
logging/log4cxx/trunk/src/test/cpp/abts.cpp
logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp
logging/log4cxx/trunk/src/test/cpp/logunit.cpp
logging/log4cxx/trunk/src/test/cpp/logunit.h
Modified: logging/log4cxx/trunk/src/test/cpp/abts.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/abts.cpp?rev=618116&r1=618115&r2=618116&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/abts.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/abts.cpp Sun Feb 3 14:54:57 2008
@@ -96,7 +96,7 @@
abts_suite *abts_add_suite(abts_suite *suite, const char *suite_name_full)
{
sub_suite *subsuite;
- char *p;
+ const char *p;
const char *suite_name;
curr_char = 0;
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp?rev=618116&r1=618115&r2=618116&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp
(original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/optionconvertertestcase.cpp Sun
Feb 3 14:54:57 2008
@@ -74,17 +74,17 @@
apr_status_t stat = apr_env_get(&toto, "TOTO",
(apr_pool_t*) p.getAPRPool());
LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
- LOGUNIT_ASSERT_EQUAL(std::string("wonderful"), (std::string) toto);
+ LOGUNIT_ASSERT_EQUAL("wonderful", toto);
char* key1;
stat = apr_env_get(&key1, "key1",
(apr_pool_t*) p.getAPRPool());
LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
- LOGUNIT_ASSERT_EQUAL(std::string("value1"), (std::string) key1);
+ LOGUNIT_ASSERT_EQUAL("value1", key1);
char* key2;
stat = apr_env_get(&key2, "key2",
(apr_pool_t*) p.getAPRPool());
LOGUNIT_ASSERT_EQUAL(APR_SUCCESS, stat);
- LOGUNIT_ASSERT_EQUAL(std::string("value2"), (std::string) key2);
+ LOGUNIT_ASSERT_EQUAL("value2", key2);
}
void varSubstTest1()
Modified: logging/log4cxx/trunk/src/test/cpp/logunit.cpp
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.cpp?rev=618116&r1=618115&r2=618116&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.cpp Sun Feb 3 14:54:57 2008
@@ -111,6 +111,19 @@
void TestFixture::setUp() {}
void TestFixture::tearDown() {}
+void TestFixture::assertEquals(const char* expected,
+ const char* actual,
+ const char* expectedExpr,
+ const char* actualExpr,
+ int lineno) {
+ abts_str_equal(tc, expected, actual, lineno);
+ if ((expected == 0 || actual != 0) ||
+ (expected != 0 || actual == 0) ||
+ (expected != 0 && strcmp(expected, actual) != 0)) {
+ throw TestException();
+ }
+}
+
void TestFixture::assertEquals(const std::string expected,
const std::string actual,
const char* expectedExpr,
Modified: logging/log4cxx/trunk/src/test/cpp/logunit.h
URL:
http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/logunit.h?rev=618116&r1=618115&r2=618116&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/logunit.h (original)
+++ logging/log4cxx/trunk/src/test/cpp/logunit.h Sun Feb 3 14:54:57 2008
@@ -65,6 +65,11 @@
const char* expectedExpr,
const char* actualExpr,
int lineno);
+ void assertEquals(const char* expected,
+ const char* actual,
+ const char* expectedExpr,
+ const char* actualExpr,
+ int lineno);
#if LOG4CXX_LOGCHAR_IS_WCHAR || LOG4CXX_WCHAR_T_API
void assertEquals(const std::wstring expected,
const std::wstring actual,