Skip to content

Commit 33f3505

Browse files
committed
Merge pull request #1749 from zanzaben/fix1649_EVS_Reset_Filters_Func_Test
Fix #1649, Add Functional Test for EVS Reset Filters API.
2 parents f8ceda1 + 3f2ee86 commit 33f3505

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

modules/cfe_testcase/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ add_cfe_app(cfe_testcase
1313
src/es_misc_test.c
1414
src/es_mempool_test.c
1515
src/es_resource_id_test.c
16+
src/evs_filters_test.c
1617
src/evs_send_test.c
1718
src/fs_header_test.c
1819
src/fs_util_test.c

modules/cfe_testcase/src/cfe_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ void CFE_TestMain(void)
6161
ESMiscTestSetup();
6262
ESResourceIDTestSetup();
6363
ESTaskTestSetup();
64+
EVSFiltersTestSetup();
6465
EVSSendTestSetup();
6566
FSHeaderTestSetup();
6667
FSUtilTestSetup();

modules/cfe_testcase/src/cfe_test.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ void ESMemPoolTestSetup(void);
100100
void ESMiscTestSetup(void);
101101
void ESResourceIDTestSetup(void);
102102
void ESTaskTestSetup(void);
103+
void EVSFiltersTestSetup(void);
103104
void EVSSendTestSetup(void);
104105
void FSHeaderTestSetup(void);
105106
void FSUtilTestSetup(void);
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*************************************************************************
2+
**
3+
** GSC-18128-1, "Core Flight Executive Version 6.7"
4+
**
5+
** Copyright (c) 2006-2019 United States Government as represented by
6+
** the Administrator of the National Aeronautics and Space Administration.
7+
** All Rights Reserved.
8+
**
9+
** Licensed under the Apache License, Version 2.0 (the "License");
10+
** you may not use this file except in compliance with the License.
11+
** You may obtain a copy of the License at
12+
**
13+
** http://www.apache.org/licenses/LICENSE-2.0
14+
**
15+
** Unless required by applicable law or agreed to in writing, software
16+
** distributed under the License is distributed on an "AS IS" BASIS,
17+
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
** See the License for the specific language governing permissions and
19+
** limitations under the License.
20+
**
21+
** File: evs_filters_test.c
22+
**
23+
** Purpose:
24+
** Functional test of basic EVS Reset Filters APIs
25+
**
26+
** Demonstration of how to register and use the UT assert functions.
27+
**
28+
*************************************************************************/
29+
30+
/*
31+
* Includes
32+
*/
33+
34+
#include "cfe_test.h"
35+
36+
void TestResetFilters(void)
37+
{
38+
UtPrintf("Testing: CFE_EVS_ResetFilter, CFE_EVS_ResetAllFilters");
39+
40+
/* Test logic below depends on the test case registering an EID of 1 and not registering 0, and the resets in theory
41+
* could impact test behavior/management related to events. Although the expectation is either all or none of an EID
42+
* would be filtered (no use case for a "counting" filter within the test app) so for normal use this is no impact.
43+
*/
44+
45+
UtAssert_INT32_EQ(CFE_EVS_ResetFilter(1), CFE_SUCCESS);
46+
UtAssert_INT32_EQ(CFE_EVS_ResetAllFilters(), CFE_SUCCESS);
47+
48+
UtAssert_INT32_EQ(CFE_EVS_ResetFilter(0), CFE_EVS_EVT_NOT_REGISTERED);
49+
}
50+
51+
void EVSFiltersTestSetup(void)
52+
{
53+
UtTest_Add(TestResetFilters, NULL, NULL, "Test Reset Filters");
54+
}

0 commit comments

Comments
 (0)