1 // SPDX-License-Identifier: BSD-3-Clause 2 /* 3 * Copyright (c) 2020-2021, Arm Limited. All rights reserved. 4 */ 5 6 #include <assert.h> 7 #include <CppUTest/TestHarness.h> 8 #include <CppUTestExt/MockSupport.h> 9 #include "mock_assert.h" 10 TEST_GROUP(mock_assert)11TEST_GROUP(mock_assert) 12 { 13 TEST_TEARDOWN() 14 { 15 mock().checkExpectations(); 16 mock().clear(); 17 } 18 }; 19 TEST(mock_assert,assert)20TEST(mock_assert, assert) 21 { 22 assert_environment_t assert_env; 23 24 if (SETUP_ASSERT_ENVIRONMENT(assert_env)) { 25 assert(false); 26 FAIL("Assert jump not happened"); // Should not be called 27 } 28 } 29