aboutsummaryrefslogtreecommitdiff
path: root/components/messaging/ffa/libsp/test/test_mock_assert.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'components/messaging/ffa/libsp/test/test_mock_assert.cpp')
-rw-r--r--components/messaging/ffa/libsp/test/test_mock_assert.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/components/messaging/ffa/libsp/test/test_mock_assert.cpp b/components/messaging/ffa/libsp/test/test_mock_assert.cpp
new file mode 100644
index 0000000..39004d6
--- /dev/null
+++ b/components/messaging/ffa/libsp/test/test_mock_assert.cpp
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2020-2021, Arm Limited. All rights reserved.
+ */
+
+#include <assert.h>
+#include <CppUTest/TestHarness.h>
+#include <CppUTestExt/MockSupport.h>
+#include "mock_assert.h"
+
+TEST_GROUP(mock_assert)
+{
+ TEST_TEARDOWN()
+ {
+ mock().checkExpectations();
+ mock().clear();
+ }
+};
+
+TEST(mock_assert, assert)
+{
+ assert_environment_t assert_env;
+
+ if (SETUP_ASSERT_ENVIRONMENT(assert_env)) {
+ assert(false);
+ FAIL("Assert jump not happened"); // Should not be called
+ }
+}