unittests: Convert ExpectCommand function to a macro.
When ExpectCommand() fails, the log message lists the line where
the gtest expectation was set by this function, this is, in the
ExpectCommand() implementation, and not the caller. This patch
moves ExpectCommand() to a macro EXPECT_COMMAND() making it show
the line number of the macro invocation instead of the
ExpectCommand() implementation.
BUG=chromium:289444
TEST=unittests passes. Also, introduce a failure and check the log message line numbers.
Change-Id: I3ed162d7cf137d0ce8495a7836be399540ac8db3
Reviewed-on: https://chromium-review.googlesource.com/168976
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
6 files changed