Skip to content

Commit 5a7457a

Browse files
committed
Merge pull request cpputest#816 from basvodde/master
Fixed a failed test on clang++3.7.
2 parents 52f47d1 + 4edaa1b commit 5a7457a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

include/CppUTest/TestTestingFixture.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,19 @@ class TestTestingFixture
100100
return genTest_->hasFailed();
101101
}
102102

103-
104103
void assertPrintContains(const SimpleString& contains)
105104
{
106-
assertPrintContains(output_, contains);
105+
assertPrintContains(getOutput(), contains);
106+
}
107+
108+
const SimpleString& getOutput()
109+
{
110+
return output_->getOutput();
107111
}
108112

109-
static void assertPrintContains(StringBufferTestOutput* output,
110-
const SimpleString& contains)
113+
static void assertPrintContains(const SimpleString& output, const SimpleString& contains)
111114
{
112-
STRCMP_CONTAINS(contains.asCharString(), output->getOutput().asCharString());
115+
STRCMP_CONTAINS(contains.asCharString(), output.asCharString());
113116

114117
}
115118

tests/UtestTest.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,10 @@ TEST(UtestShell, TestDefaultCrashMethodInSeparateProcessTest)
189189
fixture.setTestFunction(UtestShell::crash);
190190
fixture.registry_->setRunTestsInSeperateProcess();
191191
fixture.runAllTests();
192-
fixture.assertPrintContains("Failed in separate process - killed by signal 11");
192+
fixture.assertPrintContains("Failed in separate process - killed by signal");
193+
194+
/* Signal 11 usually happens, but with clang3.7 on Linux, it produced signal 4 */
195+
CHECK(fixture.getOutput().contains("signal 11") || fixture.getOutput().contains("signal 4"));
193196
}
194197

195198
#endif

0 commit comments

Comments
 (0)