diff options
author | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2008-04-15 23:09:30 +0000 |
---|---|---|
committer | nealsid <nealsid@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2008-04-15 23:09:30 +0000 |
commit | 5da03791a71a6c5b3b1ef15ec8882bffa21ceb39 (patch) | |
tree | ffa72c195966ca02c48c9fd7d6857baac602531a /src/client/minidump_file_writer_unittest.cc | |
parent | Issue 254: The problem is that nlist() is compiled out of libc in (diff) | |
download | breakpad-5da03791a71a6c5b3b1ef15ec8882bffa21ceb39.tar.xz |
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
Diffstat (limited to 'src/client/minidump_file_writer_unittest.cc')
-rw-r--r-- | src/client/minidump_file_writer_unittest.cc | 12 |
1 files changed, 12 insertions, 0 deletions
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; } |