From c07ad72f016930e2aba6471d0e2e9625b935bf9a Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 24 Jan 2019 17:52:53 +0100 Subject: Remove cframework files from master Change-Id: I02f17ede1cf97986a8b8852ed6d6a28fc016f590 Signed-off-by: Mauro Sardara --- longbow/src/examples/testLongBow.c | 152 ------------------------------------- 1 file changed, 152 deletions(-) delete mode 100755 longbow/src/examples/testLongBow.c (limited to 'longbow/src/examples/testLongBow.c') diff --git a/longbow/src/examples/testLongBow.c b/longbow/src/examples/testLongBow.c deleted file mode 100755 index 7c1fd949..00000000 --- a/longbow/src/examples/testLongBow.c +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2017 Cisco and/or its affiliates. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - * test_LongBow.c - * - */ - -#include -#include -#include -#include - -#include "../unit-test.h" - - -LONGBOW_TEST_RUNNER(LongBow) -{ - LONGBOW_RUN_TEST_FIXTURE(LongBowFixture); -} - -LONGBOW_TEST_RUNNER_SETUP(LongBow) -{ - return LONGBOW_STATUS_SUCCEEDED; -} - -LONGBOW_TEST_RUNNER_TEARDOWN(LongBow) -{ - return LONGBOW_STATUS_SUCCEEDED; -} - -LONGBOW_TEST_FIXTURE(LongBowFixture) -{ - LONGBOW_RUN_TEST_CASE(LongBowFixture, alwaysSucceed); - LONGBOW_RUN_TEST_CASE(LongBowFixture, alwaysUnimplemented); - LONGBOW_RUN_TEST_CASE(LongBowFixture, alwaysImpotent); -} - -LONGBOW_TEST_FIXTURE_SETUP(LongBowFixture) -{ - return LONGBOW_STATUS_SUCCEEDED; -} - -LONGBOW_TEST_FIXTURE_TEARDOWN(LongBowFixture) -{ - return LONGBOW_STATUS_SUCCEEDED; -} - -LONGBOW_TEST_CASE(LongBowFixture, testErrno) -{ - errno = ENOENT; - assertTrue(0, "Errno test"); -} - -LONGBOW_TEST_CASE(LongBowFixture, alwaysSucceed) -{ - assertTrue(1, "alwaysSucceed"); -} - -LONGBOW_TEST_CASE(LongBowFixture, alwaysImpotent) -{ -} - -LONGBOW_TEST_CASE_EXPECTS(LongBowFixture, testEvent, .event = &LongBowAssertEvent) -{ - assertTrue(0, "testEvent"); -} - -LONGBOW_TEST_CASE_EXPECTS(LongBowFixture, alwaysFail, .status = LONGBOW_STATUS_FAILED, .event = &LongBowAssertEvent) -{ - assertTrue(0, "alwaysFail"); -} - -LONGBOW_TEST_CASE_EXPECTS(LongBowFixture, alwaysSigTERM, .status = LONGBOW_STATUS_SIGNAL(SIGTERM)) -{ - kill(getpid(), SIGTERM); -} - -LONGBOW_TEST_CASE_EXPECTS(LongBowFixture, alwaysSEGV, .event = &LongBowEventSIGSEGV) -{ - int *p = 0; - int i = *p; - printf("not used %d\n", i); -} - -LONGBOW_TEST_CASE(LongBowFixture, alwaysUnimplemented) -{ - testUnimplemented("alwaysUnimplemented"); -} - -LONGBOW_TEST_CASE(LongBowFixture, alwaysWarn) -{ - testWarn("alwaysWarn"); -} - -LONGBOW_TEST_CASE_EXPECTS(LongBowFixture, alwaysSkip, .event = &LongBowTestSkippedEvent) -{ - testSkip("alwaysSkip"); -} - -LONGBOW_TEST_CASE_EXPECTS(LongBowFixture, alwaysTrap, .status = LONGBOW_STATUS_FAILED) -{ - trapNotImplemented("alwaysTrap"); -} - -LONGBOW_TEST_FIXTURE(TestTearDownWarning) -{ - LONGBOW_RUN_TEST_CASE(TestTearDownWarning, alwaysFail); - LONGBOW_RUN_TEST_CASE(TestTearDownWarning, alwaysSucceed); -} - -LONGBOW_TEST_FIXTURE_SETUP(TestTearDownWarning) -{ - return LONGBOW_STATUS_SUCCEEDED; -} - -LONGBOW_TEST_FIXTURE_TEARDOWN(TestTearDownWarning) -{ - return LONGBOW_STATUS_TEARDOWN_WARNED; -} - -LONGBOW_TEST_CASE(TestTearDownWarning, alwaysFail) -{ - assertTrue(0, "alwaysFail"); -} - -LONGBOW_TEST_CASE(TestTearDownWarning, alwaysSucceed) -{ - assertTrue(1, "alwaysSucceed"); -} - -int -main(int argc, char *argv[]) -{ - LongBowRunner *testRunner = LONGBOW_TEST_RUNNER_CREATE(LongBow); - int status = longBowMain(argc, argv, testRunner, NULL); - longBowTestRunner_Destroy(&testRunner); - - exit(status); -} -- cgit 1.2.3-korg