From bc3440e941edcba398d470bd674bedd9cc9f06b3 Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Fri, 6 Dec 2013 16:44:22 -0500 Subject: [PATCH] Bug 904227 - Print ? if we don't have a test object. r=bjacob --HG-- extra : rebase_source : cc1571123f7414f7a64a620aeebd1ce4b5002a9e --- testing/gtest/mozilla/GTestRunner.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testing/gtest/mozilla/GTestRunner.cpp b/testing/gtest/mozilla/GTestRunner.cpp index 0ddfceabda1..540923dea83 100644 --- a/testing/gtest/mozilla/GTestRunner.cpp +++ b/testing/gtest/mozilla/GTestRunner.cpp @@ -44,15 +44,16 @@ public: virtual void OnTestPartResult(const TestPartResult& aTestPartResult) MOZ_OVERRIDE { printf("TEST-%s | %s.%s | %s @ %s:%i\n", !aTestPartResult.failed() ? "PASS" : "UNEXPECTED-FAIL", - mTestInfo->test_case_name(), mTestInfo->name(), + mTestInfo ? mTestInfo->test_case_name() : "?", mTestInfo ? mTestInfo->name() : "?", aTestPartResult.summary(), aTestPartResult.file_name(), aTestPartResult.line_number()); } virtual void OnTestEnd(const TestInfo& aTestInfo) MOZ_OVERRIDE { printf("TEST-%s | %s.%s | test completed (time: %llims)\n", - mTestInfo->result()->Passed() ? "PASS": "UNEXPECTED-FAIL", - mTestInfo->test_case_name(), mTestInfo->name(), - mTestInfo->result()->elapsed_time()); + aTestInfo.result()->Passed() ? "PASS": "UNEXPECTED-FAIL", + aTestInfo.test_case_name(), aTestInfo.name(), + aTestInfo.result()->elapsed_time()); + MOZ_ASSERT(&aTestInfo == mTestInfo); mTestInfo = nullptr; }