Beispiel #1
0
void UtestShell::assertFunctionPointersEqual(void (*expected)(), void (*actual)(), const char* text, const char* fileName, int lineNumber)
{
    getTestResult()->countCheck();
    if (expected != actual)
        failWith(EqualsFailure(this, fileName, lineNumber, StringFrom(expected), StringFrom(actual), text));
}
Beispiel #2
0
void UtestShell::assertPointersEqual(const void* expected, const void* actual, const char* text, const char* fileName, int lineNumber, const TestTerminator& testTerminator)
{
    getTestResult()->countCheck();
    if (expected != actual)
        failWith(EqualsFailure(this, fileName, lineNumber, StringFrom(expected), StringFrom(actual), text), testTerminator);
}
TEST(StringFrom_ForAVector, AnswersCommaSeparatedList) {
    std::vector<std::string> strings {"alpha", "beta", "gamma"};

    CHECK_EQUAL("alpha,beta,gamma", StringFrom(strings));
}
TEST(StringFrom_ForAVector, AnswersEmptyStringWhenVectorEmpty) {
    std::vector<std::string> strings {};

    CHECK_EQUAL("", StringFrom(strings));
}
Beispiel #5
0
SimpleString StringFromOrNull(const char * expected)
{
    return (expected) ? StringFrom(expected) : "(null)";
}