From 5da03791a71a6c5b3b1ef15ec8882bffa21ceb39 Mon Sep 17 00:00:00 2001 From: nealsid Date: Tue, 15 Apr 2008 23:09:30 +0000 Subject: As part of resolving issue 256 I'd like to check in some unit tests(ok, just one) for the private copy of nlist that I checked in last week, plus lay some of the ground work for collecting code coverage numbers. Both of these are accomplished by leveraging the built-in facilities of Xcode & Developer Tools(namely, CPlusTest and gcov integration; however, eventually I will also add a way to get lcov results from the gcov results). I also: - renamed breakpad_nlist_64.c to breakpad_nlist_64.cc to be more consistent(even though it's not C++ code it still only gets called by C++ code so I don't have to deal with extern "C" constructs). - I created a new target (minidump_tests) that has a "Coverage" configuration with the appropriate GCC flags turned on. It is only compiled in 64-bit configurations and has 10.5 as a minimum deployment target as well as uses the 10.5 SDK. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@260 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/client/minidump_file_writer_unittest.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/client/minidump_file_writer_unittest.cc') diff --git a/src/client/minidump_file_writer_unittest.cc b/src/client/minidump_file_writer_unittest.cc index 58750667..8eadff46 100644 --- a/src/client/minidump_file_writer_unittest.cc +++ b/src/client/minidump_file_writer_unittest.cc @@ -145,6 +145,18 @@ static bool CompareFile(const char *path) { ASSERT_NE(fd, -1); ASSERT_TRUE(buffer); ASSERT_EQ(read(fd, buffer, expected_byte_count), expected_byte_count); + + char *b1, *b2; + b1 = (char*)buffer; + b2 = (char*)expected; + while (*b1 == *b2) { + b1++; + b2++; + } + + printf("%d\n",b1 - (char*)buffer); + + ASSERT_EQ(memcmp(buffer, expected, expected_byte_count), 0); return true; } -- cgit v1.2.1