Skip to content

Commit

Permalink
Added support for pointers equal
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancalhoun committed Apr 11, 2016
1 parent 4e2cb82 commit ade3d06
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source 'https://rubygems.org'

gem 'emplace', '~>0.3.0'
gem 'rake'
gem 'test-unit'
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ 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
x64-mingw32

DEPENDENCIES
emplace (~> 0.3.0)
rake
test-unit

BUNDLED WITH
1.11.2
1 change: 1 addition & 0 deletions include/cppunit/TestAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions test/cppunit_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
4 changes: 3 additions & 1 deletion test/cppunit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ def testCppUnitByMethod
end

def configuration
ENV['CONFIGURAtION'] || 'Debug'
if RUBY_PLATFORM =~ /mswin|mingw/
ENV['CONFIGURAtION'] || 'Debug'
end
end
end

0 comments on commit ade3d06

Please sign in to comment.