|
| 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