From 78feda42f7dc5e25895fd50cab16d3260e8f7537 Mon Sep 17 00:00:00 2001 From: Sergey Gaychuk Date: Sat, 23 Oct 2010 14:19:48 +0300 Subject: [PATCH] xpunit: simulate error message in CompareWithFile --- xpunit/nsTestRunner.cpp | 2 +- xpunit/test/nsSelfTest.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xpunit/nsTestRunner.cpp b/xpunit/nsTestRunner.cpp index 458d902..d6c6e4c 100644 --- a/xpunit/nsTestRunner.cpp +++ b/xpunit/nsTestRunner.cpp @@ -357,7 +357,7 @@ nsTestRunner::CompareWithFile(nsIChannel *dataChannel, rv = reference->GetSpec(spec); NS_ENSURE_SUCCESS(rv, rv); - this->AddFailure(spec.get(), 2, ""); + this->AddFailure(spec.get(), 2, "\"3\""); return NS_OK; } diff --git a/xpunit/test/nsSelfTest.cpp b/xpunit/test/nsSelfTest.cpp index c3ec0ff..9b97138 100644 --- a/xpunit/test/nsSelfTest.cpp +++ b/xpunit/test/nsSelfTest.cpp @@ -123,6 +123,9 @@ nsSelfTest::testFileComp(nsITestRunner *aTestRunner) NS_TEST_ASSERT_MSG(failure->getLine() == 2, "compare test: line is not equal to 2"); + NS_TEST_ASSERT_MSG(nsDependentCString(failure->getText()) + .EqualsLiteral("\"3\""), failure->getText()); + delete failure; return NS_OK; } -- 2.11.4.GIT