diff --git a/testing/common/SystemControlReport.cpp b/testing/common/SystemControlReport.cpp index 9111259f..e01e4f9d 100644 --- a/testing/common/SystemControlReport.cpp +++ b/testing/common/SystemControlReport.cpp @@ -25,7 +25,9 @@ SystemControlReport::SystemControlReport(const void* data) { const ReportData& report_data = *static_cast(data); memcpy(&report_data_, &report_data, sizeof(report_data_)); - this->push_back(report_data_.key); + if (report_data_.key != 0) { + this->push_back(report_data_.key); + } } uint8_t SystemControlReport::Key() const { diff --git a/testing/common/matchers.h b/testing/common/matchers.h index f521bb35..0ce6ce73 100644 --- a/testing/common/matchers.h +++ b/testing/common/matchers.h @@ -31,27 +31,6 @@ MATCHER_P(Contains, key, negation ? "does not contain" : "contains") { return arg.Key() == key.getKeyCode(); } -class SystemControlReportIsNullMatcher - : public ::testing::MatcherInterface { - public: - bool MatchAndExplain(SystemControlReport report, - ::testing::MatchResultListener* /* ignored */) const override { - return report.Key() == 0; - } - - void DescribeTo(std::ostream* os) const override { - *os << "is empty"; - } - - void DescribeNegationTo(std::ostream* os) const override { - *os << "is not empty"; - } -}; - -::testing::Matcher IsNull() { - return ::testing::MakeMatcher(new SystemControlReportIsNullMatcher); -} - auto Contains(Key key) { return ::testing::Contains(key.getKeyCode()); } } // namespace testing diff --git a/testing/issue_840/test/simulator_test.cpp b/testing/issue_840/test/simulator_test.cpp index b479b5e3..9e06bbb4 100644 --- a/testing/issue_840/test/simulator_test.cpp +++ b/testing/issue_840/test/simulator_test.cpp @@ -59,7 +59,7 @@ TEST_F(Issue840, HasNotRegressed) { state = RunCycle(); ASSERT_EQ(state->SystemControlReports().size(), 1); - EXPECT_THAT(state->SystemControlReports(0), IsNull()); + EXPECT_THAT(state->SystemControlReports(0), IsEmpty()); state = RunCycle();