-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #285, Refactor OSAL to avoid inclusion of C files
Use separate source files and CMake-based source selection to configure OSAL features, rather than using the C preprocessor. This commit covers the OSAL coverage test. This had been using inclusion of a C file to allow access to static functions/variables. This updates all UT code to correspond with the FSW code changes. All "static" helper functions become non-static so unit test can invoke directly. Prototype is in a private header, so the functions are still not exposed in the API.
- Loading branch information
Showing
223 changed files
with
6,525 additions
and
4,711 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/unit-test-coverage/portable/adaptors/inc/ut-adaptor-portable-posix-files.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020, United States government as represented by the | ||
* administrator of the National Aeronautics Space Administration. | ||
* All rights reserved. This software was created at NASA Goddard | ||
* Space Flight Center pursuant to government contracts. | ||
* | ||
* This is governed by the NASA Open Source Agreement and may be used, | ||
* distributed and modified only according to the terms of that agreement. | ||
* | ||
*/ | ||
|
||
|
||
/** | ||
* \file ut-adaptor-portable-posix-files.h | ||
* \ingroup adaptors | ||
* \author joseph.p.hickey@nasa.gov | ||
* | ||
*/ | ||
|
||
#ifndef INCLUDE_UT_ADAPTOR_PORTABLE_POSIX_FILES_H_ | ||
#define INCLUDE_UT_ADAPTOR_PORTABLE_POSIX_FILES_H_ | ||
|
||
#include <common_types.h> | ||
|
||
unsigned int UT_PortablePosixFileTest_GetSelfEUID(void); | ||
unsigned int UT_PortablePosixFileTest_GetSelfEGID(void); | ||
|
||
#endif /* INCLUDE_UT_ADAPTOR_PORTABLE_POSIX_FILES_H_ */ | ||
|
52 changes: 52 additions & 0 deletions
52
src/unit-test-coverage/portable/adaptors/inc/ut-adaptor-portable-posix-io.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020, United States government as represented by the | ||
* administrator of the National Aeronautics Space Administration. | ||
* All rights reserved. This software was created at NASA Goddard | ||
* Space Flight Center pursuant to government contracts. | ||
* | ||
* This is governed by the NASA Open Source Agreement and may be used, | ||
* distributed and modified only according to the terms of that agreement. | ||
* | ||
*/ | ||
|
||
|
||
/** | ||
* \file ut-adaptor-portable-posix-io.h | ||
* \ingroup adaptors | ||
* \author joseph.p.hickey@nasa.gov | ||
* | ||
*/ | ||
|
||
#ifndef INCLUDE_UT_ADAPTOR_PORTABLE_POSIX_IO_H_ | ||
#define INCLUDE_UT_ADAPTOR_PORTABLE_POSIX_IO_H_ | ||
|
||
|
||
|
||
/** | ||
* \file ut-osfileapi.h | ||
* \ingroup adaptors | ||
* \author joseph.p.hickey@nasa.gov | ||
* | ||
*/ | ||
|
||
#ifndef _UT_PPOSFILEAPI_H_ | ||
#define _UT_PPOSFILEAPI_H_ | ||
|
||
#include <common_types.h> | ||
|
||
/***************************************************** | ||
* | ||
* UT FUNCTION PROTOTYPES | ||
* | ||
* These are functions that need to be invoked by UT | ||
* but are not exposed directly through the implementation API. | ||
* | ||
*****************************************************/ | ||
void UT_PortablePosixIOTest_Set_Selectable(uint32 local_id, bool is_selectable); | ||
|
||
#endif /* _UT_OSFILEAPI_H_ */ | ||
|
||
|
||
#endif /* INCLUDE_UT_ADAPTOR_PORTABLE_POSIX_IO_H_ */ | ||
|
37 changes: 37 additions & 0 deletions
37
src/unit-test-coverage/portable/adaptors/src/ut-adaptor-portable-posix-files.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020, United States government as represented by the | ||
* administrator of the National Aeronautics Space Administration. | ||
* All rights reserved. This software was created at NASA Goddard | ||
* Space Flight Center pursuant to government contracts. | ||
* | ||
* This is governed by the NASA Open Source Agreement and may be used, | ||
* distributed and modified only according to the terms of that agreement. | ||
* | ||
*/ | ||
|
||
|
||
/** | ||
* \file ut-adaptor-portable-posix-files.c | ||
* \ingroup adaptors | ||
* \author joseph.p.hickey@nasa.gov | ||
* | ||
*/ | ||
|
||
|
||
/* pull in the OSAL configuration */ | ||
#include "osconfig.h" | ||
#include "ut-adaptor-portable-posix-files.h" | ||
|
||
#include <os-impl-files.h> | ||
|
||
unsigned int UT_PortablePosixFileTest_GetSelfEUID(void) | ||
{ | ||
return OS_IMPL_SELF_EUID; | ||
} | ||
|
||
unsigned int UT_PortablePosixFileTest_GetSelfEGID(void) | ||
{ | ||
return OS_IMPL_SELF_EGID; | ||
} | ||
|
31 changes: 31 additions & 0 deletions
31
src/unit-test-coverage/portable/adaptors/src/ut-adaptor-portable-posix-io.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* | ||
* Copyright (c) 2020, United States government as represented by the | ||
* administrator of the National Aeronautics Space Administration. | ||
* All rights reserved. This software was created at NASA Goddard | ||
* Space Flight Center pursuant to government contracts. | ||
* | ||
* This is governed by the NASA Open Source Agreement and may be used, | ||
* distributed and modified only according to the terms of that agreement. | ||
* | ||
*/ | ||
|
||
|
||
/** | ||
* \file ut-adaptor-portable-posix-io.c | ||
* \ingroup adaptors | ||
* \author joseph.p.hickey@nasa.gov | ||
* | ||
*/ | ||
|
||
/* pull in the OSAL configuration */ | ||
#include "osconfig.h" | ||
#include "ut-adaptor-portable-posix-io.h" | ||
|
||
#include <os-impl-io.h> | ||
|
||
|
||
void UT_PortablePosixIOTest_Set_Selectable(uint32 local_id, bool is_selectable) | ||
{ | ||
OS_impl_filehandle_table[local_id].selectable = is_selectable; | ||
} |
111 changes: 0 additions & 111 deletions
111
src/unit-test-coverage/portable/coveragetest-posixgettime.c
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.