Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(291)

Issue 25004: Linux dumper: Add unit tests for google_breakpad::StabsReader. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 7 months ago by jimb
Modified:
14 years, 4 months ago
Reviewers:
mochalatte
CC:
google-breakpad-dev_googlegroups.com
Visibility:
Public.

Description

Linux dumper: Add unit tests for google_breakpad::StabsReader.

The test system is based on Google C++ Testing Framework and the
Google C++ Mocking Framework.

This includes a parser that turns human-readable input files ("mock
stabs") into .stab and .stabstr section contents, which we can then
pass to a StabsReader instance, using a handler object written with
GoogleMock. The 'make check' target in src/tools/linux/dump_syms runs
this.

The supplied input file is pretty small, but I've done coverage
testing, and it does cover the parser.

I thought the mock stabs parser would be less elaborate than it turned
out to be. Lesson learned.

Committed, r444.

Patch Set 1 #

Patch Set 2 : Linux dumper: Add unit tests for google_breakpad::StabsReader. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
A src/common/linux/stabs_reader_unittest.cc View 1 1 chunk +462 lines, -0 lines 6 comments Download
A src/common/linux/stabs_reader_unittest.input View 1 chunk +17 lines, -0 lines 0 comments Download
M src/tools/linux/dump_syms/Makefile View 1 2 chunks +32 lines, -2 lines 0 comments Download

Messages

Total messages: 2
mochalatte
very nicely done LGTM with some nits http://breakpad.appspot.com/25004/diff/1001/2001 File src/common/linux/stabs_reader_unittest.cc (right): http://breakpad.appspot.com/25004/diff/1001/2001#newcode380 Line 380: MOCK_METHOD3(StartCompilationUnit, ...
14 years, 4 months ago #1
jimb
14 years, 4 months ago #2
Thanks for the review!

http://breakpad.appspot.com/25004/diff/1001/2001
File src/common/linux/stabs_reader_unittest.cc (right):

http://breakpad.appspot.com/25004/diff/1001/2001#newcode380
Line 380: MOCK_METHOD3(StartCompilationUnit, bool(const char *, uint64_t, const
char *));
On 2009/12/14 19:24:02, mochalatte wrote:
> 80 char line

D'oh.

http://breakpad.appspot.com/25004/diff/1001/2001#newcode393
Line 393: 
On 2009/12/14 19:24:02, mochalatte wrote:
> can we move the test data into it's own directory(e.g. testdata)?

Sure.  I changed the calls to ApplyHandlerToMockStabsData to use ASSERT_TRUE, as
well, to avoid pointless failure cascades.

http://breakpad.appspot.com/25004/diff/1001/2001#newcode462
Line 462: }
On 2009/12/14 19:24:02, mochalatte wrote:
> if you don't need anything special here, consider using the main() provided by
> google test and linking in gtest_main.cc to the test target

I don't need anything special here; I'll do that.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted