当前位置: 首页>>代码示例>>C++>>正文


C++ CHECK_EXPECTED_MOCK_FAILURE函数代码示例

本文整理汇总了C++中CHECK_EXPECTED_MOCK_FAILURE函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_EXPECTED_MOCK_FAILURE函数的具体用法?C++ CHECK_EXPECTED_MOCK_FAILURE怎么用?C++ CHECK_EXPECTED_MOCK_FAILURE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CHECK_EXPECTED_MOCK_FAILURE函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TEST

TEST(MockStrictOrderTest, orderViolatedWorksWithExtraUnexpectedCall)
{
    MockFailureReporterInstaller failureReporterInstaller;
    mock().strictOrder();
    mock("bla").strictOrder();
	mock().ignoreOtherCalls();

    MockExpectedCallsListForTest expectations;
    expectations.addFunction("foo::foo1", 1)->callWasMade(2);
    expectations.addFunction("foo::foo2", 2)->callWasMade(1);
    MockCallOrderFailure expectedFailure(mockFailureTest(), expectations);

    mock("bla").expectOneCall("foo1");
    mock("foo").expectOneCall("foo1");
    mock("foo").expectOneCall("foo2");

    mock("bla").actualCall("foo1");
    mock("foo").actualCall("foo2");
	mock("foo").actualCall("unexpected1");
    mock("foo").actualCall("foo1");
	mock("foo").actualCall("unexpected2");

    mock().checkExpectations();
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:13coders,项目名称:cookiecutter-kata-cpputest,代码行数:25,代码来源:MockStrictOrderTest.cpp

示例2: TEST

TEST(MockHierarchyTest, reporterIsInheritedInHierarchicalMocks)
{
    MockFailureReporterInstaller failureReporterInstaller;
    MockExpectedCallsListForTest expectations;

    mock("differentScope").actualCall("foobar");

    MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "foobar", expectations);
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:FelixAdrianL,项目名称:cpputest,代码行数:10,代码来源:MockHierarchyTest.cpp

示例3: TEST

TEST(MockCallTest, OnObjectExpectedButNotCalled)
{
    MockFailureReporterInstaller failureReporterInstaller;

    void* objectPtr = (void*) 0x001;
    MockExpectedCallsListForTest expectations;
    expectations.addFunction("boo")->onObject(objectPtr);
    expectations.addFunction("boo")->onObject(objectPtr);

    mock().expectOneCall("boo").onObject(objectPtr);
    mock().expectOneCall("boo").onObject(objectPtr);
    mock().actualCall("boo");
    mock().actualCall("boo");

    MockExpectedObjectDidntHappenFailure expectedFailure(mockFailureTest(), "boo", expectations);
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
    mock().checkExpectations();
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:DynonAvionics,项目名称:cpputest,代码行数:19,代码来源:MockCallTest.cpp

示例4: TEST

TEST(MockComparatorCopierTest, customObjectParameterFailsWhenNotHavingACopierRepository)
{
    MockFailureReporterInstaller failureReporterInstaller;

    MyTypeForTesting object(1);
    mock().expectOneCall("function").withOutputParameterOfTypeReturning("MyTypeForTesting", "parameterName", &object);
    mock().actualCall("function").withOutputParameterOfType("MyTypeForTesting", "parameterName", &object);

    MockNoWayToCopyCustomTypeFailure expectedFailure(mockFailureTest(), "MyTypeForTesting");
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:KisImre,项目名称:cpputest,代码行数:11,代码来源:MockComparatorCopierTest.cpp

示例5: TEST

TEST(MockCallTest, expectNoCallInScopeButActualCallInGlobal)
{
    MockFailureReporterInstaller failureReporterInstaller;

    MockExpectedCallsListForTest expectations;
    MockUnexpectedCallHappenedFailure expectedFailure(mockFailureTest(), "lazy", expectations);

    mock("scope1").expectNoCall("lazy");
    mock().actualCall("lazy");

    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:13coders,项目名称:cookiecutter-kata-cpputest,代码行数:12,代码来源:MockCallTest.cpp

示例6: TEST

TEST(MockParameterTest, noActualCallForOutputParameter)
{
    MockFailureReporterInstaller failureReporterInstaller;

    int output;
    MockExpectedCallsListForTest expectations;
    mock().expectOneCall("foo").withOutputParameterReturning("output", &output, sizeof(output));

    expectations.addFunction("foo")->withOutputParameterReturning("output", &output, sizeof(output));
    MockExpectedCallsDidntHappenFailure expectedFailure(mockFailureTest(), expectations);

    mock().checkExpectations();
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:FelixAdrianL,项目名称:cpputest,代码行数:14,代码来源:MockParameterTest.cpp

示例7: TEST

TEST(MockStrictOrderTest, orderViolatedWithinAScope)
{
    MockFailureReporterInstaller failureReporterInstaller;
    mock().strictOrder();

    MockExpectedCallsListForTest expectations;
    expectations.addFunction("foo1", 1)->callWasMade(2);
    expectations.addFunction("foo2", 2)->callWasMade(1);
    MockCallOrderFailure expectedFailure(mockFailureTest(), expectations);

    mock("scope").expectOneCall("foo1");
    mock("scope").expectOneCall("foo2");
    mock("scope").actualCall("foo2");
    mock("scope").actualCall("foo1");

    mock("scope").checkExpectations();
    CHECK_EXPECTED_MOCK_FAILURE(expectedFailure);
}
开发者ID:adustm,项目名称:cpputest,代码行数:18,代码来源:MockStrictOrderTest.cpp


注:本文中的CHECK_EXPECTED_MOCK_FAILURE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。