diff --git a/Gemfile b/Gemfile index 5da7266..a458760 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source 'https://rubygems.org' gem 'emplace', '~>0.3.0' +gem 'rake' +gem 'test-unit' diff --git a/Gemfile.lock b/Gemfile.lock index 4eb92f5..0605a3a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,10 @@ GEM remote: https://rubygems.org/ specs: emplace (0.3.0) + power_assert (0.2.6) + rake (10.4.2) + test-unit (3.1.5) + power_assert PLATFORMS ruby @@ -9,6 +13,8 @@ PLATFORMS DEPENDENCIES emplace (~> 0.3.0) + rake + test-unit BUNDLED WITH 1.11.2 diff --git a/include/cppunit/TestAssert.h b/include/cppunit/TestAssert.h index b5e5253..a32fc72 100644 --- a/include/cppunit/TestAssert.h +++ b/include/cppunit/TestAssert.h @@ -152,6 +152,7 @@ void assertEquals(const T& expected, void assertEquals(const char* expected, const std::string& actual, SourceLine sourceLine, const std::string& message); void assertEquals(int expected, unsigned long long actual, SourceLine sourceLine, const std::string& message); +void assertEquals(const void* expected, const void* actual, SourceLine sourceLine, const std::string& message); /*! \brief (Implementation) Asserts that two double are equals given a tolerance. diff --git a/test/cppunit_test.cpp b/test/cppunit_test.cpp index 90d39d2..2ec4a74 100644 --- a/test/cppunit_test.cpp +++ b/test/cppunit_test.cpp @@ -52,6 +52,12 @@ class FooTest : public CppUnit::TestFixture assert_greater(4, 8u); assert_greater_equal(4u, 8); } + void testPointers() + { + void* p1 = NULL; + assert_equal(NULL, p1); + assert_equal(p1, NULL); + } void testDoubles() { diff --git a/test/cppunit_test.rb b/test/cppunit_test.rb index 5de5965..1a1ce3d 100644 --- a/test/cppunit_test.rb +++ b/test/cppunit_test.rb @@ -111,6 +111,8 @@ def testCppUnitByMethod end def configuration - ENV['CONFIGURAtION'] || 'Debug' + if RUBY_PLATFORM =~ /mswin|mingw/ + ENV['CONFIGURAtION'] || 'Debug' + end end end