diff --git a/src/unit-test-coverage/portable/coveragetest-posixfile.c b/src/unit-test-coverage/portable/coveragetest-posixfile.c index 20e000d01..5de2a5017 100644 --- a/src/unit-test-coverage/portable/coveragetest-posixfile.c +++ b/src/unit-test-coverage/portable/coveragetest-posixfile.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -21,11 +31,11 @@ #include "ut-osfileapi.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define OSAPI_TEST_FUNCTION_RC(func,exp) \ { \ diff --git a/src/unit-test-coverage/portable/coveragetest-posixgettime.c b/src/unit-test-coverage/portable/coveragetest-posixgettime.c index 525191ba7..bbe3e4f14 100644 --- a/src/unit-test-coverage/portable/coveragetest-posixgettime.c +++ b/src/unit-test-coverage/portable/coveragetest-posixgettime.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -19,7 +29,7 @@ #include #include -#include +#include #define OSAPI_TEST_FUNCTION_RC(func,exp) \ { \ diff --git a/src/unit-test-coverage/portable/coveragetest-posixio.c b/src/unit-test-coverage/portable/coveragetest-posixio.c index 7f4424c0b..fc4e4c3cd 100644 --- a/src/unit-test-coverage/portable/coveragetest-posixio.c +++ b/src/unit-test-coverage/portable/coveragetest-posixio.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -19,10 +29,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "ut-osfileapi.h" diff --git a/src/unit-test-coverage/posix/modules/CMakeLists.txt b/src/unit-test-coverage/posix/modules/CMakeLists.txt index 8e62459db..c48a887bf 100644 --- a/src/unit-test-coverage/posix/modules/CMakeLists.txt +++ b/src/unit-test-coverage/posix/modules/CMakeLists.txt @@ -1,3 +1,13 @@ +# +# Copyright (c) 2019, 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. +# + # -------------------------------------- # OSAL SHARED LAYER FOR COVERAGE TESTING # -------------------------------------- @@ -12,7 +22,8 @@ # - UT_C_FLAGS are enabled to include any code coverage instrumentation # the "overrides" dir contains empty versions of the C-library include files. -include_directories(BEFORE ${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc/overrides) +include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc) +include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc) foreach(MODULE ${MODULE_LIST}) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/ut-${MODULE}.c) @@ -21,4 +32,4 @@ foreach(MODULE ${MODULE_LIST}) endif () endforeach() - \ No newline at end of file + diff --git a/src/unit-test-coverage/posix/modules/src/stub-map-to-real.h b/src/unit-test-coverage/posix/modules/src/stub-map-to-real.h deleted file mode 100644 index 9c27d0f7e..000000000 --- a/src/unit-test-coverage/posix/modules/src/stub-map-to-real.h +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Copyright (c) 2004-2015, United States government as represented by the - * administrator of the National Aeronautics Space Administration. - * All rights reserved. This software was created at NASA Glenn - * Research 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 stub-map-to-real.h - * - * Created on: Oct 29, 2015 - * Author: joseph.p.hickey@nasa.gov - * - * Map all symbols to the OCS counterpart for unit testing - */ - -#ifndef STUB_MAP_TO_REAL_H_ -#define STUB_MAP_TO_REAL_H_ - -#define EXIT_SUCCESS OCS_EXIT_SUCCESS -#define EXIT_FAILURE OCS_EXIT_FAILURE - -/* clock-related identifiers */ -#define CLOCK_REALTIME OCS_CLOCK_REALTIME -#define CLOCK_MONOTONIC OCS_CLOCK_MONOTONIC -#define TIMER_ABSTIME OCS_TIMER_ABSTIME - -/* file-related identifiers */ -#define O_RDONLY OCS_O_RDONLY -#define O_WRONLY OCS_O_WRONLY -#define O_RDWR OCS_O_RDWR -#define O_CREAT OCS_O_CREAT -#define O_TRUNC OCS_O_TRUNC -#define S_IRUSR OCS_S_IRUSR -#define S_IWUSR OCS_S_IWUSR -#define S_IRGRP OCS_S_IRGRP -#define S_IWGRP OCS_S_IWGRP -#define S_IROTH OCS_S_IROTH -#define S_IWOTH OCS_S_IWOTH -#define SEEK_SET OCS_SEEK_SET -#define SEEK_CUR OCS_SEEK_CUR -#define SEEK_END OCS_SEEK_END - -#define STDOUT_FILENO OCS_STDOUT_FILENO -#define STDIN_FILENO OCS_STDIN_FILENO -#define STDERR_FILENO OCS_STDERR_FILENO - -/* pthread-related identifiers */ -#define PTHREAD_PRIO_INHERIT OCS_PTHREAD_PRIO_INHERIT -#define PTHREAD_MUTEX_RECURSIVE OCS_PTHREAD_MUTEX_RECURSIVE -#define PTHREAD_EXPLICIT_SCHED OCS_PTHREAD_EXPLICIT_SCHED - -/* signal-related identifiers */ -#define SIG_SETMASK OCS_SIG_SETMASK -#define SIGHUP OCS_SIGHUP -#define SIGINT OCS_SIGINT -#define SIGABRT OCS_SIGABRT -#define SIGSEGV OCS_SIGSEGV -#define SIGBUS OCS_SIGBUS -#define SIGFPE OCS_SIGFPE -#define SIGILL OCS_SIGILL -#define SIGRTMIN OCS_SIGRTMIN -#define SIGRTMAX OCS_SIGRTMAX - -/* scheduler-related identifiers */ -#define SCHED_FIFO OCS_SCHED_FIFO -#define SCHED_RR OCS_SCHED_RR - -/* errno identifiers */ -#define EINTR OCS_EINTR -#define EAGAIN OCS_EAGAIN -#define EINVAL OCS_EINVAL -#define EMSGSIZE OCS_EMSGSIZE -#define ETIMEDOUT OCS_ETIMEDOUT -#define errno OCS_errno - -/******************************************************************************* - * ENUM definitions - keeping as an enum so the usage semantics are similar - *******************************************************************************/ - - -/******************************************************************************* - * TYPE definitions normally supplied by POSIX (any header) - *******************************************************************************/ -#define DIR OCS_DIR -#define FILE OCS_FILE -#define pthread_t OCS_pthread_t -#define pthread_attr_t OCS_pthread_attr_t -#define pthread_mutex_t OCS_pthread_mutex_t -#define pthread_mutexattr_t OCS_pthread_mutexattr_t -#define pthread_cond_t OCS_pthread_cond_t -#define pthread_condattr_t OCS_pthread_condattr_t -#define pthread_key_t OCS_pthread_key_t -#define mqd_t OCS_mqd_t -#define sem_t OCS_sem_t -#define sigset_t OCS_sigset_t -#define sig_atomic_t OCS_sig_atomic_t -#define ssize_t OCS_ssize_t -#define time_t OCS_time_t - -/* - * NOTE: The OCS_ structs that are not typedefs must be #defined, because the - * code will refer to them as "struct YYY" which will not compile if YYY is a typedef. - */ -#define statfs OCS_statfs -#define stat OCS_stat -#define mq_attr OCS_mq_attr -#define timespec OCS_timespec -#define dirent OCS_dirent -#define sched_param OCS_sched_param - -/******************************************************************************* - * - * FUNCTION MAPPINGS for APIs normally supplied by POSIX (any header) - * - * This table below also serves as a useful list of POSIX API calls that - * the OSAL actually uses. - * - *******************************************************************************/ - -#define accept OCS_accept -#define bind OCS_bind -#define clock_getres OCS_clock_getres -#define clock_gettime OCS_clock_gettime -#define clock_nanosleep OCS_clock_nanosleep -#define clock_settime OCS_clock_settime -#define closedir OCS_closedir -#define close OCS_close -#define connect OCS_connect -#define dlclose OCS_dlclose -#define dlerror OCS_dlerror -#define dlopen OCS_dlopen -#define dlsym OCS_dlsym -#define exit OCS_exit -#define fchmod OCS_fchmod -#define fclose OCS_fclose -#define fcntl OCS_fcntl -#define fgets OCS_fgets -#define fopen OCS_fopen -#define fputs OCS_fputs -#define getegid OCS_getegid -#define geteuid OCS_geteuid -#define gethostid OCS_gethostid -#define gethostname OCS_gethostname -#define getpid OCS_getpid -#define getsockopt OCS_getsockopt -#define htons OCS_htons -#define inet_ntop OCS_inet_ntop -#define inet_pton OCS_inet_pton -#define kill OCS_kill -#define listen OCS_listen -#define lseek OCS_lseek -#define memcpy OCS_memcpy -#define memset OCS_memset -#define mkdir OCS_mkdir -#define mq_close OCS_mq_close -#define mq_open OCS_mq_open -#define mq_receive OCS_mq_receive -#define mq_timedreceive OCS_mq_timedreceive -#define mq_timedsend OCS_mq_timedsend -#define mq_unlink OCS_mq_unlink -#define ntohs OCS_ntohs -#define opendir OCS_opendir -#define open OCS_open -#define printf(...) OCS_printf(__VA_ARGS__) -#define pthread_attr_destroy OCS_pthread_attr_destroy -#define pthread_attr_getschedparam OCS_pthread_attr_getschedparam -#define pthread_attr_init OCS_pthread_attr_init -#define pthread_attr_setinheritsched OCS_pthread_attr_setinheritsched -#define pthread_attr_setschedparam OCS_pthread_attr_setschedparam -#define pthread_attr_setschedpolicy OCS_pthread_attr_setschedpolicy -#define pthread_attr_setstacksize OCS_pthread_attr_setstacksize -#define pthread_cancel OCS_pthread_cancel -#define pthread_cond_broadcast OCS_pthread_cond_broadcast -#define pthread_cond_destroy OCS_pthread_cond_destroy -#define pthread_cond_init OCS_pthread_cond_init -#define pthread_cond_signal OCS_pthread_cond_signal -#define pthread_cond_timedwait OCS_pthread_cond_timedwait -#define pthread_cond_wait OCS_pthread_cond_wait -#define pthread_create OCS_pthread_create -#define pthread_detach OCS_pthread_detach -#define pthread_equal OCS_pthread_equal -#define pthread_exit OCS_pthread_exit -#define pthread_getschedparam OCS_pthread_getschedparam -#define pthread_getspecific OCS_pthread_getspecific -#define pthread_key_create OCS_pthread_key_create -#define pthread_mutexattr_destroy OCS_pthread_mutexattr_destroy -#define pthread_mutexattr_init OCS_pthread_mutexattr_init -#define pthread_mutexattr_setprotocol OCS_pthread_mutexattr_setprotocol -#define pthread_mutexattr_settype OCS_pthread_mutexattr_settype -#define pthread_mutex_destroy OCS_pthread_mutex_destroy -#define pthread_mutex_init OCS_pthread_mutex_init -#define pthread_mutex_lock OCS_pthread_mutex_lock -#define pthread_mutex_unlock OCS_pthread_mutex_unlock -#define pthread_self OCS_pthread_self -#define pthread_setschedparam OCS_pthread_setschedparam -#define pthread_setschedprio OCS_pthread_setschedprio -#define pthread_setspecific OCS_pthread_setspecific -#define pthread_sigmask OCS_pthread_sigmask -#define readdir OCS_readdir -#define read OCS_read -#define recvfrom OCS_recvfrom -#define remove OCS_remove -#define rename OCS_rename -#define rewinddir OCS_rewinddir -#define rmdir OCS_rmdir -#define sched_get_priority_max OCS_sched_get_priority_max -#define sched_get_priority_min OCS_sched_get_priority_min -#define select OCS_select -#define sem_destroy OCS_sem_destroy -#define sem_getvalue OCS_sem_getvalue -#define sem_init OCS_sem_init -#define sem_post OCS_sem_post -#define sem_timedwait OCS_sem_timedwait -#define sem_wait OCS_sem_wait -#define sendto OCS_sendto -#define setsockopt OCS_setsockopt -#define sigaddset OCS_sigaddset -#define sigdelset OCS_sigdelset -#define sigemptyset OCS_sigemptyset -#define sigfillset OCS_sigfillset -#define sigismember OCS_sigismember -#define signal OCS_signal -#define sigprocmask OCS_sigprocmask -#define sigsuspend OCS_sigsuspend -#define sigwait OCS_sigwait -#define snprintf OCS_snprintf -#define socket OCS_socket -#define stat OCS_stat -#define statvfs OCS_statvfs -#define stdout OCS_stdout -#define strcmp OCS_strcmp -#define strcpy OCS_strcpy -#define strerror OCS_strerror -#define strlen OCS_strlen -#define strncmp OCS_strncmp -#define strncpy OCS_strncpy -#define strrchr OCS_strrchr -#define strtoul OCS_strtoul -#define sysconf OCS_sysconf -#define system OCS_system -#define timer_create OCS_timer_create -#define timer_delete OCS_timer_delete -#define timer_settime OCS_timer_settime -#define vsnprintf OCS_vsnprintf -#define write OCS_write - -#endif /* STUB_MAP_TO_REAL_H_ */ diff --git a/src/unit-test-coverage/posix/modules/src/ut-osapi.c b/src/unit-test-coverage/posix/modules/src/ut-osapi.c index e5e228da7..534461fae 100644 --- a/src/unit-test-coverage/posix/modules/src/ut-osapi.c +++ b/src/unit-test-coverage/posix/modules/src/ut-osapi.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" /* diff --git a/src/unit-test-coverage/posix/src/coveragetest-osapi.c b/src/unit-test-coverage/posix/src/coveragetest-osapi.c index eaa5e7610..d6a4181dc 100644 --- a/src/unit-test-coverage/posix/src/coveragetest-osapi.c +++ b/src/unit-test-coverage/posix/src/coveragetest-osapi.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -19,7 +29,7 @@ #include #include -#include +#include void Test_OS_Lock_Global_Impl(void) diff --git a/src/unit-test-coverage/shared/modules/CMakeLists.txt b/src/unit-test-coverage/shared/modules/CMakeLists.txt index 0fbacfe5d..0b35829ef 100644 --- a/src/unit-test-coverage/shared/modules/CMakeLists.txt +++ b/src/unit-test-coverage/shared/modules/CMakeLists.txt @@ -1,3 +1,13 @@ +# +# Copyright (c) 2019, 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. +# + # -------------------------------------- # OSAL SHARED LAYER FOR COVERAGE TESTING # -------------------------------------- @@ -11,8 +21,9 @@ # stub (OCS) counterpart # - UT_C_FLAGS are enabled to include any code coverage instrumentation -# the "overrides" dir contains empty versions of the C-library include files. -include_directories(BEFORE ${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc/overrides) +# the "override_inc" dir contains replacement versions of the C-library include files. +include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc) +include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc) foreach(MODULE ${MODULE_LIST}) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/ut-osapi-${MODULE}.c) diff --git a/src/unit-test-coverage/shared/modules/src/stub-map-to-real.h b/src/unit-test-coverage/shared/modules/src/stub-map-to-real.h deleted file mode 100644 index 03733b1d3..000000000 --- a/src/unit-test-coverage/shared/modules/src/stub-map-to-real.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2004-2015, United States government as represented by the - * administrator of the National Aeronautics Space Administration. - * All rights reserved. This software was created at NASA Glenn - * Research 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 stub-map-to-real.h - * - * Created on: Oct 29, 2015 - * Author: joseph.p.hickey@nasa.gov - * - * Placeholder for file content description - */ - -#ifndef STUB_MAP_TO_REAL_H_ -#define STUB_MAP_TO_REAL_H_ - -/******************************************************************************* - * OCS VALUE MAPPINGS for constants normally supplied by libc headers - *******************************************************************************/ - -#define EXIT_SUCCESS OCS_EXIT_SUCCESS -#define EXIT_FAILURE OCS_EXIT_FAILURE - - -/******************************************************************************* - * OCS TYPE MAPPINGS for APIs normally supplied by libc headers - *******************************************************************************/ -#define va_list OCS_va_list - -/******************************************************************************* - * OCS FUNCTION MAPPINGS for APIs normally supplied by libc headers - *******************************************************************************/ - -#define va_start OCS_va_start -#define va_end OCS_va_end -#define strrchr OCS_strrchr -#define strchr OCS_strchr -#define exit OCS_exit -#define strncpy OCS_strncpy -#define strlen OCS_strlen -#define strcmp OCS_strcmp -#define strcpy OCS_strcpy -#define strncpy OCS_strncpy -#define vsnprintf OCS_vsnprintf -#define memset OCS_memset -#define memcpy OCS_memcpy -#define strcat OCS_strcat -#define strncat OCS_strncat -#define strncmp OCS_strncmp -#define snprintf OCS_snprintf -#define printf(...) OCS_printf(__VA_ARGS__) -#define isgraph OCS_isgraph - -#endif /* STUB_MAP_TO_REAL_H_ */ diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-binsem.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-binsem.c index fe9f7fc13..6839ead86 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-binsem.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-binsem.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-binsem.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-clock.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-clock.c index 0d1753add..30aab8328 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-clock.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-clock.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-clock.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-common.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-common.c index 9535d9760..1c6895c17 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-common.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-common.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-common.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-countsem.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-countsem.c index 7b85b0c71..951b86d67 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-countsem.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-countsem.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-countsem.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-dir.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-dir.c index ba3b26c8c..5c1d85ef5 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-dir.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-dir.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-dir.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-errors.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-errors.c index a6018808c..c106acd60 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-errors.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-errors.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-errors.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-file.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-file.c index ad84f9bfb..cfd1f6c3c 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-file.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-file.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-file.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-filesys.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-filesys.c index 0d6d7e389..eef3dd0cd 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-filesys.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-filesys.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-filesys.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-fpu.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-fpu.c index 5d0fda59c..83a6f8074 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-fpu.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-fpu.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-fpu.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-heap.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-heap.c index 54b04fbb9..933af12e4 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-heap.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-heap.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-heap.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-idmap.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-idmap.c index 63b769b98..50ac5e041 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-idmap.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-idmap.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-idmap.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-interrupts.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-interrupts.c index 49938cb3e..6a09c9036 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-interrupts.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-interrupts.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-interrupts.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-module.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-module.c index 568bc6188..9b4af5148 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-module.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-module.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-module.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-mutex.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-mutex.c index a28bd55a2..b1679f380 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-mutex.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-mutex.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-mutex.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-network.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-network.c index 5a52fc323..614adaf8b 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-network.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-network.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-network.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-printf.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-printf.c index c48aa6d9f..52f18eff9 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-printf.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-printf.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-printf.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-queue.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-queue.c index 56fb36410..b75a1655b 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-queue.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-queue.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-queue.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-select.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-select.c index b25cd24cd..08f3b1562 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-select.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-select.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-select.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-sockets.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-sockets.c index 22bbdaf04..8a68e7516 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-sockets.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-sockets.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-sockets.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-task.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-task.c index e33185f88..09fc647da 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-task.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-task.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-task.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-time.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-time.c index 75d54cff8..74ec80abe 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-time.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-time.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-time.h" diff --git a/src/unit-test-coverage/shared/modules/src/ut-osapi-timebase.c b/src/unit-test-coverage/shared/modules/src/ut-osapi-timebase.c index b69f36a30..0c17797a2 100644 --- a/src/unit-test-coverage/shared/modules/src/ut-osapi-timebase.c +++ b/src/unit-test-coverage/shared/modules/src/ut-osapi-timebase.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi-timebase.h" diff --git a/src/unit-test-coverage/shared/src/coveragetest-binsem.c b/src/unit-test-coverage/shared/src/coveragetest-binsem.c index b26fd66a7..75238a7e2 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-binsem.c +++ b/src/unit-test-coverage/shared/src/coveragetest-binsem.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-binsem.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-common.c b/src/unit-test-coverage/shared/src/coveragetest-common.c index 5873d530c..117b17c65 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-common.c +++ b/src/unit-test-coverage/shared/src/coveragetest-common.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-common.h" -#include +#include /* ** OS_CleanUpObject() is an internal helper function. diff --git a/src/unit-test-coverage/shared/src/coveragetest-countsem.c b/src/unit-test-coverage/shared/src/coveragetest-countsem.c index a1f272b75..166a61274 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-countsem.c +++ b/src/unit-test-coverage/shared/src/coveragetest-countsem.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-countsem.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-file.c b/src/unit-test-coverage/shared/src/coveragetest-file.c index ae09ddf24..f9184b205 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-file.c +++ b/src/unit-test-coverage/shared/src/coveragetest-file.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_file.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-file.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-filesys.c b/src/unit-test-coverage/shared/src/coveragetest-filesys.c index f169221de..4828f6425 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-filesys.c +++ b/src/unit-test-coverage/shared/src/coveragetest-filesys.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_filesys.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-filesys.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-idmap.c b/src/unit-test-coverage/shared/src/coveragetest-idmap.c index c8a2f1cf0..cbb3965b8 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-idmap.c +++ b/src/unit-test-coverage/shared/src/coveragetest-idmap.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-idmap.h" -#include +#include typedef struct diff --git a/src/unit-test-coverage/shared/src/coveragetest-module.c b/src/unit-test-coverage/shared/src/coveragetest-module.c index 61a0f1a22..06eccaf65 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-module.c +++ b/src/unit-test-coverage/shared/src/coveragetest-module.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_module.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-module.h" -#include +#include /* A dummy function for the static symbol lookup test. Not called */ void Test_DummyFunc(void) diff --git a/src/unit-test-coverage/shared/src/coveragetest-mutex.c b/src/unit-test-coverage/shared/src/coveragetest-mutex.c index ca2fe9aa5..8713389ee 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-mutex.c +++ b/src/unit-test-coverage/shared/src/coveragetest-mutex.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-mutex.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-printf.c b/src/unit-test-coverage/shared/src/coveragetest-printf.c index d7079c2c7..d543a8c70 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-printf.c +++ b/src/unit-test-coverage/shared/src/coveragetest-printf.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-printf.h" -#include +#include char TestConsoleBuffer[16]; diff --git a/src/unit-test-coverage/shared/src/coveragetest-queue.c b/src/unit-test-coverage/shared/src/coveragetest-queue.c index 2dffbd41a..0385be681 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-queue.c +++ b/src/unit-test-coverage/shared/src/coveragetest-queue.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-queue.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-select.c b/src/unit-test-coverage/shared/src/coveragetest-select.c index d38068017..dc5860496 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-select.c +++ b/src/unit-test-coverage/shared/src/coveragetest-select.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-select.h" -#include +#include /* ********************************************************************************** diff --git a/src/unit-test-coverage/shared/src/coveragetest-sockets.c b/src/unit-test-coverage/shared/src/coveragetest-sockets.c index 658d05a4c..fc6c898d2 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-sockets.c +++ b/src/unit-test-coverage/shared/src/coveragetest-sockets.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-sockets.h" -#include +#include void Test_OS_SocketAPI_Init(void) { diff --git a/src/unit-test-coverage/shared/src/coveragetest-task.c b/src/unit-test-coverage/shared/src/coveragetest-task.c index 7ea1fdf79..06495f2ac 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-task.c +++ b/src/unit-test-coverage/shared/src/coveragetest-task.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-task.h" -#include +#include static uint32 UT_TestHook_Count = 0; diff --git a/src/unit-test-coverage/shared/src/coveragetest-time.c b/src/unit-test-coverage/shared/src/coveragetest-time.c index b0a25b234..3125d0d9a 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-time.c +++ b/src/unit-test-coverage/shared/src/coveragetest-time.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_timer.c * @@ -15,7 +25,7 @@ #include "os-shared-coveragetest.h" #include "ut-osapi-time.h" -#include +#include static uint32 UT_TimerCount = 0; static uint32 UT_TimerArgCount = 0; diff --git a/src/unit-test-coverage/shared/src/coveragetest-timebase.c b/src/unit-test-coverage/shared/src/coveragetest-timebase.c index 2fd7dfdb1..0fb83b95c 100644 --- a/src/unit-test-coverage/shared/src/coveragetest-timebase.c +++ b/src/unit-test-coverage/shared/src/coveragetest-timebase.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_timebase.c * @@ -16,7 +26,7 @@ #include "ut-osapi-timebase.h" -#include +#include static uint32 TimerSyncCount = 0; static uint32 TimerSyncRetVal = 0; diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/arpa/inet.h b/src/unit-test-coverage/ut-stubs/inc/OCS_arpa_inet.h similarity index 93% rename from src/unit-test-coverage/ut-stubs/inc/overrides/arpa/inet.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_arpa_inet.h index 019b46531..49a13d15e 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/arpa/inet.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_arpa_inet.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_ARPA_INET_H_ #define _OSAL_STUB_ARPA_INET_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in arpa/inet.h */ /* ----------------------------------------- */ @@ -14,7 +16,7 @@ /* prototypes normally declared in arpa/inet.h */ /* ----------------------------------------- */ -extern const char *OCS_inet_ntop (int af, const void * cp, char * buf, OCS_socklen_t len); +extern const char *OCS_inet_ntop (int af, const void * cp, char * buf, size_t len); extern int OCS_inet_pton (int af, const char * cp, void * buf); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/assert.h b/src/unit-test-coverage/ut-stubs/inc/OCS_assert.h similarity index 90% rename from src/unit-test-coverage/ut-stubs/inc/overrides/assert.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_assert.h index 622d0dbb5..b4dfc3612 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/assert.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_assert.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_ASSERT_H_ #define _OSAL_STUB_ASSERT_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in assert.h */ /* ----------------------------------------- */ @@ -10,10 +12,12 @@ /* types normally defined in assert.h */ /* ----------------------------------------- */ + /* ----------------------------------------- */ /* prototypes normally declared in assert.h */ /* ----------------------------------------- */ +void OCS_assert(bool expression); #endif /* _OSAL_STUB_ASSERT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/OCS_basetypes.h b/src/unit-test-coverage/ut-stubs/inc/OCS_basetypes.h new file mode 100644 index 000000000..d02838745 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_basetypes.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub basic data types */ +#ifndef _OSAL_STUB_BASETYPES_H_ +#define _OSAL_STUB_BASETYPES_H_ + +/* + * NOTE: These header files are intentionally _not_ overridden + * in the replacement/override header directory, so this should + * pull in the actual (native system) version of these files. + * + * It is important to pull in these definitions first before any + * potential re-mapping (#define) statements are done. + */ + +#include /* for correct size_t and ptrdiff_t types */ +#include /* for correct fixed-width integer types */ +#include /* for correct INT_MAX, etc. */ +#include /* for correct boolean semantics */ + + +#endif /* _OSAL_STUB_BASETYPES_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/inc/OCS_blkIo.h b/src/unit-test-coverage/ut-stubs/inc/OCS_blkIo.h new file mode 100644 index 000000000..95d7b4beb --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_blkIo.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub basic data types */ +#ifndef _OSAL_STUB_BLKIO_H_ +#define _OSAL_STUB_BLKIO_H_ + +#include +#include + +/* The module and blk_dev types are used in several headers */ +typedef struct OCS_BLK_DEV { int bd; } OCS_BLK_DEV; +typedef OCS_BLK_DEV* OCS_BLK_DEV_ID; + + +#endif /* _OSAL_STUB_BLKIO_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/cbioLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_cbioLib.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/cbioLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_cbioLib.h index 38e71c024..15ed7331b 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/cbioLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_cbioLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_CBIOLIB_H_ #define _OSAL_STUB_CBIOLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in cbioLib.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/complex.h b/src/unit-test-coverage/ut-stubs/inc/OCS_complex.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/complex.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_complex.h index 2dda7e4f6..6f4fa0f08 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/complex.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_complex.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_COMPLEX_H_ #define _OSAL_STUB_COMPLEX_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in complex.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/ctype.h b/src/unit-test-coverage/ut-stubs/inc/OCS_ctype.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/ctype.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_ctype.h index 1f83efe53..3fc481383 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/ctype.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_ctype.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_CTYPE_H_ #define _OSAL_STUB_CTYPE_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in ctype.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/dirent.h b/src/unit-test-coverage/ut-stubs/inc/OCS_dirent.h similarity index 92% rename from src/unit-test-coverage/ut-stubs/inc/overrides/dirent.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_dirent.h index 202eff397..c59799ed7 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/dirent.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_dirent.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_DIRENT_H_ #define _OSAL_STUB_DIRENT_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in dirent.h */ /* ----------------------------------------- */ @@ -10,7 +12,7 @@ /* types normally defined in dirent.h */ /* ----------------------------------------- */ -typedef void OCS_DIR; +typedef struct OCS_DIR OCS_DIR; struct OCS_dirent { diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/dlfcn.h b/src/unit-test-coverage/ut-stubs/inc/OCS_dlfcn.h similarity index 89% rename from src/unit-test-coverage/ut-stubs/inc/overrides/dlfcn.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_dlfcn.h index ef5533b73..e55d7f66d 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/dlfcn.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_dlfcn.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_DLFCN_H_ #define _OSAL_STUB_DLFCN_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in dlfcn.h */ /* ----------------------------------------- */ @@ -16,7 +18,7 @@ extern int OCS_dlclose (void * handle); extern char *OCS_dlerror (void); -extern void *OCS_dlopen (const char * file, int mode); +extern void *OCS_dlopen (const char * file, int flags); extern void *OCS_dlsym (void * handle, const char * name); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/dosFsLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_dosFsLib.h similarity index 94% rename from src/unit-test-coverage/ut-stubs/inc/overrides/dosFsLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_dosFsLib.h index 95e92f49d..70d0225fc 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/dosFsLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_dosFsLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_DOSFSLIB_H_ #define _OSAL_STUB_DOSFSLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in dosFsLib.h */ /* ----------------------------------------- */ @@ -14,8 +17,6 @@ /* ----------------------------------------- */ /* types normally defined in dosFsLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef int (*OCS_FUNCPTR)(); /* ----------------------------------------- */ /* prototypes normally declared in dosFsLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/drv/hdisk/ataDrv.h b/src/unit-test-coverage/ut-stubs/inc/OCS_drv_hdisk_ataDrv.h similarity index 90% rename from src/unit-test-coverage/ut-stubs/inc/overrides/drv/hdisk/ataDrv.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_drv_hdisk_ataDrv.h index 61589ac51..da004813b 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/drv/hdisk/ataDrv.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_drv_hdisk_ataDrv.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_DRV_HDISK_ATADRV_H_ #define _OSAL_STUB_DRV_HDISK_ATADRV_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in drv/hdisk/ataDrv.h */ /* ----------------------------------------- */ @@ -9,7 +13,6 @@ /* ----------------------------------------- */ /* types normally defined in drv/hdisk/ataDrv.h */ /* ----------------------------------------- */ -typedef int OCS_BLK_DEV; /* ----------------------------------------- */ /* prototypes normally declared in drv/hdisk/ataDrv.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/errno.h b/src/unit-test-coverage/ut-stubs/inc/OCS_errno.h similarity index 69% rename from src/unit-test-coverage/ut-stubs/inc/overrides/errno.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_errno.h index 933721169..3998c576f 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/errno.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_errno.h @@ -2,9 +2,12 @@ #ifndef _OSAL_STUB_ERRNO_H_ #define _OSAL_STUB_ERRNO_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in errno.h */ /* ----------------------------------------- */ +/* POSIX-specific errnos */ #define OCS_EINTR 0x1801 #define OCS_EAGAIN 0x1802 #define OCS_EINVAL 0x1803 @@ -12,15 +15,6 @@ #define OCS_ETIMEDOUT 0x1805 #define OCS_ESPIPE 0x1806 -/* VxWorks-specific errnos */ -#define OCS_M_objLib 0x1810 -#define OCS_S_objLib_OBJ_ID_ERROR (OCS_M_objLib | 1) -#define OCS_S_objLib_OBJ_UNAVAILABLE (OCS_M_objLib | 2) -#define OCS_S_objLib_OBJ_DELETED (OCS_M_objLib | 3) -#define OCS_S_objLib_OBJ_TIMEOUT (OCS_M_objLib | 4) -#define OCS_S_objLib_OBJ_NO_METHOD (OCS_M_objLib | 5) - - /* ----------------------------------------- */ /* types normally defined in errno.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/errnoLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_errnoLib.h similarity index 92% rename from src/unit-test-coverage/ut-stubs/inc/overrides/errnoLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_errnoLib.h index a881051cc..5859f5daf 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/errnoLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_errnoLib.h @@ -2,12 +2,12 @@ #ifndef _OSAL_STUB_ERRNOLIB_H_ #define _OSAL_STUB_ERRNOLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in errnoLib.h */ /* ----------------------------------------- */ -#define OCS_OK (0) -#define OCS_ERROR (-1) - /* ----------------------------------------- */ /* types normally defined in errnoLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/fcntl.h b/src/unit-test-coverage/ut-stubs/inc/OCS_fcntl.h similarity index 54% rename from src/unit-test-coverage/ut-stubs/inc/overrides/fcntl.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_fcntl.h index 5a5f08209..2e07ebc8a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/fcntl.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_fcntl.h @@ -2,11 +2,38 @@ #ifndef _OSAL_STUB_FCNTL_H_ #define _OSAL_STUB_FCNTL_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in fcntl.h */ /* ----------------------------------------- */ -#include "utbits/filemodes.h" + +/* + * note these constants are used as bitmasks and so + * they must be single bit flags to work properly. + * + * However, they are defined differently from a typical UNIX + * in order to increase the likelihood that a hard-coded value + * is caught by UT. + * + * These are exposed to apps through fcntl.h and sys/stat.h + */ +#define OCS_S_IXOTH 0x1000 +#define OCS_S_IXGRP 0x2000 +#define OCS_S_IXUSR 0x4000 + +#define OCS_S_IROTH 0x0100 +#define OCS_S_IRGRP 0x0200 +#define OCS_S_IRUSR 0x0400 + +#define OCS_S_IWOTH 0x0010 +#define OCS_S_IWGRP 0x0020 +#define OCS_S_IWUSR 0x0040 + +#define OCS_S_IFDIR 0x0001 +#define OCS_S_ISDIR(x) (((x) & OCS_S_IFDIR) == OCS_S_IFDIR) + #define OCS_O_RDONLY 0x1501 #define OCS_O_WRONLY 0x1502 @@ -18,11 +45,14 @@ #define OCS_F_GETFL 0x1D01 #define OCS_F_SETFL 0x1D02 +#define OCS_F_GETFD 0x1D03 +#define OCS_F_SETFD 0x1D04 +#define OCS_F_DUPFD 0x1D05 /* ----------------------------------------- */ /* types normally defined in fcntl.h */ /* ----------------------------------------- */ -typedef unsigned int OCS_mode_t; + /* ----------------------------------------- */ /* prototypes normally declared in fcntl.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/fenv.h b/src/unit-test-coverage/ut-stubs/inc/OCS_fenv.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/fenv.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_fenv.h index a11063033..db9a940dd 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/fenv.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_fenv.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_FENV_H_ #define _OSAL_STUB_FENV_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in fenv.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/float.h b/src/unit-test-coverage/ut-stubs/inc/OCS_float.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/float.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_float.h index 6e2f47d1f..f4ce8fe86 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/float.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_float.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_FLOAT_H_ #define _OSAL_STUB_FLOAT_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in float.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/hostLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_hostLib.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/hostLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_hostLib.h index 0b11757fb..c7bed5c4b 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/hostLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_hostLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_HOSTLIB_H_ #define _OSAL_STUB_HOSTLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in hostLib.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/intLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_intLib.h similarity index 93% rename from src/unit-test-coverage/ut-stubs/inc/overrides/intLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_intLib.h index ea3e21030..1b5e6e8c9 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/intLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_intLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_INTLIB_H_ #define _OSAL_STUB_INTLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in intLib.h */ /* ----------------------------------------- */ @@ -9,8 +12,6 @@ /* ----------------------------------------- */ /* types normally defined in intLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef void (*OCS_VOIDFUNCPTR)(void); /* ----------------------------------------- */ /* prototypes normally declared in intLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/inttypes.h b/src/unit-test-coverage/ut-stubs/inc/OCS_inttypes.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/inttypes.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_inttypes.h index 71cb889c4..0c1512949 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/inttypes.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_inttypes.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_INTTYPES_H_ #define _OSAL_STUB_INTTYPES_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in inttypes.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/ioLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_ioLib.h similarity index 93% rename from src/unit-test-coverage/ut-stubs/inc/overrides/ioLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_ioLib.h index 7ce7b6dbc..7ce065113 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/ioLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_ioLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_IOLIB_H_ #define _OSAL_STUB_IOLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in ioLib.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/OCS_iv.h b/src/unit-test-coverage/ut-stubs/inc/OCS_iv.h new file mode 100644 index 000000000..7e26c2438 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_iv.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for iv.h */ +#ifndef _OSAL_STUB_IV_H_ +#define _OSAL_STUB_IV_H_ + +#include + +#endif /* _OSAL_STUB_IV_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/loadLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_loadLib.h similarity index 88% rename from src/unit-test-coverage/ut-stubs/inc/overrides/loadLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_loadLib.h index 47b01c6d2..02e338186 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/loadLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_loadLib.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_LOADLIB_H_ #define _OSAL_STUB_LOADLIB_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in loadLib.h */ /* ----------------------------------------- */ @@ -9,7 +13,6 @@ /* ----------------------------------------- */ /* types normally defined in loadLib.h */ /* ----------------------------------------- */ -typedef void* OCS_MODULE_ID; /* ----------------------------------------- */ /* prototypes normally declared in loadLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/locale.h b/src/unit-test-coverage/ut-stubs/inc/OCS_locale.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/locale.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_locale.h index 335ef3fab..915a51fea 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/locale.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_locale.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_LOCALE_H_ #define _OSAL_STUB_LOCALE_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in locale.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/logLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_logLib.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/logLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_logLib.h index b2bb51359..954090914 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/logLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_logLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_LOGLIB_H_ #define _OSAL_STUB_LOGLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in logLib.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/math.h b/src/unit-test-coverage/ut-stubs/inc/OCS_math.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/math.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_math.h index 31c1b2fe3..1de91990d 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/math.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_math.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_MATH_H_ #define _OSAL_STUB_MATH_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in math.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/memPartLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_memPartLib.h similarity index 93% rename from src/unit-test-coverage/ut-stubs/inc/overrides/memPartLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_memPartLib.h index c8d05779c..b0a18399b 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/memPartLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_memPartLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_MEMPARTLIB_H_ #define _OSAL_STUB_MEMPARTLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in memPartLib.h */ /* ----------------------------------------- */ @@ -9,8 +12,7 @@ /* ----------------------------------------- */ /* types normally defined in memPartLib.h */ /* ----------------------------------------- */ -typedef void* OCS_PART_ID; -typedef int OCS_STATUS; +typedef struct OCS_PART * OCS_PART_ID; typedef struct { diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/moduleLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_moduleLib.h similarity index 85% rename from src/unit-test-coverage/ut-stubs/inc/overrides/moduleLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_moduleLib.h index 53b838055..2ada0e952 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/moduleLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_moduleLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_MODULELIB_H_ #define _OSAL_STUB_MODULELIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in moduleLib.h */ /* ----------------------------------------- */ @@ -9,8 +12,8 @@ /* ----------------------------------------- */ /* types normally defined in moduleLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef void* OCS_MODULE_ID; +typedef struct OCS_MODULE { int m; } OCS_MODULE; +typedef OCS_MODULE* OCS_MODULE_ID; typedef struct OCS_MODULE_INFO { diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/mqueue.h b/src/unit-test-coverage/ut-stubs/inc/OCS_mqueue.h similarity index 73% rename from src/unit-test-coverage/ut-stubs/inc/overrides/mqueue.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_mqueue.h index ea19a8d94..045558fd1 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/mqueue.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_mqueue.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_MQUEUE_H_ #define _OSAL_STUB_MQUEUE_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in mqueue.h */ /* ----------------------------------------- */ @@ -10,9 +14,7 @@ /* types normally defined in mqueue.h */ /* ----------------------------------------- */ -typedef int OCS_mqd_t; -typedef long OCS_ssize_t; -typedef unsigned long OCS_size_t; +typedef int OCS_mqd_t; struct OCS_mq_attr { @@ -20,17 +22,15 @@ struct OCS_mq_attr unsigned int mq_msgsize; }; -struct OCS_timespec; - /* ----------------------------------------- */ /* prototypes normally declared in mqueue.h */ /* ----------------------------------------- */ extern int OCS_mq_close (OCS_mqd_t mqdes); extern OCS_mqd_t OCS_mq_open (const char * name, int oflag, ...); -extern OCS_ssize_t OCS_mq_receive (OCS_mqd_t mqdes, char * msg_ptr, OCS_size_t msg_len, unsigned int * msg_prio); -extern OCS_ssize_t OCS_mq_timedreceive (OCS_mqd_t mqdes, char * msg_ptr, OCS_size_t msg_len, unsigned int * msg_prio, const struct OCS_timespec * abs_timeout); -extern int OCS_mq_timedsend (OCS_mqd_t mqdes, const char * msg_ptr, OCS_size_t msg_len, unsigned int msg_prio, const struct OCS_timespec * abs_timeout); +extern OCS_ssize_t OCS_mq_receive (OCS_mqd_t mqdes, char * msg_ptr, size_t msg_len, unsigned int * msg_prio); +extern OCS_ssize_t OCS_mq_timedreceive (OCS_mqd_t mqdes, char * msg_ptr, size_t msg_len, unsigned int * msg_prio, const struct OCS_timespec * abs_timeout); +extern int OCS_mq_timedsend (OCS_mqd_t mqdes, const char * msg_ptr, size_t msg_len, unsigned int msg_prio, const struct OCS_timespec * abs_timeout); extern int OCS_mq_unlink (const char * name); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/msgQLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_msgQLib.h similarity index 88% rename from src/unit-test-coverage/ut-stubs/inc/overrides/msgQLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_msgQLib.h index 9b9599d75..66bc7029f 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/msgQLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_msgQLib.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_MSGQLIB_H_ #define _OSAL_STUB_MSGQLIB_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in msgQLib.h */ /* ----------------------------------------- */ @@ -16,9 +20,8 @@ /* ----------------------------------------- */ /* types normally defined in msgQLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef void* OCS_MSG_Q_ID; -typedef unsigned int OCS_UINT; +typedef struct { int x; } OCS_MSG_Q; +typedef OCS_MSG_Q* OCS_MSG_Q_ID; /* ----------------------------------------- */ /* prototypes normally declared in msgQLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/net/if.h b/src/unit-test-coverage/ut-stubs/inc/OCS_net_if.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/net/if.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_net_if.h index d495788ca..2b8a5e53b 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/net/if.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_net_if.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_NET_IF_H_ #define _OSAL_STUB_NET_IF_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in net/if.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/netdb.h b/src/unit-test-coverage/ut-stubs/inc/OCS_netdb.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/netdb.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_netdb.h index 2b7d4249b..7f648abe6 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/netdb.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_netdb.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_NETDB_H_ #define _OSAL_STUB_NETDB_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in netdb.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/netinet/in.h b/src/unit-test-coverage/ut-stubs/inc/OCS_netinet_in.h similarity index 85% rename from src/unit-test-coverage/ut-stubs/inc/overrides/netinet/in.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_netinet_in.h index b8e49537f..80a7f8546 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/netinet/in.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_netinet_in.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_NETINET_IN_H_ #define _OSAL_STUB_NETINET_IN_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in netinet/in.h */ /* ----------------------------------------- */ @@ -16,6 +18,8 @@ extern uint16_t OCS_htons (uint16_t hostshort); extern uint16_t OCS_ntohs (uint16_t netshort); +extern uint32_t OCS_htonl (uint32_t hostlong); +extern uint32_t OCS_ntohl (uint32_t netlong); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/netinet/tcp.h b/src/unit-test-coverage/ut-stubs/inc/OCS_netinet_tcp.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/netinet/tcp.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_netinet_tcp.h index 2c571b88f..ad0e7833d 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/netinet/tcp.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_netinet_tcp.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_NETINET_TCP_H_ #define _OSAL_STUB_NETINET_TCP_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in netinet/tcp.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/objLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_objLib.h similarity index 56% rename from src/unit-test-coverage/ut-stubs/inc/overrides/objLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_objLib.h index b25d75148..66f8210a3 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/objLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_objLib.h @@ -2,9 +2,21 @@ #ifndef _OSAL_STUB_OBJLIB_H_ #define _OSAL_STUB_OBJLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in objLib.h */ /* ----------------------------------------- */ +/* VxWorks-specific errnos */ +#define OCS_M_objLib 0x1810 +#define OCS_S_objLib_OBJ_ID_ERROR (OCS_M_objLib | 1) +#define OCS_S_objLib_OBJ_UNAVAILABLE (OCS_M_objLib | 2) +#define OCS_S_objLib_OBJ_DELETED (OCS_M_objLib | 3) +#define OCS_S_objLib_OBJ_TIMEOUT (OCS_M_objLib | 4) +#define OCS_S_objLib_OBJ_NO_METHOD (OCS_M_objLib | 5) + + /* ----------------------------------------- */ /* types normally defined in objLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/poll.h b/src/unit-test-coverage/ut-stubs/inc/OCS_poll.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/poll.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_poll.h index 5058a9f0e..830737dc1 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/poll.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_poll.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_POLL_H_ #define _OSAL_STUB_POLL_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in poll.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/pthread.h b/src/unit-test-coverage/ut-stubs/inc/OCS_pthread.h similarity index 80% rename from src/unit-test-coverage/ut-stubs/inc/overrides/pthread.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_pthread.h index 33f3ee4f3..1634e304a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/pthread.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_pthread.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_PTHREAD_H_ #define _OSAL_STUB_PTHREAD_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in pthread.h */ /* ----------------------------------------- */ @@ -14,18 +18,48 @@ /* types normally defined in pthread.h */ /* ----------------------------------------- */ -typedef int OCS_pthread_t; -typedef int OCS_pthread_attr_t; -typedef int OCS_pthread_mutex_t; -typedef int OCS_pthread_mutexattr_t; -typedef int OCS_pthread_cond_t; -typedef int OCS_pthread_condattr_t; -typedef int OCS_pthread_key_t; -typedef unsigned long OCS_size_t; -typedef unsigned int OCS_sigset_t; +struct OCS_pthread +{ + int pthr; +}; + +struct OCS_pthread_key +{ + int pthr_key; +}; + +struct OCS_pthread_mutex +{ + int pthr_mut; +}; + +struct OCS_pthread_cond +{ + int pthr_cond; +}; + +struct OCS_pthread_attr +{ + int pthr_attr; +}; + +struct OCS_pthread_mutexattr +{ + int pthr_mattr; +}; + +struct OCS_pthread_condattr +{ + int pthr_cattr; +}; -struct OCS_sched_param; -struct OCS_timespec; +typedef struct OCS_pthread OCS_pthread_t; +typedef struct OCS_pthread_attr OCS_pthread_attr_t; +typedef struct OCS_pthread_mutex OCS_pthread_mutex_t; +typedef struct OCS_pthread_mutexattr OCS_pthread_mutexattr_t; +typedef struct OCS_pthread_cond OCS_pthread_cond_t; +typedef struct OCS_pthread_condattr OCS_pthread_condattr_t; +typedef struct OCS_pthread_key OCS_pthread_key_t; /* ----------------------------------------- */ /* prototypes normally declared in pthread.h */ @@ -37,7 +71,7 @@ extern int OCS_pthread_attr_init (OCS_pthread_attr_t * attr); extern int OCS_pthread_attr_setinheritsched (OCS_pthread_attr_t * attr, int inherit); extern int OCS_pthread_attr_setschedparam (OCS_pthread_attr_t * attr, const struct OCS_sched_param * param); extern int OCS_pthread_attr_setschedpolicy (OCS_pthread_attr_t * attr, int policy); -extern int OCS_pthread_attr_setstacksize (OCS_pthread_attr_t * attr, OCS_size_t stacksize); +extern int OCS_pthread_attr_setstacksize (OCS_pthread_attr_t * attr, size_t stacksize); extern int OCS_pthread_cancel (OCS_pthread_t th); extern int OCS_pthread_cond_broadcast (OCS_pthread_cond_t * cond); extern int OCS_pthread_cond_destroy (OCS_pthread_cond_t * cond); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/ramDiskCbio.h b/src/unit-test-coverage/ut-stubs/inc/OCS_ramDiskCbio.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/ramDiskCbio.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_ramDiskCbio.h index f677f40b2..59b697b27 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/ramDiskCbio.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_ramDiskCbio.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_RAMDISKCBIO_H_ #define _OSAL_STUB_RAMDISKCBIO_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in ramDiskCbio.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/ramDrv.h b/src/unit-test-coverage/ut-stubs/inc/OCS_ramDrv.h similarity index 90% rename from src/unit-test-coverage/ut-stubs/inc/overrides/ramDrv.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_ramDrv.h index f5fe6f2fb..f4cbccf15 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/ramDrv.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_ramDrv.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_RAMDRV_H_ #define _OSAL_STUB_RAMDRV_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in ramDrv.h */ /* ----------------------------------------- */ @@ -9,7 +13,6 @@ /* ----------------------------------------- */ /* types normally defined in ramDrv.h */ /* ----------------------------------------- */ -typedef int OCS_BLK_DEV; /* ----------------------------------------- */ /* prototypes normally declared in ramDrv.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sched.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sched.h similarity index 96% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sched.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sched.h index 62859254b..b1f322b51 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sched.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sched.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SCHED_H_ #define _OSAL_STUB_SCHED_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sched.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/semLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_semLib.h similarity index 67% rename from src/unit-test-coverage/ut-stubs/inc/overrides/semLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_semLib.h index 81900a035..70bdbcb0a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/semLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_semLib.h @@ -2,28 +2,28 @@ #ifndef _OSAL_STUB_SEMLIB_H_ #define _OSAL_STUB_SEMLIB_H_ -#include "utbits/vxwaitflags.h" +#include +#include /* ----------------------------------------- */ /* constants normally defined in semLib.h */ /* ----------------------------------------- */ -#define OCS_VX_BINARY_SEMAPHORE(x) char x[4] -#define OCS_VX_COUNTING_SEMAPHORE(x) char x[4] -#define OCS_VX_MUTEX_SEMAPHORE(x) char x[4] +#define OCS_VX_BINARY_SEMAPHORE(x) OCS_SEM x[1] +#define OCS_VX_COUNTING_SEMAPHORE(x) OCS_SEM x[1] +#define OCS_VX_MUTEX_SEMAPHORE(x) OCS_SEM x[1] /* ----------------------------------------- */ /* types normally defined in semLib.h */ /* ----------------------------------------- */ -typedef void* OCS_SEM_ID; -typedef int OCS_STATUS; -typedef unsigned char OCS_SEM_B_STATE; +typedef char OCS_SEM; +typedef OCS_SEM* OCS_SEM_ID; /*for binary semaphores */ -enum +typedef enum { - OCS_SEM_EMPTY =0, - OCS_SEM_FULL =1 -}; + OCS_SEM_EMPTY = 0, + OCS_SEM_FULL = 1 +} OCS_SEM_B_STATE; enum { @@ -32,7 +32,6 @@ enum OCS_SEM_DELETE_SAFE = 0x4, OCS_SEM_INVERSION_SAFE = 0x8, OCS_SEM_EVENTSEND_ERR_NOTIFY = 0x10 - }; @@ -40,11 +39,11 @@ enum /* prototypes normally declared in semLib.h */ /* ----------------------------------------- */ -extern OCS_SEM_ID OCS_semBInitialize(char *pSemMem, int options, OCS_SEM_B_STATE initialState); +extern OCS_SEM_ID OCS_semBInitialize(OCS_SEM *pSemMem, int options, OCS_SEM_B_STATE initialState); extern OCS_SEM_ID OCS_semBCreate(int options, OCS_SEM_B_STATE initialState); -extern OCS_SEM_ID OCS_semMInitialize(char *pSemMem, int options); +extern OCS_SEM_ID OCS_semMInitialize(OCS_SEM *pSemMem, int options); extern OCS_SEM_ID OCS_semMCreate(int options); -extern OCS_SEM_ID OCS_semCInitialize(char *pSemMem, int options, int initialCount); +extern OCS_SEM_ID OCS_semCInitialize(OCS_SEM *pSemMem, int options, int initialCount); extern OCS_SEM_ID OCS_semCCreate(int flags, int count); extern OCS_STATUS OCS_semDelete(OCS_SEM_ID semId); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/semaphore.h b/src/unit-test-coverage/ut-stubs/inc/OCS_semaphore.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/semaphore.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_semaphore.h index a31cd9f15..0241c36dc 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/semaphore.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_semaphore.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SEMAPHORE_H_ #define _OSAL_STUB_SEMAPHORE_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in semaphore.h */ /* ----------------------------------------- */ @@ -10,12 +13,7 @@ /* types normally defined in semaphore.h */ /* ----------------------------------------- */ -typedef struct -{ - int v; -} OCS_sem_t; - -struct OCS_timespec; +typedef struct { int s; } OCS_sem_t; /* ----------------------------------------- */ /* prototypes normally declared in semaphore.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/setjmp.h b/src/unit-test-coverage/ut-stubs/inc/OCS_setjmp.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/setjmp.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_setjmp.h index a9c8b6a4f..bcd90b95d 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/setjmp.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_setjmp.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SETJMP_H_ #define _OSAL_STUB_SETJMP_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in setjmp.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/shellLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_shellLib.h similarity index 94% rename from src/unit-test-coverage/ut-stubs/inc/overrides/shellLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_shellLib.h index 155b250ef..141cb1865 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/shellLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_shellLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SHELLLIB_H_ #define _OSAL_STUB_SHELLLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in shellLib.h */ /* ----------------------------------------- */ @@ -9,8 +12,6 @@ /* ----------------------------------------- */ /* types normally defined in shellLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef int OCS_BOOL; /* ----------------------------------------- */ /* prototypes normally declared in shellLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/signal.h b/src/unit-test-coverage/ut-stubs/inc/OCS_signal.h similarity index 94% rename from src/unit-test-coverage/ut-stubs/inc/overrides/signal.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_signal.h index 91e5d9b37..3bfed4504 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/signal.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_signal.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SIGNAL_H_ #define _OSAL_STUB_SIGNAL_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in signal.h */ /* ----------------------------------------- */ @@ -23,11 +26,10 @@ /* ----------------------------------------- */ /* types normally defined in signal.h */ /* ----------------------------------------- */ - -typedef void (*OCS_sighandler_t)(int); -typedef unsigned int OCS_sigset_t; -typedef int OCS_sig_atomic_t; -typedef int OCS_pid_t; +typedef struct +{ + unsigned int ss; +} OCS_sigset_t; struct OCS_sigevent { @@ -35,6 +37,9 @@ struct OCS_sigevent int sigev_notify; }; +typedef void (*OCS_sighandler_t)(int); +typedef int OCS_sig_atomic_t; + /* ----------------------------------------- */ /* prototypes normally declared in signal.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/OCS_stat.h b/src/unit-test-coverage/ut-stubs/inc/OCS_stat.h new file mode 100644 index 000000000..54d30410d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_stat.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for stat.h */ +#ifndef _OSAL_STUB_STAT_H_ +#define _OSAL_STUB_STAT_H_ + +#include +#include + +/* ----------------------------------------- */ +/* constants normally defined in sys/stat.h */ +/* ----------------------------------------- */ + +/* ----------------------------------------- */ +/* constants normally defined in sys/statvfs.h */ +/* ----------------------------------------- */ + +/* ----------------------------------------- */ +/* types normally defined in sys/stat.h */ +/* ----------------------------------------- */ + +struct OCS_stat +{ + OCS_mode_t st_mode; + OCS_off_t st_size; + OCS_time_t st_mtime; + OCS_uid_t st_uid; + OCS_gid_t st_gid; +}; + +/* ----------------------------------------- */ +/* types normally defined in sys/statvfs.h */ +/* ----------------------------------------- */ +struct OCS_statvfs +{ + OCS_off_t f_bsize; + OCS_off_t f_bfree; + OCS_off_t f_blocks; +}; + +/* ----------------------------------------- */ +/* prototypes normally declared in sys/stat.h */ +/* ----------------------------------------- */ + +extern int OCS_fchmod (int fd, OCS_mode_t mode); +extern int OCS_chmod (const char *path, OCS_mode_t mode); +extern int OCS_mkdir (const char * path, ...); +extern int OCS_stat (const char * file, struct OCS_stat * buf); + + +/* ----------------------------------------- */ +/* prototypes normally declared in sys/statvfs.h */ +/* ----------------------------------------- */ + +extern int OCS_statvfs (const char * file, struct OCS_statvfs * buf); + + + +#endif /* _OSAL_STUB_STAT_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/stdarg.h b/src/unit-test-coverage/ut-stubs/inc/OCS_stdarg.h similarity index 82% rename from src/unit-test-coverage/ut-stubs/inc/overrides/stdarg.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_stdarg.h index 9c69790ba..d384c0a7e 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/stdarg.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_stdarg.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_STDARG_H_ #define _OSAL_STUB_STDARG_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in stdarg.h */ /* ----------------------------------------- */ @@ -9,14 +11,15 @@ /* ----------------------------------------- */ /* types normally defined in stdarg.h */ /* ----------------------------------------- */ +typedef struct { void *p; } OCS_va_list; + -typedef void* OCS_va_list; /* ----------------------------------------- */ /* prototypes normally declared in stdarg.h */ /* ----------------------------------------- */ -#define OCS_va_start(ap, last) ap = &last +#define OCS_va_start(ap, last) ap.p = &last #define OCS_va_end(ap) diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/stdio.h b/src/unit-test-coverage/ut-stubs/inc/OCS_stdio.h similarity index 79% rename from src/unit-test-coverage/ut-stubs/inc/overrides/stdio.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_stdio.h index 834b64174..68e719369 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/stdio.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_stdio.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_STDIO_H_ #define _OSAL_STUB_STDIO_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in stdio.h */ /* ----------------------------------------- */ @@ -9,10 +12,7 @@ /* ----------------------------------------- */ /* types normally defined in stdio.h */ /* ----------------------------------------- */ - -typedef void OCS_FILE; -typedef void* OCS_va_list; -typedef unsigned long OCS_size_t; +typedef struct OCS_FILE OCS_FILE; /* ----------------------------------------- */ @@ -25,8 +25,8 @@ extern OCS_FILE *OCS_fopen (const char * filename, const char * modes); extern int OCS_fputs (const char * s, OCS_FILE * stream); extern int OCS_remove (const char * filename); extern int OCS_rename (const char * old, const char * nw); -extern int OCS_snprintf (char * s, OCS_size_t maxlen, const char * format, ...); -extern int OCS_vsnprintf (char * s, OCS_size_t maxlen, const char * format, OCS_va_list arg); +extern int OCS_snprintf (char * s, size_t maxlen, const char * format, ...); +extern int OCS_vsnprintf (char * s, size_t maxlen, const char * format, OCS_va_list arg); extern int OCS_printf (const char * format, ...); extern int OCS_putchar (int c); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/stdlib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_stdlib.h similarity index 92% rename from src/unit-test-coverage/ut-stubs/inc/overrides/stdlib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_stdlib.h index 50421c460..27f61a038 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/stdlib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_stdlib.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_STDLIB_H_ #define _OSAL_STUB_STDLIB_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in stdlib.h */ /* ----------------------------------------- */ @@ -13,7 +15,6 @@ /* ----------------------------------------- */ /* types normally defined in stdlib.h */ /* ----------------------------------------- */ -typedef unsigned long OCS_size_t; /* ----------------------------------------- */ /* prototypes normally declared in stdlib.h */ @@ -22,7 +23,7 @@ typedef unsigned long OCS_size_t; extern void OCS_exit (int status); extern unsigned long int OCS_strtoul (const char * nptr, char ** endptr, int base); extern int OCS_system (const char * command); -extern void *OCS_malloc(OCS_size_t sz); +extern void *OCS_malloc(size_t sz); extern void OCS_free(void *ptr); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/string.h b/src/unit-test-coverage/ut-stubs/inc/OCS_string.h similarity index 67% rename from src/unit-test-coverage/ut-stubs/inc/overrides/string.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_string.h index 1615a71c4..a3d60bd7a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/string.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_string.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_STRING_H_ #define _OSAL_STUB_STRING_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in string.h */ /* ----------------------------------------- */ @@ -9,23 +11,22 @@ /* ----------------------------------------- */ /* types normally defined in string.h */ /* ----------------------------------------- */ -typedef unsigned long OCS_size_t; /* ----------------------------------------- */ /* prototypes normally declared in string.h */ /* ----------------------------------------- */ -extern void *OCS_memcpy (void * dest, const void * src, OCS_size_t n); -extern void *OCS_memset (void * s, int c, OCS_size_t n); +extern void *OCS_memcpy (void * dest, const void * src, size_t n); +extern void *OCS_memset (void * s, int c, size_t n); extern int OCS_strcmp (const char * s1, const char * s2); extern char *OCS_strcpy (char * dest, const char * src); -extern OCS_size_t OCS_strlen (const char * s); -extern int OCS_strncmp (const char * s1, const char * s2, OCS_size_t n); -extern char *OCS_strncpy (char * dest, const char * src, OCS_size_t n); +extern size_t OCS_strlen (const char * s); +extern int OCS_strncmp (const char * s1, const char * s2, size_t n); +extern char *OCS_strncpy (char * dest, const char * src, size_t n); extern char *OCS_strchr(const char *s, int c); extern char *OCS_strrchr (const char * s, int c); extern char *OCS_strcat(char *dest, const char *src); -extern char *OCS_strncat(char *dest, const char *src, OCS_size_t n); +extern char *OCS_strncat(char *dest, const char *src, size_t n); extern char *OCS_strerror(int errnum); #endif /* _OSAL_STUB_STRING_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/strings.h b/src/unit-test-coverage/ut-stubs/inc/OCS_strings.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/strings.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_strings.h index 5af9a141c..719d67607 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/strings.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_strings.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_STRINGS_H_ #define _OSAL_STUB_STRINGS_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in strings.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/OCS_symLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_symLib.h new file mode 100644 index 000000000..7dbaf15b4 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_symLib.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for symLib.h */ +#ifndef _OSAL_STUB_SYMLIB_H_ +#define _OSAL_STUB_SYMLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* constants normally defined in symLib.h */ +/* ----------------------------------------- */ +#define OCS_LOAD_ALL_SYMBOLS 0x1A00 + +/* ----------------------------------------- */ +/* types normally defined in symLib.h */ +/* ----------------------------------------- */ +typedef int OCS_SYM_TYPE; + + +typedef struct OCS_SYMBOL OCS_SYMBOL; +typedef struct OCS_SYMTAB OCS_SYMTAB; + + +typedef OCS_SYMTAB * OCS_SYMTAB_ID; +typedef OCS_SYMBOL * OCS_SYMBOL_ID; + +/* ----------------------------------------- */ +/* prototypes normally declared in symLib.h */ +/* ----------------------------------------- */ + +extern OCS_SYMTAB_ID OCS_sysSymTbl; + + +extern OCS_STATUS OCS_symFindByName(OCS_SYMTAB_ID symTblId, char * name, char ** pValue, OCS_SYM_TYPE * pType); +extern OCS_SYMBOL * OCS_symEach(OCS_SYMTAB_ID symTblId, OCS_FUNCPTR routine, int routineArg); + + +#endif /* _OSAL_STUB_SYMLIB_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sysLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sysLib.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sysLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sysLib.h index b1a863770..483cbe34a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sysLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sysLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SYSLIB_H_ #define _OSAL_STUB_SYSLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in sysLib.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/ioctl.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_ioctl.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/ioctl.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_ioctl.h index b4400a3c6..9ab002dbd 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/ioctl.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_ioctl.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SYS_IOCTL_H_ #define _OSAL_STUB_SYS_IOCTL_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/ioctl.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/ipc.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_ipc.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/ipc.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_ipc.h index 10c38a118..7070afa00 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/ipc.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_ipc.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SYS_IPC_H_ #define _OSAL_STUB_SYS_IPC_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/ipc.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/mman.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_mman.h similarity index 57% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/mman.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_mman.h index c99e9f3a3..47dc640b0 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/mman.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_mman.h @@ -2,9 +2,18 @@ #ifndef _OSAL_STUB_SYS_MMAN_H_ #define _OSAL_STUB_SYS_MMAN_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/mman.h */ /* ----------------------------------------- */ +#define OCS_MAP_SHARED 0x2001 +#define OCS_MAP_PRIVATE 0x2002 +#define OCS_PROT_EXEC 0x2004 +#define OCS_PROT_READ 0x2008 +#define OCS_PROT_WRITE 0x2010 +#define OCS_PROT_NONE 0x2020 +#define OCS_MAP_FIXED 0x2080 /* ----------------------------------------- */ /* types normally defined in sys/mman.h */ @@ -13,7 +22,9 @@ /* ----------------------------------------- */ /* prototypes normally declared in sys/mman.h */ /* ----------------------------------------- */ - +void *OCS_mmap(void *addr, size_t length, int prot, int flags, + int fd, OCS_off_t offset); +int OCS_munmap(void *addr, size_t length); #endif /* _OSAL_STUB_SYS_MMAN_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/select.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_select.h similarity index 90% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/select.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_select.h index d04407327..88379430d 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/select.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_select.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SYS_SELECT_H_ #define _OSAL_STUB_SYS_SELECT_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/select.h */ /* ----------------------------------------- */ @@ -9,6 +11,7 @@ /* ----------------------------------------- */ /* types normally defined in sys/select.h */ /* ----------------------------------------- */ +typedef struct { unsigned int fds; } OCS_fd_set; /* ----------------------------------------- */ /* prototypes normally declared in sys/select.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/socket.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_socket.h similarity index 75% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/socket.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_socket.h index 6ce73b098..22f527a95 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/socket.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_socket.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SYS_SOCKET_H_ #define _OSAL_STUB_SYS_SOCKET_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in sys/socket.h */ /* ----------------------------------------- */ @@ -9,9 +12,7 @@ /* ----------------------------------------- */ /* types normally defined in sys/socket.h */ /* ----------------------------------------- */ -typedef unsigned long OCS_size_t; -typedef unsigned long OCS_socklen_t; -typedef long OCS_ssize_t; +typedef size_t OCS_socklen_t; struct OCS_sockaddr { @@ -27,8 +28,8 @@ extern int OCS_bind (int fd, const struct OCS_sockaddr * addr, OCS_socklen_t len extern int OCS_connect (int fd, const struct OCS_sockaddr * addr, OCS_socklen_t len); extern int OCS_getsockopt (int fd, int level, int optname, void * optval, OCS_socklen_t * optlen); extern int OCS_listen (int fd, int n); -extern OCS_ssize_t OCS_recvfrom (int fd, void * buf, OCS_size_t n, int flags, struct OCS_sockaddr * addr, OCS_socklen_t * addr_len); -extern OCS_ssize_t OCS_sendto (int fd, const void * buf, OCS_size_t n, int flags, const struct OCS_sockaddr * addr, OCS_socklen_t addr_len); +extern OCS_ssize_t OCS_recvfrom (int fd, void * buf, size_t n, int flags, struct OCS_sockaddr * addr, OCS_socklen_t * addr_len); +extern OCS_ssize_t OCS_sendto (int fd, const void * buf, size_t n, int flags, const struct OCS_sockaddr * addr, OCS_socklen_t addr_len); extern int OCS_setsockopt (int fd, int level, int optname, const void * optval, OCS_socklen_t optlen); extern int OCS_socket (int domain, int type, int protocol); diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/time.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_time.h similarity index 92% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/time.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_time.h index 91c26e05d..4ea9374a6 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/time.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_time.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SYS_TIME_H_ #define _OSAL_STUB_SYS_TIME_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in sys/time.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/times.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_times.h similarity index 92% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/times.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_times.h index 852706f75..aa54befcc 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/times.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_times.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_SYS_TIMES_H_ #define _OSAL_STUB_SYS_TIMES_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in sys/times.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/types.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_types.h similarity index 68% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/types.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_types.h index 35a769107..34758704a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/types.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_types.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SYS_TYPES_H_ #define _OSAL_STUB_SYS_TYPES_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/types.h */ /* ----------------------------------------- */ @@ -9,6 +11,13 @@ /* ----------------------------------------- */ /* types normally defined in sys/types.h */ /* ----------------------------------------- */ +typedef ptrdiff_t OCS_ssize_t; +typedef size_t OCS_off_t; +typedef unsigned int OCS_mode_t; +typedef long OCS_time_t; +typedef int OCS_pid_t; +typedef int OCS_gid_t; +typedef int OCS_uid_t; /* ----------------------------------------- */ /* prototypes normally declared in sys/types.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/un.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_un.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/un.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_un.h index 223de0a20..83ab65a7b 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/un.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_un.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SYS_UN_H_ #define _OSAL_STUB_SYS_UN_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/un.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/wait.h b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_wait.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/sys/wait.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_sys_wait.h index 65b237f09..c66423947 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/wait.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_sys_wait.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_SYS_WAIT_H_ #define _OSAL_STUB_SYS_WAIT_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in sys/wait.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/taskLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_taskLib.h similarity index 96% rename from src/unit-test-coverage/ut-stubs/inc/overrides/taskLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_taskLib.h index 8316252f4..46908a130 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/taskLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_taskLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_TASKLIB_H_ #define _OSAL_STUB_TASKLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in taskLib.h */ /* ----------------------------------------- */ @@ -11,21 +14,19 @@ /* ----------------------------------------- */ /* types normally defined in taskLib.h */ /* ----------------------------------------- */ -typedef void* OCS_TASK_ID; -typedef int OCS_BOOL; -typedef int OCS_STATUS; -typedef int (*OCS_FUNCPTR)(); - typedef struct OCS_WIND_TCB { int data; } OCS_WIND_TCB; +typedef struct OCS_WIND_TCB* OCS_TASK_ID; + typedef struct OCS_TASK_DESC { OCS_TASK_ID tid; } OCS_TASK_DESC; + /* ----------------------------------------- */ /* prototypes normally declared in taskInfo.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/taskVarLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_taskVarLib.h similarity index 92% rename from src/unit-test-coverage/ut-stubs/inc/overrides/taskVarLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_taskVarLib.h index fd2a43b4e..435c648d3 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/taskVarLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_taskVarLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_TASKVARLIB_H_ #define _OSAL_STUB_TASKVARLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in taskVarLib.h */ /* ----------------------------------------- */ @@ -9,7 +12,6 @@ /* ----------------------------------------- */ /* types normally defined in taskVarLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; /* ----------------------------------------- */ /* prototypes normally declared in taskVarLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/termios.h b/src/unit-test-coverage/ut-stubs/inc/OCS_termios.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/termios.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_termios.h index 793640bb5..e4dc37983 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/termios.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_termios.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_TERMIOS_H_ #define _OSAL_STUB_TERMIOS_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in termios.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/tgmath.h b/src/unit-test-coverage/ut-stubs/inc/OCS_tgmath.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/tgmath.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_tgmath.h index 2c12a2e76..53f071511 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/tgmath.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_tgmath.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_TGMATH_H_ #define _OSAL_STUB_TGMATH_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in tgmath.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/time.h b/src/unit-test-coverage/ut-stubs/inc/OCS_time.h similarity index 79% rename from src/unit-test-coverage/ut-stubs/inc/overrides/time.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_time.h index 118fc8962..cf26bda37 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/time.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_time.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_TIME_H_ #define _OSAL_STUB_TIME_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in time.h */ /* ----------------------------------------- */ @@ -16,23 +19,29 @@ typedef int OCS_clockid_t; typedef int OCS_timer_t; -typedef long OCS_time_t; +typedef long OCS_suseconds_t; struct OCS_timespec { - long tv_sec; + OCS_time_t tv_sec; long tv_nsec; }; +struct OCS_timeval +{ + OCS_time_t tv_sec; + OCS_suseconds_t tv_usec; +}; + + struct OCS_itimerspec { struct OCS_timespec it_interval; struct OCS_timespec it_value; }; -struct OCS_sigevent; - -typedef void (*OCS_VOIDFUNCPTR)(void); +/* The TIMER_CONNECT_FUNC is a VxWorks extension for the timer_connect() API */ +typedef void (*OCS_TIMER_CONNECT_FUNC)(OCS_timer_t, int arg); /* ----------------------------------------- */ /* prototypes normally declared in time.h */ @@ -47,7 +56,7 @@ extern int OCS_timer_delete (OCS_timer_t timerid) ; extern int OCS_timer_gettime (OCS_timer_t timerid, struct OCS_itimerspec * value); extern int OCS_timer_settime (OCS_timer_t timerid, int flags, const struct OCS_itimerspec * value, struct OCS_itimerspec * ovalue); -extern int OCS_timer_connect(OCS_timer_t, OCS_VOIDFUNCPTR, int); +extern int OCS_timer_connect(OCS_timer_t timerid, OCS_TIMER_CONNECT_FUNC func, int arg); #endif /* _OSAL_STUB_TIME_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/timers.h b/src/unit-test-coverage/ut-stubs/inc/OCS_timers.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/timers.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_timers.h index 78ca96f07..3f47d67c1 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/timers.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_timers.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_TIMERS_H_ #define _OSAL_STUB_TIMERS_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in timers.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/ulimit.h b/src/unit-test-coverage/ut-stubs/inc/OCS_ulimit.h similarity index 89% rename from src/unit-test-coverage/ut-stubs/inc/overrides/ulimit.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_ulimit.h index f7c9339d9..f319d5b72 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/ulimit.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_ulimit.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_ULIMIT_H_ #define _OSAL_STUB_ULIMIT_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in ulimit.h */ /* ----------------------------------------- */ @@ -13,7 +15,7 @@ /* ----------------------------------------- */ /* prototypes normally declared in ulimit.h */ /* ----------------------------------------- */ - +long OCS_ulimit(int cmd, long newlimit); #endif /* _OSAL_STUB_ULIMIT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/unistd.h b/src/unit-test-coverage/ut-stubs/inc/OCS_unistd.h similarity index 69% rename from src/unit-test-coverage/ut-stubs/inc/overrides/unistd.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_unistd.h index a5e32a674..4b617a1b9 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/unistd.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_unistd.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_UNISTD_H_ #define _OSAL_STUB_UNISTD_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in unistd.h */ /* ----------------------------------------- */ @@ -9,18 +12,14 @@ #define OCS_SEEK_SET 0x1C01 #define OCS_SEEK_CUR 0x1C02 #define OCS_SEEK_END 0x1C03 -#define OCS_STDOUT_FILENO 0x1C04 +#define OCS_STDIN_FILENO 0x1C04 +#define OCS_STDOUT_FILENO 0x1C05 +#define OCS_STDERR_FILENO 0x1C06 /* ----------------------------------------- */ /* types normally defined in unistd.h */ /* ----------------------------------------- */ -typedef int OCS_gid_t; -typedef int OCS_uid_t; -typedef int OCS_pid_t; -typedef long OCS_ssize_t; -typedef long OCS_off_t; -typedef unsigned long OCS_size_t; /* ----------------------------------------- */ /* prototypes normally declared in unistd.h */ @@ -30,13 +29,13 @@ extern int OCS_close (int fd); extern OCS_gid_t OCS_getegid (void); extern OCS_uid_t OCS_geteuid (void); extern long int OCS_gethostid (void); -extern int OCS_gethostname (char * name, OCS_size_t len); +extern int OCS_gethostname (char * name, size_t len); extern OCS_pid_t OCS_getpid (void); extern OCS_off_t OCS_lseek (int fd, OCS_off_t offset, int whence); -extern OCS_ssize_t OCS_read (int fd, void * buf, OCS_size_t nbytes); +extern OCS_ssize_t OCS_read (int fd, void * buf, size_t nbytes); extern int OCS_rmdir (const char * path); extern long int OCS_sysconf (int name); -extern OCS_ssize_t OCS_write (int fd, const void * buf, OCS_size_t n); +extern OCS_ssize_t OCS_write (int fd, const void * buf, size_t n); #endif /* _OSAL_STUB_UNISTD_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/unldLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_unldLib.h similarity index 89% rename from src/unit-test-coverage/ut-stubs/inc/overrides/unldLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_unldLib.h index f03d58e8b..a682fa133 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/unldLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_unldLib.h @@ -2,6 +2,10 @@ #ifndef _OSAL_STUB_UNLDLIB_H_ #define _OSAL_STUB_UNLDLIB_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in unldLib.h */ /* ----------------------------------------- */ @@ -9,8 +13,6 @@ /* ----------------------------------------- */ /* types normally defined in unldLib.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef void* OCS_MODULE_ID; /* ----------------------------------------- */ /* prototypes normally declared in unldLib.h */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/usrLib.h b/src/unit-test-coverage/ut-stubs/inc/OCS_usrLib.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/usrLib.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_usrLib.h index 19f7a1832..6e95bed79 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/usrLib.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_usrLib.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_USRLIB_H_ #define _OSAL_STUB_USRLIB_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in usrLib.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/version.h b/src/unit-test-coverage/ut-stubs/inc/OCS_version.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/version.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_version.h index ce5d1ef19..4b5cc782a 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/version.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_version.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_VERSION_H_ #define _OSAL_STUB_VERSION_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in version.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/OCS_vxWorks.h b/src/unit-test-coverage/ut-stubs/inc/OCS_vxWorks.h new file mode 100644 index 000000000..c05782245 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_vxWorks.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for vxWorks.h */ +#ifndef _OSAL_STUB_VXWORKS_H_ +#define _OSAL_STUB_VXWORKS_H_ + +#include + +/* ----------------------------------------- */ +/* constants normally defined in vxWorks.h */ +/* ----------------------------------------- */ +enum +{ + OCS_ERROR = -1, + OCS_OK = 0 +}; + +enum +{ + OCS_WAIT_FOREVER = -1, + OCS_NO_WAIT = 0 +}; + + + +/* ----------------------------------------- */ +/* types normally defined in vxWorks.h */ +/* ----------------------------------------- */ +typedef int OCS_STATUS; +typedef bool OCS_BOOL; +typedef unsigned int OCS_UINT; +typedef int8_t OCS_INT8; +typedef uint8_t OCS_UINT8; +typedef int16_t OCS_INT16; +typedef uint16_t OCS_UINT16; +typedef int32_t OCS_INT32; +typedef uint32_t OCS_UINT32; + +/* Function pointers are used in many VxWorks modules. */ +/* + * NOTE: The FUNCPTR type in the actual library may be defined + * without arguments, e.g. "int (*FUNCPTR)()". This is acceptable + * by some compilers but generally incompatible with the + * "-Wstrict-prototype" gcc warning option. So in this override it + * is defined as a int argument. This means that application code + * may need to cast it at the time of use (which is generally done anyway). + */ +typedef int (*OCS_FUNCPTR)(int); +typedef void (*OCS_VOIDFUNCPTR)(void); + + +/* ----------------------------------------- */ +/* prototypes normally declared in vxWorks.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_STUB_VXWORKS_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/wchar.h b/src/unit-test-coverage/ut-stubs/inc/OCS_wchar.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/wchar.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_wchar.h index 5308a1815..19188728e 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/wchar.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_wchar.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_WCHAR_H_ #define _OSAL_STUB_WCHAR_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in wchar.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/wctype.h b/src/unit-test-coverage/ut-stubs/inc/OCS_wctype.h similarity index 95% rename from src/unit-test-coverage/ut-stubs/inc/overrides/wctype.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_wctype.h index 34178d8f9..1555c0f72 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/wctype.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_wctype.h @@ -2,6 +2,8 @@ #ifndef _OSAL_STUB_WCTYPE_H_ #define _OSAL_STUB_WCTYPE_H_ +#include + /* ----------------------------------------- */ /* constants normally defined in wctype.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/xbdBlkDev.h b/src/unit-test-coverage/ut-stubs/inc/OCS_xbdBlkDev.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/xbdBlkDev.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_xbdBlkDev.h index abcd87769..f7c7a9c84 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/xbdBlkDev.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_xbdBlkDev.h @@ -2,17 +2,18 @@ #ifndef _OSAL_STUB_XBDBLKDEV_H_ #define _OSAL_STUB_XBDBLKDEV_H_ +#include +#include +#include + /* ----------------------------------------- */ /* constants normally defined in xbdBlkDev.h */ /* ----------------------------------------- */ - #define OCS_NULLDEV ((OCS_device_t)0) /* ----------------------------------------- */ /* types normally defined in xbdBlkDev.h */ /* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef int OCS_BLK_DEV; typedef int OCS_device_t; /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/xbdRamDisk.h b/src/unit-test-coverage/ut-stubs/inc/OCS_xbdRamDisk.h similarity index 91% rename from src/unit-test-coverage/ut-stubs/inc/overrides/xbdRamDisk.h rename to src/unit-test-coverage/ut-stubs/inc/OCS_xbdRamDisk.h index 14795a2a6..2ec152d58 100644 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/xbdRamDisk.h +++ b/src/unit-test-coverage/ut-stubs/inc/OCS_xbdRamDisk.h @@ -2,6 +2,9 @@ #ifndef _OSAL_STUB_XBDRAMDISK_H_ #define _OSAL_STUB_XBDRAMDISK_H_ +#include +#include + /* ----------------------------------------- */ /* constants normally defined in xbdRamDisk.h */ /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/iv.h b/src/unit-test-coverage/ut-stubs/inc/overrides/iv.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/stat.h b/src/unit-test-coverage/ut-stubs/inc/overrides/stat.h deleted file mode 100644 index f5c36ad21..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/stat.h +++ /dev/null @@ -1,10 +0,0 @@ -/* OSAL coverage stub replacement for stat.h */ -#ifndef _OSAL_STUB_STAT_H_ -#define _OSAL_STUB_STAT_H_ - -#include -#include - - -#endif /* _OSAL_STUB_STAT_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/symLib.h b/src/unit-test-coverage/ut-stubs/inc/overrides/symLib.h deleted file mode 100644 index 6d1d1a958..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/symLib.h +++ /dev/null @@ -1,67 +0,0 @@ -/* OSAL coverage stub replacement for symLib.h */ -#ifndef _OSAL_STUB_SYMLIB_H_ -#define _OSAL_STUB_SYMLIB_H_ - -/* ----------------------------------------- */ -/* constants normally defined in symLib.h */ -/* ----------------------------------------- */ -#define OCS_LOAD_ALL_SYMBOLS 0x1A00 - -/* ----------------------------------------- */ -/* types normally defined in symLib.h */ -/* ----------------------------------------- */ -typedef int OCS_STATUS; -typedef int OCS_SYM_TYPE; -typedef int (*OCS_FUNCPTR)(); - - -#ifdef jphfix // determine if these are needed -typedef struct OCS_symbol /* SYMBOL - entry in symbol table */ -{ - int nameHNode; /* hash node (must come first) */ - char *name; /* pointer to symbol name */ - void *value; /* symbol value */ - int symRef; /* moduleId of module, or predefined SYMREF. */ - int group; /* symbol group */ - int type; /* symbol type */ -} OCS_SYMBOL; - -typedef struct OCS_symtab /* SYMTAB - symbol table */ -{ - int handle; /* object maintanance */ - int nameHashId; /* hash table for names */ - int symMutex; /* symbol table mutual exclusion sem */ - int symPartId; /* memory partition id for symbols */ - unsigned char sameNameOk; /* symbol table name clash policy */ - int nsymbols; /* current number of symbols in table */ -} OCS_SYMTAB; - -#else -typedef void OCS_SYMTAB; -typedef void OCS_SYMBOL; -#endif - - -typedef OCS_SYMTAB * OCS_SYMTAB_ID; -typedef OCS_SYMBOL * OCS_SYMBOL_ID; - -/* - * The "BOOL" and "UINT16" types are indirectly part of the symEach() API - */ -typedef int OCS_BOOL; -typedef unsigned short OCS_UINT16; - - -/* ----------------------------------------- */ -/* prototypes normally declared in symLib.h */ -/* ----------------------------------------- */ - -extern OCS_SYMTAB_ID OCS_sysSymTbl; - - -extern OCS_STATUS OCS_symFindByName(OCS_SYMTAB_ID symTblId, char * name, char ** pValue, OCS_SYM_TYPE * pType); -extern OCS_SYMBOL * OCS_symEach(OCS_SYMTAB_ID symTblId, OCS_FUNCPTR routine, int routineArg); - - -#endif /* _OSAL_STUB_SYMLIB_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/stat.h b/src/unit-test-coverage/ut-stubs/inc/overrides/sys/stat.h deleted file mode 100644 index 60ddcb1bc..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/stat.h +++ /dev/null @@ -1,39 +0,0 @@ -/* OSAL coverage stub replacement for sys/stat.h */ -#ifndef _OSAL_STUB_SYS_STAT_H_ -#define _OSAL_STUB_SYS_STAT_H_ - -/* ----------------------------------------- */ -/* constants normally defined in sys/stat.h */ -/* ----------------------------------------- */ - -/* note these constants also exist in fcntl.h */ -#include "utbits/filemodes.h" - - -/* ----------------------------------------- */ -/* types normally defined in sys/stat.h */ -/* ----------------------------------------- */ -typedef unsigned int OCS_mode_t; - -struct OCS_stat -{ - unsigned int st_mode; - unsigned int st_size; - unsigned int st_mtime; - unsigned int st_uid; - unsigned int st_gid; -}; - -/* ----------------------------------------- */ -/* prototypes normally declared in sys/stat.h */ -/* ----------------------------------------- */ - -extern int OCS_fchmod (int fd, OCS_mode_t mode); -extern int OCS_chmod (const char *path, OCS_mode_t mode); -extern int OCS_mkdir (const char * path, OCS_mode_t mode); -extern int OCS_stat (const char * file, struct OCS_stat * buf); - - - -#endif /* _OSAL_STUB_SYS_STAT_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/statvfs.h b/src/unit-test-coverage/ut-stubs/inc/overrides/sys/statvfs.h deleted file mode 100644 index 896d18fa5..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/sys/statvfs.h +++ /dev/null @@ -1,27 +0,0 @@ -/* OSAL coverage stub replacement for sys/statvfs.h */ -#ifndef _OSAL_STUB_SYS_STATVFS_H_ -#define _OSAL_STUB_SYS_STATVFS_H_ - -/* ----------------------------------------- */ -/* constants normally defined in sys/statvfs.h */ -/* ----------------------------------------- */ - -/* ----------------------------------------- */ -/* types normally defined in sys/statvfs.h */ -/* ----------------------------------------- */ -struct OCS_statvfs -{ - long f_bsize; - long f_bfree; - long f_blocks; -}; - -/* ----------------------------------------- */ -/* prototypes normally declared in sys/statvfs.h */ -/* ----------------------------------------- */ - -extern int OCS_statvfs (const char * file, struct OCS_statvfs * buf); - - -#endif /* _OSAL_STUB_SYS_STATVFS_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/inc/overrides/vxWorks.h b/src/unit-test-coverage/ut-stubs/inc/overrides/vxWorks.h deleted file mode 100644 index b5b85a0a2..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/overrides/vxWorks.h +++ /dev/null @@ -1,42 +0,0 @@ -/* OSAL coverage stub replacement for vxWorks.h */ -#ifndef _OSAL_STUB_VXWORKS_H_ -#define _OSAL_STUB_VXWORKS_H_ - -/* ----------------------------------------- */ -/* constants normally defined in vxWorks.h */ -/* ----------------------------------------- */ -enum -{ - OCS_ERROR = -1, - OCS_OK = 0 -}; - -enum -{ - OCS_WAIT_FOREVER = -1, - OCS_NO_WAIT = 0 -}; - -/* Fixme: these don't all normally come from vxworks.h, just - * being held here for now. - */ - - -#define OCS_NULLDEV 0 -#define OCS_FIOUNMOUNT 39 /* unmount disk volume */ -#define OCS_FIOCHKDSK 48 - - - -/* ----------------------------------------- */ -/* types normally defined in vxWorks.h */ -/* ----------------------------------------- */ - -/* ----------------------------------------- */ -/* prototypes normally declared in vxWorks.h */ -/* ----------------------------------------- */ - - - -#endif /* _OSAL_STUB_VXWORKS_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/inc/utbits/filemodes.h b/src/unit-test-coverage/ut-stubs/inc/utbits/filemodes.h deleted file mode 100644 index f9039be53..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/utbits/filemodes.h +++ /dev/null @@ -1,33 +0,0 @@ -/* OSAL coverage stub replacement for file mode bits - * this file is shared by several UT replacement headers */ -#ifndef _OSAL_STUB_UTBITS_FILEMODES_H_ -#define _OSAL_STUB_UTBITS_FILEMODES_H_ - -/* - * note these constants are used as bitmasks and so - * they must be single bit flags to work properly. - * - * However, they are defined differently from a typical UNIX - * in order to increase the likelihood that a hard-coded value - * is caught by UT. - * - * These are exposed to apps through fcntl.h and sys/stat.h - */ -#define OCS_S_IXOTH 0x1000 -#define OCS_S_IXGRP 0x2000 -#define OCS_S_IXUSR 0x4000 - -#define OCS_S_IROTH 0x0100 -#define OCS_S_IRGRP 0x0200 -#define OCS_S_IRUSR 0x0400 - -#define OCS_S_IWOTH 0x0010 -#define OCS_S_IWGRP 0x0020 -#define OCS_S_IWUSR 0x0040 - -#define OCS_S_IFDIR 0x0001 -#define OCS_S_ISDIR(x) (((x) & OCS_S_IFDIR) == OCS_S_IFDIR) - - -#endif /* _OSAL_STUB_UTBITS_FILEMODES_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/inc/utbits/vxwaitflags.h b/src/unit-test-coverage/ut-stubs/inc/utbits/vxwaitflags.h deleted file mode 100644 index 5334ec5c4..000000000 --- a/src/unit-test-coverage/ut-stubs/inc/utbits/vxwaitflags.h +++ /dev/null @@ -1,11 +0,0 @@ -/* OSAL coverage stub replacement for vxWorks wait/timeout flags - * this file is shared by several VxWorks UT replacement headers */ -#ifndef _OSAL_STUB_UTBITS_VXWAITFLAGS_H_ -#define _OSAL_STUB_UTBITS_VXWAITFLAGS_H_ - -#define OCS_WAIT_FOREVER 0x1F01 -#define OCS_NO_WAIT 0x1F02 - - -#endif /* _OSAL_STUB_UTBITS_VXWAITFLAGS_H_ */ - diff --git a/src/unit-test-coverage/ut-stubs/override_inc/arpa/inet.h b/src/unit-test-coverage/ut-stubs/override_inc/arpa/inet.h new file mode 100644 index 000000000..a4894b428 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/arpa/inet.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for arpa/inet.h */ +#ifndef _OSAL_OVERRIDE_ARPA_INET_H_ +#define _OSAL_OVERRIDE_ARPA_INET_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in arpa/inet.h */ +/* ----------------------------------------- */ +#define inet_ntop OCS_inet_ntop +#define inet_pton OCS_inet_pton + + +#endif /* _OSAL_OVERRIDE_ARPA_INET_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/assert.h b/src/unit-test-coverage/ut-stubs/override_inc/assert.h new file mode 100644 index 000000000..c7c94d454 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/assert.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for assert.h */ +#ifndef _OSAL_OVERRIDE_ASSERT_H_ +#define _OSAL_OVERRIDE_ASSERT_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in assert.h */ +/* ----------------------------------------- */ + +#define assert OCS_assert + +#endif /* _OSAL_OVERRIDE_ASSERT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/blkIo.h b/src/unit-test-coverage/ut-stubs/override_inc/blkIo.h new file mode 100644 index 000000000..36b971bb3 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/blkIo.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for blkIo.h */ +#ifndef _OSAL_OVERRIDE_BLKIO_H_ +#define _OSAL_OVERRIDE_BLKIO_H_ + +#include +#include + +/* ---------------------------------------*/ +/* mappings for declarations in blkIo.h */ +/* ---------------------------------------*/ +#define NULLDEV OCS_NULLDEV +#define BLK_DEV OCS_BLK_DEV +#define BLK_DEV_ID OCS_BLK_DEV_ID + + +#endif /* _OSAL_OVERRIDE_BLKIO_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/cbioLib.h b/src/unit-test-coverage/ut-stubs/override_inc/cbioLib.h new file mode 100644 index 000000000..23c706bb9 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/cbioLib.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for cbioLib.h */ +#ifndef _OSAL_OVERRIDE_CBIOLIB_H_ +#define _OSAL_OVERRIDE_CBIOLIB_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in cbioLib.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_CBIOLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/complex.h b/src/unit-test-coverage/ut-stubs/override_inc/complex.h new file mode 100644 index 000000000..43d8f031c --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/complex.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for complex.h */ +#ifndef _OSAL_OVERRIDE_COMPLEX_H_ +#define _OSAL_OVERRIDE_COMPLEX_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in complex.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_COMPLEX_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/ctype.h b/src/unit-test-coverage/ut-stubs/override_inc/ctype.h new file mode 100644 index 000000000..9b4672c4d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/ctype.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for ctype.h */ +#ifndef _OSAL_OVERRIDE_CTYPE_H_ +#define _OSAL_OVERRIDE_CTYPE_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in ctype.h */ +/* ----------------------------------------- */ + +#define isgraph OCS_isgraph + +#endif /* _OSAL_OVERRIDE_CTYPE_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/dirent.h b/src/unit-test-coverage/ut-stubs/override_inc/dirent.h new file mode 100644 index 000000000..3cda5ea30 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/dirent.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for dirent.h */ +#ifndef _OSAL_OVERRIDE_DIRENT_H_ +#define _OSAL_OVERRIDE_DIRENT_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in dirent.h */ +/* ----------------------------------------- */ + +#define DIR OCS_DIR +#define dirent OCS_dirent +#define closedir OCS_closedir +#define opendir OCS_opendir +#define readdir OCS_readdir +#define rewinddir OCS_rewinddir + +#endif /* _OSAL_OVERRIDE_DIRENT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/dlfcn.h b/src/unit-test-coverage/ut-stubs/override_inc/dlfcn.h new file mode 100644 index 000000000..b9d6120f0 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/dlfcn.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for dlfcn.h */ +#ifndef _OSAL_OVERRIDE_DLFCN_H_ +#define _OSAL_OVERRIDE_DLFCN_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in dlfcn.h */ +/* ----------------------------------------- */ + +#define dlclose OCS_dlclose +#define dlerror OCS_dlerror +#define dlopen OCS_dlopen +#define dlsym OCS_dlsym + + +#endif /* _OSAL_OVERRIDE_DLFCN_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/dosFsLib.h b/src/unit-test-coverage/ut-stubs/override_inc/dosFsLib.h new file mode 100644 index 000000000..3385ae14e --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/dosFsLib.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for dosFsLib.h */ +#ifndef _OSAL_OVERRIDE_DOSFSLIB_H_ +#define _OSAL_OVERRIDE_DOSFSLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in dosFsLib.h */ +/* ----------------------------------------- */ +#define DOS_CHK_ONLY OCS_DOS_CHK_ONLY +#define DOS_CHK_REPAIR OCS_DOS_CHK_REPAIR +#define DOS_CHK_VERB_0 OCS_DOS_CHK_VERB_0 +#define DOS_CHK_VERB_SILENT OCS_DOS_CHK_VERB_SILENT +#define DOS_OPT_BLANK OCS_DOS_OPT_BLANK + +#define dosFsVolFormat OCS_dosFsVolFormat + + + +#endif /* _OSAL_OVERRIDE_DOSFSLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/drv/hdisk/ataDrv.h b/src/unit-test-coverage/ut-stubs/override_inc/drv/hdisk/ataDrv.h new file mode 100644 index 000000000..fefdb37fd --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/drv/hdisk/ataDrv.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for drv/hdisk/ataDrv.h */ +#ifndef _OSAL_OVERRIDE_DRV_HDISK_ATADRV_H_ +#define _OSAL_OVERRIDE_DRV_HDISK_ATADRV_H_ + +#include +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in drv/hdisk/ataDrv.h */ +/* ----------------------------------------- */ +#define ataDevCreate OCS_ataDevCreate + + + +#endif /* _OSAL_OVERRIDE_DRV_HDISK_ATADRV_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/errno.h b/src/unit-test-coverage/ut-stubs/override_inc/errno.h new file mode 100644 index 000000000..a7bae704a --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/errno.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for errno.h */ +#ifndef _OSAL_OVERRIDE_ERRNO_H_ +#define _OSAL_OVERRIDE_ERRNO_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in errno.h */ +/* ----------------------------------------- */ +#define EINTR OCS_EINTR +#define EAGAIN OCS_EAGAIN +#define EINVAL OCS_EINVAL +#define EMSGSIZE OCS_EMSGSIZE +#define ETIMEDOUT OCS_ETIMEDOUT +#define ESPIPE OCS_ESPIPE + +#define errno OCS_errno + +#endif /* _OSAL_OVERRIDE_ERRNO_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/errnoLib.h b/src/unit-test-coverage/ut-stubs/override_inc/errnoLib.h new file mode 100644 index 000000000..c3bc41bdf --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/errnoLib.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for errnoLib.h */ +#ifndef _OSAL_OVERRIDE_ERRNOLIB_H_ +#define _OSAL_OVERRIDE_ERRNOLIB_H_ + +#include +#include + + +/* ----------------------------------------- */ +/* mappings for declarations in errnoLib.h */ +/* ----------------------------------------- */ +#define errnoGet OCS_errnoGet + + +#endif /* _OSAL_OVERRIDE_ERRNOLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/fcntl.h b/src/unit-test-coverage/ut-stubs/override_inc/fcntl.h new file mode 100644 index 000000000..8c668fdc1 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/fcntl.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for fcntl.h */ +#ifndef _OSAL_OVERRIDE_FCNTL_H_ +#define _OSAL_OVERRIDE_FCNTL_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in fcntl.h */ +/* ----------------------------------------- */ +#define S_IXOTH OCS_S_IXOTH +#define S_IXGRP OCS_S_IXGRP +#define S_IXUSR OCS_S_IXUSR +#define S_IROTH OCS_S_IROTH +#define S_IRGRP OCS_S_IRGRP +#define S_IRUSR OCS_S_IRUSR +#define S_IWOTH OCS_S_IWOTH +#define S_IWGRP OCS_S_IWGRP +#define S_IWUSR OCS_S_IWUSR +#define S_IFDIR OCS_S_IFDIR +#define S_ISDIR(x) OCS_S_ISDIR(x) +#define O_RDONLY OCS_O_RDONLY +#define O_WRONLY OCS_O_WRONLY +#define O_RDWR OCS_O_RDWR +#define O_CREAT OCS_O_CREAT +#define O_TRUNC OCS_O_TRUNC +#define O_NONBLOCK OCS_O_NONBLOCK +#define F_GETFL OCS_F_GETFL +#define F_SETFL OCS_F_SETFL +#define F_GETFD OCS_F_GETFD +#define F_SETFD OCS_F_SETFD +#define F_DUPFD OCS_F_DUPFD + +#define fcntl OCS_fcntl +#define open OCS_open + + +#endif /* _OSAL_OVERRIDE_FCNTL_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/fenv.h b/src/unit-test-coverage/ut-stubs/override_inc/fenv.h new file mode 100644 index 000000000..db7bddf1f --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/fenv.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for fenv.h */ +#ifndef _OSAL_OVERRIDE_FENV_H_ +#define _OSAL_OVERRIDE_FENV_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in fenv.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_FENV_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/float.h b/src/unit-test-coverage/ut-stubs/override_inc/float.h new file mode 100644 index 000000000..2969db723 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/float.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for float.h */ +#ifndef _OSAL_OVERRIDE_FLOAT_H_ +#define _OSAL_OVERRIDE_FLOAT_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in float.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_FLOAT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/hostLib.h b/src/unit-test-coverage/ut-stubs/override_inc/hostLib.h new file mode 100644 index 000000000..ed34907e1 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/hostLib.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for hostLib.h */ +#ifndef _OSAL_OVERRIDE_HOSTLIB_H_ +#define _OSAL_OVERRIDE_HOSTLIB_H_ + +#include +#include + + +/* ----------------------------------------- */ +/* mappings for declarations in hostLib.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_HOSTLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/intLib.h b/src/unit-test-coverage/ut-stubs/override_inc/intLib.h new file mode 100644 index 000000000..635566ac4 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/intLib.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for intLib.h */ +#ifndef _OSAL_OVERRIDE_INTLIB_H_ +#define _OSAL_OVERRIDE_INTLIB_H_ + +#include +#include + + +/* ----------------------------------------- */ +/* mappings for declarations in intLib.h */ +/* ----------------------------------------- */ + + +#define intConnect OCS_intConnect +#define intDisable OCS_intDisable +#define intEnable OCS_intEnable +#define intLock OCS_intLock +#define intUnlock OCS_intUnlock +#define INUM_TO_IVEC OCS_INUM_TO_IVEC + +#endif /* _OSAL_OVERRIDE_INTLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/inttypes.h b/src/unit-test-coverage/ut-stubs/override_inc/inttypes.h new file mode 100644 index 000000000..26a43adea --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/inttypes.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for inttypes.h */ +#ifndef _OSAL_OVERRIDE_INTTYPES_H_ +#define _OSAL_OVERRIDE_INTTYPES_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in inttypes.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_INTTYPES_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/ioLib.h b/src/unit-test-coverage/ut-stubs/override_inc/ioLib.h new file mode 100644 index 000000000..1d227481c --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/ioLib.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for ioLib.h */ +#ifndef _OSAL_OVERRIDE_IOLIB_H_ +#define _OSAL_OVERRIDE_IOLIB_H_ + +#include +#include + + +/* ----------------------------------------- */ +/* mappings for declarations in ioLib.h */ +/* ----------------------------------------- */ + +#define FIOCHKDSK OCS_FIOCHKDSK +#define FIOUNMOUNT OCS_FIOUNMOUNT +#define ioctl OCS_ioctl + + +#endif /* _OSAL_OVERRIDE_IOLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/iv.h b/src/unit-test-coverage/ut-stubs/override_inc/iv.h new file mode 100644 index 000000000..f1c60ecf2 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/iv.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for iv.h */ +#ifndef _OSAL_OVERRIDE_IV_H_ +#define _OSAL_OVERRIDE_IV_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in iv.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_IV_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/loadLib.h b/src/unit-test-coverage/ut-stubs/override_inc/loadLib.h new file mode 100644 index 000000000..8748f8ad5 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/loadLib.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for loadLib.h */ +#ifndef _OSAL_OVERRIDE_LOADLIB_H_ +#define _OSAL_OVERRIDE_LOADLIB_H_ + +#include +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in loadLib.h */ +/* ----------------------------------------- */ + +#define loadModule OCS_loadModule + + +#endif /* _OSAL_OVERRIDE_LOADLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/locale.h b/src/unit-test-coverage/ut-stubs/override_inc/locale.h new file mode 100644 index 000000000..a6631944d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/locale.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for locale.h */ +#ifndef _OSAL_OVERRIDE_LOCALE_H_ +#define _OSAL_OVERRIDE_LOCALE_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in locale.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_LOCALE_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/logLib.h b/src/unit-test-coverage/ut-stubs/override_inc/logLib.h new file mode 100644 index 000000000..5355b8d81 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/logLib.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for logLib.h */ +#ifndef _OSAL_OVERRIDE_LOGLIB_H_ +#define _OSAL_OVERRIDE_LOGLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in logLib.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_LOGLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/math.h b/src/unit-test-coverage/ut-stubs/override_inc/math.h new file mode 100644 index 000000000..76c320aef --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/math.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for math.h */ +#ifndef _OSAL_OVERRIDE_MATH_H_ +#define _OSAL_OVERRIDE_MATH_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in math.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_MATH_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/memPartLib.h b/src/unit-test-coverage/ut-stubs/override_inc/memPartLib.h new file mode 100644 index 000000000..1da0e06a2 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/memPartLib.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for memPartLib.h */ +#ifndef _OSAL_OVERRIDE_MEMPARTLIB_H_ +#define _OSAL_OVERRIDE_MEMPARTLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in memPartLib.h */ +/* ----------------------------------------- */ +#define PART_ID OCS_PART_ID +#define MEM_PART_STATS OCS_MEM_PART_STATS + +#define memPartShow OCS_memPartShow +#define memPartInfoGet OCS_memPartInfoGet +#define memSysPartId OCS_memSysPartId + + +#endif /* _OSAL_OVERRIDE_MEMPARTLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/moduleLib.h b/src/unit-test-coverage/ut-stubs/override_inc/moduleLib.h new file mode 100644 index 000000000..ebd18e65b --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/moduleLib.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for moduleLib.h */ +#ifndef _OSAL_OVERRIDE_MODULELIB_H_ +#define _OSAL_OVERRIDE_MODULELIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in moduleLib.h */ +/* ----------------------------------------- */ + +#define MODULE_ID OCS_MODULE_ID +#define MODULE_INFO OCS_MODULE_INFO + +#define moduleInfoGet OCS_moduleInfoGet + + + +#endif /* _OSAL_OVERRIDE_MODULELIB_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/mqueue.h b/src/unit-test-coverage/ut-stubs/override_inc/mqueue.h new file mode 100644 index 000000000..f62a5d122 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/mqueue.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for mqueue.h */ +#ifndef _OSAL_OVERRIDE_MQUEUE_H_ +#define _OSAL_OVERRIDE_MQUEUE_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in mqueue.h */ +/* ----------------------------------------- */ + +#define mqd_t OCS_mqd_t +#define mq_attr OCS_mq_attr + +#define mq_close OCS_mq_close +#define mq_open OCS_mq_open +#define mq_receive OCS_mq_receive +#define mq_timedreceive OCS_mq_timedreceive +#define mq_timedsend OCS_mq_timedsend +#define mq_unlink OCS_mq_unlink + + +#endif /* _OSAL_OVERRIDE_MQUEUE_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/msgQLib.h b/src/unit-test-coverage/ut-stubs/override_inc/msgQLib.h new file mode 100644 index 000000000..f66bf8e48 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/msgQLib.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for msgQLib.h */ +#ifndef _OSAL_OVERRIDE_MSGQLIB_H_ +#define _OSAL_OVERRIDE_MSGQLIB_H_ + +#include +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in msgQLib.h */ +/* ----------------------------------------- */ +#define MSG_Q_FIFO OCS_MSG_Q_FIFO +#define MSG_Q_PRIORITY OCS_MSG_Q_PRIORITY +#define WIND_MSG_Q_OPTION_MASK OCS_WIND_MSG_Q_OPTION_MASK +#define MSG_PRI_NORMAL OCS_MSG_PRI_NORMAL +#define MSG_PRI_URGENT OCS_MSG_PRI_URGENT + +#define MSG_Q_ID OCS_MSG_Q_ID + +#define msgQCreate OCS_msgQCreate +#define msgQDelete OCS_msgQDelete +#define msgQReceive OCS_msgQReceive +#define msgQSend OCS_msgQSend + +#endif /* _OSAL_OVERRIDE_MSGQLIB_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/net/if.h b/src/unit-test-coverage/ut-stubs/override_inc/net/if.h new file mode 100644 index 000000000..a8e33b6a9 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/net/if.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for net/if.h */ +#ifndef _OSAL_OVERRIDE_NET_IF_H_ +#define _OSAL_OVERRIDE_NET_IF_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in net/if.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_NET_IF_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/netdb.h b/src/unit-test-coverage/ut-stubs/override_inc/netdb.h new file mode 100644 index 000000000..8aeaa0fe2 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/netdb.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for netdb.h */ +#ifndef _OSAL_OVERRIDE_NETDB_H_ +#define _OSAL_OVERRIDE_NETDB_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in netdb.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_NETDB_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/netinet/in.h b/src/unit-test-coverage/ut-stubs/override_inc/netinet/in.h new file mode 100644 index 000000000..c76a707c0 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/netinet/in.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for netinet/in.h */ +#ifndef _OSAL_OVERRIDE_NETINET_IN_H_ +#define _OSAL_OVERRIDE_NETINET_IN_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in netinet/in.h */ +/* ----------------------------------------- */ + +#define htons OCS_htons +#define ntohs OCS_ntohs +#define htonl OCS_htonl +#define ntohl OCS_ntohl + + +#endif /* _OSAL_OVERRIDE_NETINET_IN_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/netinet/tcp.h b/src/unit-test-coverage/ut-stubs/override_inc/netinet/tcp.h new file mode 100644 index 000000000..f70358840 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/netinet/tcp.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for netinet/tcp.h */ +#ifndef _OSAL_OVERRIDE_NETINET_TCP_H_ +#define _OSAL_OVERRIDE_NETINET_TCP_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in netinet/tcp.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_NETINET_TCP_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/objLib.h b/src/unit-test-coverage/ut-stubs/override_inc/objLib.h new file mode 100644 index 000000000..5fa900277 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/objLib.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for objLib.h */ +#ifndef _OSAL_OVERRIDE_OBJLIB_H_ +#define _OSAL_OVERRIDE_OBJLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in objLib.h */ +/* ----------------------------------------- */ + +#define M_objLib OCS_M_objLib +#define S_objLib_OBJ_ID_ERROR OCS_S_objLib_OBJ_ID_ERROR +#define S_objLib_OBJ_UNAVAILABLE OCS_S_objLib_OBJ_UNAVAILABLE +#define S_objLib_OBJ_DELETED OCS_S_objLib_OBJ_DELETED +#define S_objLib_OBJ_TIMEOUT OCS_S_objLib_OBJ_TIMEOUT +#define S_objLib_OBJ_NO_METHOD OCS_S_objLib_OBJ_NO_METHOD + + +#endif /* _OSAL_OVERRIDE_OBJLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/poll.h b/src/unit-test-coverage/ut-stubs/override_inc/poll.h new file mode 100644 index 000000000..6ec759bd4 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/poll.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for poll.h */ +#ifndef _OSAL_OVERRIDE_POLL_H_ +#define _OSAL_OVERRIDE_POLL_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in poll.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_POLL_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/pthread.h b/src/unit-test-coverage/ut-stubs/override_inc/pthread.h new file mode 100644 index 000000000..3a7ac40a7 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/pthread.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for pthread.h */ +#ifndef _OSAL_OVERRIDE_PTHREAD_H_ +#define _OSAL_OVERRIDE_PTHREAD_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in pthread.h */ +/* ----------------------------------------- */ + +#define PTHREAD_PRIO_INHERIT OCS_PTHREAD_PRIO_INHERIT +#define PTHREAD_MUTEX_RECURSIVE OCS_PTHREAD_MUTEX_RECURSIVE +#define PTHREAD_EXPLICIT_SCHED OCS_PTHREAD_EXPLICIT_SCHED + +#define pthread_t OCS_pthread_t +#define pthread_attr_t OCS_pthread_attr_t +#define pthread_mutex_t OCS_pthread_mutex_t +#define pthread_mutexattr_t OCS_pthread_mutexattr_t +#define pthread_cond_t OCS_pthread_cond_t +#define pthread_condattr_t OCS_pthread_condattr_t +#define pthread_key_t OCS_pthread_key_t + +#define pthread_attr_destroy OCS_pthread_attr_destroy +#define pthread_attr_getschedparam OCS_pthread_attr_getschedparam +#define pthread_attr_init OCS_pthread_attr_init +#define pthread_attr_setinheritsched OCS_pthread_attr_setinheritsched +#define pthread_attr_setschedparam OCS_pthread_attr_setschedparam +#define pthread_attr_setschedpolicy OCS_pthread_attr_setschedpolicy +#define pthread_attr_setstacksize OCS_pthread_attr_setstacksize +#define pthread_cancel OCS_pthread_cancel +#define pthread_cond_broadcast OCS_pthread_cond_broadcast +#define pthread_cond_destroy OCS_pthread_cond_destroy +#define pthread_cond_init OCS_pthread_cond_init +#define pthread_cond_signal OCS_pthread_cond_signal +#define pthread_cond_timedwait OCS_pthread_cond_timedwait +#define pthread_cond_wait OCS_pthread_cond_wait +#define pthread_create OCS_pthread_create +#define pthread_detach OCS_pthread_detach +#define pthread_equal OCS_pthread_equal +#define pthread_exit OCS_pthread_exit +#define pthread_getschedparam OCS_pthread_getschedparam +#define pthread_getspecific OCS_pthread_getspecific +#define pthread_key_create OCS_pthread_key_create +#define pthread_mutexattr_destroy OCS_pthread_mutexattr_destroy +#define pthread_mutexattr_init OCS_pthread_mutexattr_init +#define pthread_mutexattr_setprotocol OCS_pthread_mutexattr_setprotocol +#define pthread_mutexattr_settype OCS_pthread_mutexattr_settype +#define pthread_mutex_destroy OCS_pthread_mutex_destroy +#define pthread_mutex_init OCS_pthread_mutex_init +#define pthread_mutex_lock OCS_pthread_mutex_lock +#define pthread_mutex_unlock OCS_pthread_mutex_unlock +#define pthread_self OCS_pthread_self +#define pthread_setschedparam OCS_pthread_setschedparam +#define pthread_setschedprio OCS_pthread_setschedprio +#define pthread_setspecific OCS_pthread_setspecific +#define pthread_sigmask OCS_pthread_sigmask + + + +#endif /* _OSAL_OVERRIDE_PTHREAD_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/ramDiskCbio.h b/src/unit-test-coverage/ut-stubs/override_inc/ramDiskCbio.h new file mode 100644 index 000000000..6665f0e6d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/ramDiskCbio.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for ramDiskCbio.h */ +#ifndef _OSAL_OVERRIDE_RAMDISKCBIO_H_ +#define _OSAL_OVERRIDE_RAMDISKCBIO_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in ramDiskCbio.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_RAMDISKCBIO_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/ramDrv.h b/src/unit-test-coverage/ut-stubs/override_inc/ramDrv.h new file mode 100644 index 000000000..04e547fa7 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/ramDrv.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for ramDrv.h */ +#ifndef _OSAL_OVERRIDE_RAMDRV_H_ +#define _OSAL_OVERRIDE_RAMDRV_H_ + +#include +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in ramDrv.h */ +/* ----------------------------------------- */ + +#define ramDevCreate OCS_ramDevCreate + + +#endif /* _OSAL_OVERRIDE_RAMDRV_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sched.h b/src/unit-test-coverage/ut-stubs/override_inc/sched.h new file mode 100644 index 000000000..35d74c08d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sched.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sched.h */ +#ifndef _OSAL_OVERRIDE_SCHED_H_ +#define _OSAL_OVERRIDE_SCHED_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sched.h */ +/* ----------------------------------------- */ + +#define SCHED_FIFO OCS_SCHED_FIFO +#define SCHED_RR OCS_SCHED_RR + +#define sched_param OCS_sched_param + +#define sched_get_priority_max OCS_sched_get_priority_max +#define sched_get_priority_min OCS_sched_get_priority_min + + +#endif /* _OSAL_OVERRIDE_SCHED_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/semLib.h b/src/unit-test-coverage/ut-stubs/override_inc/semLib.h new file mode 100644 index 000000000..18bd28d5c --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/semLib.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for semLib.h */ +#ifndef _OSAL_OVERRIDE_SEMLIB_H_ +#define _OSAL_OVERRIDE_SEMLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in semLib.h */ +/* ----------------------------------------- */ + +#define VX_BINARY_SEMAPHORE(x) OCS_VX_BINARY_SEMAPHORE(x) +#define VX_COUNTING_SEMAPHORE(x) OCS_VX_COUNTING_SEMAPHORE(x) +#define VX_MUTEX_SEMAPHORE(x) OCS_VX_MUTEX_SEMAPHORE(x) + +#define SEM_ID OCS_SEM_ID +#define SEM_B_STATE OCS_SEM_B_STATE +#define SEM_EMPTY OCS_SEM_EMPTY +#define SEM_FULL OCS_SEM_FULL +#define SEM_Q_FIFO OCS_SEM_Q_FIFO +#define SEM_Q_PRIORITY OCS_SEM_Q_PRIORITY +#define SEM_DELETE_SAFE OCS_SEM_DELETE_SAFE +#define SEM_INVERSION_SAFE OCS_SEM_INVERSION_SAFE +#define SEM_EVENTSEND_ERR_NOTIFY OCS_SEM_EVENTSEND_ERR_NOTIFY + +#define semBInitialize OCS_semBInitialize +#define semBCreate OCS_semBCreate +#define semMInitialize OCS_semMInitialize +#define semMCreate OCS_semMCreate +#define semCInitialize OCS_semCInitialize +#define semCCreate OCS_semCCreate +#define semDelete OCS_semDelete +#define semFlush OCS_semFlush +#define semTake OCS_semTake +#define semGive OCS_semGive + + + +#endif /* _OSAL_OVERRIDE_SEMLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/semaphore.h b/src/unit-test-coverage/ut-stubs/override_inc/semaphore.h new file mode 100644 index 000000000..0e787f1f0 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/semaphore.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for semaphore.h */ +#ifndef _OSAL_OVERRIDE_SEMAPHORE_H_ +#define _OSAL_OVERRIDE_SEMAPHORE_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in semaphore.h */ +/* ----------------------------------------- */ +#define sem_t OCS_sem_t +#define sem_destroy OCS_sem_destroy +#define sem_getvalue OCS_sem_getvalue +#define sem_init OCS_sem_init +#define sem_post OCS_sem_post +#define sem_timedwait OCS_sem_timedwait +#define sem_wait OCS_sem_wait + + +#endif /* _OSAL_OVERRIDE_SEMAPHORE_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/setjmp.h b/src/unit-test-coverage/ut-stubs/override_inc/setjmp.h new file mode 100644 index 000000000..281520fd1 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/setjmp.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for setjmp.h */ +#ifndef _OSAL_OVERRIDE_SETJMP_H_ +#define _OSAL_OVERRIDE_SETJMP_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in setjmp.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_SETJMP_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/shellLib.h b/src/unit-test-coverage/ut-stubs/override_inc/shellLib.h new file mode 100644 index 000000000..a9a75fd7d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/shellLib.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for shellLib.h */ +#ifndef _OSAL_OVERRIDE_SHELLLIB_H_ +#define _OSAL_OVERRIDE_SHELLLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in shellLib.h */ +/* ----------------------------------------- */ +#define shellGenericInit OCS_shellGenericInit + +#endif /* _OSAL_OVERRIDE_SHELLLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/signal.h b/src/unit-test-coverage/ut-stubs/override_inc/signal.h new file mode 100644 index 000000000..3490f61bb --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/signal.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for signal.h */ +#ifndef _OSAL_OVERRIDE_SIGNAL_H_ +#define _OSAL_OVERRIDE_SIGNAL_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in signal.h */ +/* ----------------------------------------- */ + +#define SIG_SETMASK OCS_SIG_SETMASK +#define SIGHUP OCS_SIGHUP +#define SIGINT OCS_SIGINT +#define SIGABRT OCS_SIGABRT +#define SIGSEGV OCS_SIGSEGV +#define SIGBUS OCS_SIGBUS +#define SIGFPE OCS_SIGFPE +#define SIGILL OCS_SIGILL +#define SIGRTMIN OCS_SIGRTMIN +#define SIGRTMAX OCS_SIGRTMAX +#define SIGEV_SIGNAL OCS_SIGEV_SIGNAL + +#define sighandler_t OCS_sighandler_t +#define sigset_t OCS_sigset_t +#define sig_atomic_t OCS_sig_atomic_t +#define sigevent OCS_sigevent + + +#define kill OCS_kill +#define sigaddset OCS_sigaddset +#define sigdelset OCS_sigdelset +#define sigemptyset OCS_sigemptyset +#define sigfillset OCS_sigfillset +#define sigismember OCS_sigismember +#define signal OCS_signal +#define sigprocmask OCS_sigprocmask +#define sigsuspend OCS_sigsuspend +#define sigwait OCS_sigwait + +#endif /* _OSAL_OVERRIDE_SIGNAL_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/stat.h b/src/unit-test-coverage/ut-stubs/override_inc/stat.h new file mode 100644 index 000000000..630fe01f6 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/stat.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for stat.h */ +#ifndef _OSAL_OVERRIDE_STAT_H_ +#define _OSAL_OVERRIDE_STAT_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/stat.h */ +/* ----------------------------------------- */ + +#define stat OCS_stat +#define fchmod OCS_fchmod +#define chmod OCS_chmod +#define mkdir OCS_mkdir + + +/* ----------------------------------------- */ +/* mappings for declarations in sys/statvfs.h */ +/* ----------------------------------------- */ +#define statvfs OCS_statvfs +#define statfs OCS_statvfs + + + +#endif /* _OSAL_OVERRIDE_STAT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/stdarg.h b/src/unit-test-coverage/ut-stubs/override_inc/stdarg.h new file mode 100644 index 000000000..7429837d9 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/stdarg.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for stdarg.h */ +#ifndef _OSAL_OVERRIDE_STDARG_H_ +#define _OSAL_OVERRIDE_STDARG_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in stdarg.h */ +/* ----------------------------------------- */ + +#define va_list OCS_va_list +#define va_start(ap, last) OCS_va_start(ap, last) +#define va_end(ap) OCS_va_end(ap) + + +#endif /* _OSAL_OVERRIDE_STDARG_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/stdio.h b/src/unit-test-coverage/ut-stubs/override_inc/stdio.h new file mode 100644 index 000000000..567d3cc8b --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/stdio.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for stdio.h */ +#ifndef _OSAL_OVERRIDE_STDIO_H_ +#define _OSAL_OVERRIDE_STDIO_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in stdio.h */ +/* ----------------------------------------- */ + +#define FILE OCS_FILE +#define fclose OCS_fclose +#define fgets OCS_fgets +#define fopen OCS_fopen +#define fputs OCS_fputs +#define remove OCS_remove +#define rename OCS_rename +#define snprintf OCS_snprintf +#define vsnprintf OCS_vsnprintf +#define printf(...) OCS_printf(__VA_ARGS__) +#define putchar OCS_putchar + +#define stdin OCS_stdin +#define stdout OCS_stdout +#define stderr OCS_stderr + + +#endif /* _OSAL_OVERRIDE_STDIO_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/stdlib.h b/src/unit-test-coverage/ut-stubs/override_inc/stdlib.h new file mode 100644 index 000000000..851e3d000 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/stdlib.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for stdlib.h */ +#ifndef _OSAL_OVERRIDE_STDLIB_H_ +#define _OSAL_OVERRIDE_STDLIB_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in stdlib.h */ +/* ----------------------------------------- */ + +#define EXIT_SUCCESS OCS_EXIT_SUCCESS +#define EXIT_FAILURE OCS_EXIT_FAILURE +#define exit OCS_exit +#define strtoul OCS_strtoul +#define system OCS_system +#define malloc OCS_malloc +#define free OCS_free + + +#endif /* _OSAL_OVERRIDE_STDLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/string.h b/src/unit-test-coverage/ut-stubs/override_inc/string.h new file mode 100644 index 000000000..6024db6f7 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/string.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for string.h */ +#ifndef _OSAL_OVERRIDE_STRING_H_ +#define _OSAL_OVERRIDE_STRING_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in string.h */ +/* ----------------------------------------- */ +#define memcpy OCS_memcpy +#define memset OCS_memset +#define strcmp OCS_strcmp +#define strcpy OCS_strcpy +#define strlen OCS_strlen +#define strncmp OCS_strncmp +#define strncpy OCS_strncpy +#define strchr OCS_strchr +#define strrchr OCS_strrchr +#define strcat OCS_strcat +#define strncat OCS_strncat +#define strerror OCS_strerror + +#endif /* _OSAL_OVERRIDE_STRING_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/strings.h b/src/unit-test-coverage/ut-stubs/override_inc/strings.h new file mode 100644 index 000000000..956241a34 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/strings.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for strings.h */ +#ifndef _OSAL_OVERRIDE_STRINGS_H_ +#define _OSAL_OVERRIDE_STRINGS_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in strings.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_STRINGS_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/symLib.h b/src/unit-test-coverage/ut-stubs/override_inc/symLib.h new file mode 100644 index 000000000..7dcf0784d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/symLib.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for symLib.h */ +#ifndef _OSAL_OVERRIDE_SYMLIB_H_ +#define _OSAL_OVERRIDE_SYMLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in symLib.h */ +/* ----------------------------------------- */ +#define LOAD_ALL_SYMBOLS OCS_LOAD_ALL_SYMBOLS + +#define SYM_TYPE OCS_SYM_TYPE +#define SYMTAB OCS_SYMTAB +#define SYMBOL OCS_SYMBOL +#define SYMTAB_ID OCS_SYMTAB_ID +#define SYMBOL_ID OCS_SYMBOL_ID + +#define sysSymTbl OCS_sysSymTbl +#define symFindByName OCS_symFindByName +#define symEach OCS_symEach + + +#endif /* _OSAL_OVERRIDE_SYMLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/ioctl.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/ioctl.h new file mode 100644 index 000000000..786a83cc7 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/ioctl.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/ioctl.h */ +#ifndef _OSAL_OVERRIDE_SYS_IOCTL_H_ +#define _OSAL_OVERRIDE_SYS_IOCTL_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/ioctl.h */ +/* ----------------------------------------- */ + +#define ioctl OCS_ioctl + + +#endif /* _OSAL_OVERRIDE_SYS_IOCTL_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/ipc.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/ipc.h new file mode 100644 index 000000000..050d23f8c --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/ipc.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/ipc.h */ +#ifndef _OSAL_OVERRIDE_SYS_IPC_H_ +#define _OSAL_OVERRIDE_SYS_IPC_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/ipc.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_SYS_IPC_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/mman.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/mman.h new file mode 100644 index 000000000..81b957a13 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/mman.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/mman.h */ +#ifndef _OSAL_OVERRIDE_SYS_MMAN_H_ +#define _OSAL_OVERRIDE_SYS_MMAN_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/mman.h */ +/* ----------------------------------------- */ + +#define MAP_SHARED OCS_MAP_SHARED +#define MAP_PRIVATE OCS_MAP_PRIVATE +#define PROT_EXEC OCS_PROT_EXEC +#define PROT_READ OCS_PROT_READ +#define PROT_WRITE OCS_PROT_WRITE +#define PROT_NONE OCS_PROT_NONE +#define MAP_FIXED OCS_MAP_FIXED +#define mmap OCS_mmap +#define munmap OCS_munmap + + +#endif /* _OSAL_OVERRIDE_SYS_MMAN_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/select.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/select.h new file mode 100644 index 000000000..aa1168376 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/select.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/select.h */ +#ifndef _OSAL_OVERRIDE_SYS_SELECT_H_ +#define _OSAL_OVERRIDE_SYS_SELECT_H_ + +#include + +/* ----------------------------------------- */ +/* constants normally defined in sys/select.h */ +/* ----------------------------------------- */ + +/* ----------------------------------------- */ +/* types normally defined in sys/select.h */ +/* ----------------------------------------- */ + +/* ----------------------------------------- */ +/* mappings for declarations in sys/select.h */ +/* ----------------------------------------- */ + +#define fd_set OCS_fd_set +#define select OCS_select + + +#endif /* _OSAL_OVERRIDE_SYS_SELECT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/signal.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/signal.h new file mode 100644 index 000000000..d48bcc18b --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/signal.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/signal.h */ +#ifndef _OSAL_OVERRIDE_SYS_SIGNAL_H_ +#define _OSAL_OVERRIDE_SYS_SIGNAL_H_ + +/* alias to signal.h */ +#include + + +#endif /* _OSAL_OVERRIDE_SYS_SIGNAL_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/socket.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/socket.h new file mode 100644 index 000000000..968051687 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/socket.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/socket.h */ +#ifndef _OSAL_OVERRIDE_SYS_SOCKET_H_ +#define _OSAL_OVERRIDE_SYS_SOCKET_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/socket.h */ +/* ----------------------------------------- */ +#define socklen_t OCS_socklen_t +#define sockaddr OCS_sockaddr +#define accept OCS_accept +#define bind OCS_bind +#define connect OCS_connect +#define getsockopt OCS_getsockopt +#define listen OCS_listen +#define recvfrom OCS_recvfrom +#define sendto OCS_sendto +#define setsockopt OCS_setsockopt +#define socket OCS_socket + + +#endif /* _OSAL_OVERRIDE_SYS_SOCKET_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/stat.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/stat.h new file mode 100644 index 000000000..3b25fe23a --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/stat.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/stat.h */ +#ifndef _OSAL_OVERRIDE_SYS_STAT_H_ +#define _OSAL_OVERRIDE_SYS_STAT_H_ + +/* alias to stat.h */ +#include + + +#endif /* _OSAL_OVERRIDE_SYS_STAT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/statvfs.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/statvfs.h new file mode 100644 index 000000000..c29e22f38 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/statvfs.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/statvfs.h */ +#ifndef _OSAL_OVERRIDE_SYS_STATVFS_H_ +#define _OSAL_OVERRIDE_SYS_STATVFS_H_ + +/* alias to stat.h */ +#include + + +#endif /* _OSAL_OVERRIDE_SYS_STATVFS_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/time.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/time.h new file mode 100644 index 000000000..b9f6ce108 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/time.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/time.h */ +#ifndef _OSAL_OVERRIDE_SYS_TIME_H_ +#define _OSAL_OVERRIDE_SYS_TIME_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/time.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_SYS_TIME_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/times.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/times.h new file mode 100644 index 000000000..4308509c4 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/times.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/times.h */ +#ifndef _OSAL_OVERRIDE_SYS_TIMES_H_ +#define _OSAL_OVERRIDE_SYS_TIMES_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/times.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_SYS_TIMES_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/types.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/types.h new file mode 100644 index 000000000..d85fdf184 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/types.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/types.h */ +#ifndef _OSAL_OVERRIDE_SYS_TYPES_H_ +#define _OSAL_OVERRIDE_SYS_TYPES_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/types.h */ +/* ----------------------------------------- */ +#define ssize_t OCS_ssize_t +#define off_t OCS_off_t +#define mode_t OCS_mode_t +#define pid_t OCS_pid_t +#define gid_t OCS_gid_t +#define uid_t OCS_uid_t + +#endif /* _OSAL_OVERRIDE_SYS_TYPES_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/un.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/un.h new file mode 100644 index 000000000..edcc370b7 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/un.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/un.h */ +#ifndef _OSAL_OVERRIDE_SYS_UN_H_ +#define _OSAL_OVERRIDE_SYS_UN_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/un.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_SYS_UN_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sys/wait.h b/src/unit-test-coverage/ut-stubs/override_inc/sys/wait.h new file mode 100644 index 000000000..d6ddbaac3 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sys/wait.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sys/wait.h */ +#ifndef _OSAL_OVERRIDE_SYS_WAIT_H_ +#define _OSAL_OVERRIDE_SYS_WAIT_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sys/wait.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_SYS_WAIT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/sysLib.h b/src/unit-test-coverage/ut-stubs/override_inc/sysLib.h new file mode 100644 index 000000000..caeb92a1b --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/sysLib.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for sysLib.h */ +#ifndef _OSAL_OVERRIDE_SYSLIB_H_ +#define _OSAL_OVERRIDE_SYSLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in sysLib.h */ +/* ----------------------------------------- */ +#define sysClkRateGet OCS_sysClkRateGet + + +#endif /* _OSAL_OVERRIDE_SYSLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/taskLib.h b/src/unit-test-coverage/ut-stubs/override_inc/taskLib.h new file mode 100644 index 000000000..2c7d2ed13 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/taskLib.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for taskLib.h */ +#ifndef _OSAL_OVERRIDE_TASKLIB_H_ +#define _OSAL_OVERRIDE_TASKLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in taskLib.h */ +/* ----------------------------------------- */ +#define VX_FP_TASK OCS_VX_FP_TASK +#define TASK_ID OCS_TASK_ID +#define WIND_TCB OCS_WIND_TCB +#define TASK_DESC OCS_TASK_DESC + +#define taskName OCS_taskName +#define taskNameToId OCS_taskNameToId +#define taskIdDefault OCS_taskIdDefault +#define taskIsReady OCS_taskIsReady +#define taskIsSuspended OCS_taskIsSuspended +#define taskGetInfo OCS_taskGetInfo + +#define taskActivate OCS_taskActivate +#define taskExit OCS_taskExit +#define taskIdSelf OCS_taskIdSelf +#define taskDelay OCS_taskDelay +#define taskDelete OCS_taskDelete +#define taskDeleteForce OCS_taskDeleteForce +#define taskSuspend OCS_taskSuspend +#define taskResume OCS_taskResume +#define taskPrioritySet OCS_taskPrioritySet +#define taskSpawn OCS_taskSpawn +#define taskInit OCS_taskInit +#define taskTcb OCS_taskTcb + + +#endif /* _OSAL_OVERRIDE_TASKLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/taskVarLib.h b/src/unit-test-coverage/ut-stubs/override_inc/taskVarLib.h new file mode 100644 index 000000000..105d6b786 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/taskVarLib.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for taskVarLib.h */ +#ifndef _OSAL_OVERRIDE_TASKVARLIB_H_ +#define _OSAL_OVERRIDE_TASKVARLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in taskVarLib.h */ +/* ----------------------------------------- */ + +#define taskVarAdd OCS_taskVarAdd + + + +#endif /* _OSAL_OVERRIDE_TASKVARLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/termios.h b/src/unit-test-coverage/ut-stubs/override_inc/termios.h new file mode 100644 index 000000000..740c7c63c --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/termios.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for termios.h */ +#ifndef _OSAL_OVERRIDE_TERMIOS_H_ +#define _OSAL_OVERRIDE_TERMIOS_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in termios.h */ +/* ----------------------------------------- */ + + +#endif /* _OSAL_OVERRIDE_TERMIOS_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/tgmath.h b/src/unit-test-coverage/ut-stubs/override_inc/tgmath.h new file mode 100644 index 000000000..ce133083f --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/tgmath.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for tgmath.h */ +#ifndef _OSAL_OVERRIDE_TGMATH_H_ +#define _OSAL_OVERRIDE_TGMATH_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in tgmath.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_TGMATH_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/time.h b/src/unit-test-coverage/ut-stubs/override_inc/time.h new file mode 100644 index 000000000..95c6e56c9 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/time.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for time.h */ +#ifndef _OSAL_OVERRIDE_TIME_H_ +#define _OSAL_OVERRIDE_TIME_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in time.h */ +/* ----------------------------------------- */ + +#define CLOCK_REALTIME OCS_CLOCK_REALTIME +#define CLOCK_MONOTONIC OCS_CLOCK_MONOTONIC +#define TIMER_ABSTIME OCS_TIMER_ABSTIME + +#define clockid_t OCS_clockid_t +#define timer_t OCS_timer_t +#define time_t OCS_time_t +#define suseconds_t OCS_suseconds_t +#define timespec OCS_timespec +#define timeval OCS_timeval +#define itimerspec OCS_itimerspec +#define TIMER_CONNECT_FUNC OCS_TIMER_CONNECT_FUNC + +#define clock_getres OCS_clock_getres +#define clock_gettime OCS_clock_gettime +#define clock_nanosleep OCS_clock_nanosleep +#define clock_settime OCS_clock_settime +#define timer_create OCS_timer_create +#define timer_delete OCS_timer_delete +#define timer_gettime OCS_timer_gettime +#define timer_settime OCS_timer_settime +#define timer_connect OCS_timer_connect + + +#endif /* _OSAL_OVERRIDE_TIME_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/timers.h b/src/unit-test-coverage/ut-stubs/override_inc/timers.h new file mode 100644 index 000000000..031378966 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/timers.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for timers.h */ +#ifndef _OSAL_OVERRIDE_TIMERS_H_ +#define _OSAL_OVERRIDE_TIMERS_H_ + +#include +#include + +/* + * Note: this is just an alias for time.h + */ + + +#endif /* _OSAL_OVERRIDE_TIMERS_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/ulimit.h b/src/unit-test-coverage/ut-stubs/override_inc/ulimit.h new file mode 100644 index 000000000..69966c5a9 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/ulimit.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for ulimit.h */ +#ifndef _OSAL_OVERRIDE_ULIMIT_H_ +#define _OSAL_OVERRIDE_ULIMIT_H_ + +#include + + +/* ----------------------------------------- */ +/* mappings for declarations in ulimit.h */ +/* ----------------------------------------- */ +#define ulimit OCS_ulimit + + +#endif /* _OSAL_OVERRIDE_ULIMIT_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/unistd.h b/src/unit-test-coverage/ut-stubs/override_inc/unistd.h new file mode 100644 index 000000000..61fda413e --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/unistd.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for unistd.h */ +#ifndef _OSAL_OVERRIDE_UNISTD_H_ +#define _OSAL_OVERRIDE_UNISTD_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in unistd.h */ +/* ----------------------------------------- */ + +#define SEEK_SET OCS_SEEK_SET +#define SEEK_CUR OCS_SEEK_CUR +#define SEEK_END OCS_SEEK_END +#define STDIN_FILENO OCS_STDIN_FILENO +#define STDOUT_FILENO OCS_STDOUT_FILENO +#define STDERR_FILENO OCS_STDERR_FILENO + +#define close OCS_close +#define getegid OCS_getegid +#define geteuid OCS_geteuid +#define gethostid OCS_gethostid +#define gethostname OCS_gethostname +#define getpid OCS_getpid +#define lseek OCS_lseek +#define read OCS_read +#define rmdir OCS_rmdir +#define sysconf OCS_sysconf +#define write OCS_write + + +#endif /* _OSAL_OVERRIDE_UNISTD_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/unldLib.h b/src/unit-test-coverage/ut-stubs/override_inc/unldLib.h new file mode 100644 index 000000000..42f702c38 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/unldLib.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for unldLib.h */ +#ifndef _OSAL_OVERRIDE_UNLDLIB_H_ +#define _OSAL_OVERRIDE_UNLDLIB_H_ + +#include +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in unldLib.h */ +/* ----------------------------------------- */ +#define unldByModuleId OCS_unldByModuleId + + +#endif /* _OSAL_OVERRIDE_UNLDLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/usrLib.h b/src/unit-test-coverage/ut-stubs/override_inc/usrLib.h new file mode 100644 index 000000000..337f6ed1b --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/usrLib.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for usrLib.h */ +#ifndef _OSAL_OVERRIDE_USRLIB_H_ +#define _OSAL_OVERRIDE_USRLIB_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in usrLib.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_USRLIB_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/version.h b/src/unit-test-coverage/ut-stubs/override_inc/version.h new file mode 100644 index 000000000..491932203 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/version.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for version.h */ +#ifndef _OSAL_OVERRIDE_VERSION_H_ +#define _OSAL_OVERRIDE_VERSION_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in version.h */ +/* ----------------------------------------- */ + +#endif /* _OSAL_OVERRIDE_VERSION_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/vxWorks.h b/src/unit-test-coverage/ut-stubs/override_inc/vxWorks.h new file mode 100644 index 000000000..aef6b0501 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/vxWorks.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for vxWorks.h */ +#ifndef _OSAL_OVERRIDE_VXWORKS_H_ +#define _OSAL_OVERRIDE_VXWORKS_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in vxWorks.h */ +/* ----------------------------------------- */ +#define ERROR OCS_ERROR +#define OK OCS_OK +#define WAIT_FOREVER OCS_WAIT_FOREVER +#define NO_WAIT OCS_NO_WAIT + + +#define STATUS OCS_STATUS +#define BOOL OCS_BOOL +#define FUNCPTR OCS_FUNCPTR +#define VOIDFUNCPTR OCS_VOIDFUNCPTR + +#define UINT OCS_UINT +#define INT8 OCS_INT8 +#define UINT8 OCS_UINT8 +#define INT16 OCS_INT16 +#define UINT16 OCS_UINT16 +#define INT32 OCS_INT32 +#define UINT32 OCS_UINT32 + + +#endif /* _OSAL_OVERRIDE_VXWORKS_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/wchar.h b/src/unit-test-coverage/ut-stubs/override_inc/wchar.h new file mode 100644 index 000000000..3a45a3125 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/wchar.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for wchar.h */ +#ifndef _OSAL_OVERRIDE_WCHAR_H_ +#define _OSAL_OVERRIDE_WCHAR_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in wchar.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_WCHAR_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/wctype.h b/src/unit-test-coverage/ut-stubs/override_inc/wctype.h new file mode 100644 index 000000000..573ddaa7b --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/wctype.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for wctype.h */ +#ifndef _OSAL_OVERRIDE_WCTYPE_H_ +#define _OSAL_OVERRIDE_WCTYPE_H_ + +#include + +/* ----------------------------------------- */ +/* mappings for declarations in wctype.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_WCTYPE_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/override_inc/xbdBlkDev.h b/src/unit-test-coverage/ut-stubs/override_inc/xbdBlkDev.h new file mode 100644 index 000000000..de5c9e03d --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/xbdBlkDev.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for xbdBlkDev.h */ +#ifndef _OSAL_OVERRIDE_XBDBLKDEV_H_ +#define _OSAL_OVERRIDE_XBDBLKDEV_H_ + +#include +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in xbdBlkDev.h */ +/* ----------------------------------------- */ + +#define NULLDEV OCS_NULLDEV +#define device_t OCS_device_t +#define xbdBlkDevCreateSync OCS_xbdBlkDevCreateSync +#define xbdBlkDevDelete OCS_xbdBlkDevDelete + + + +#endif /* _OSAL_OVERRIDE_XBDBLKDEV_H_ */ + diff --git a/src/unit-test-coverage/ut-stubs/override_inc/xbdRamDisk.h b/src/unit-test-coverage/ut-stubs/override_inc/xbdRamDisk.h new file mode 100644 index 000000000..a713d1ca0 --- /dev/null +++ b/src/unit-test-coverage/ut-stubs/override_inc/xbdRamDisk.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2019, 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. + */ + +/* OSAL coverage stub replacement for xbdRamDisk.h */ +#ifndef _OSAL_OVERRIDE_XBDRAMDISK_H_ +#define _OSAL_OVERRIDE_XBDRAMDISK_H_ + +#include +#include + +/* ----------------------------------------- */ +/* mappings for declarations in xbdRamDisk.h */ +/* ----------------------------------------- */ + + + +#endif /* _OSAL_OVERRIDE_XBDRAMDISK_H_ */ diff --git a/src/unit-test-coverage/ut-stubs/src/libc-ctype-stubs.c b/src/unit-test-coverage/ut-stubs/src/libc-ctype-stubs.c index 1581ca555..c815f3af5 100644 --- a/src/unit-test-coverage/ut-stubs/src/libc-ctype-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/libc-ctype-stubs.c @@ -1,8 +1,18 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for string.h */ #include #include "utstubs.h" -#include +#include int OCS_isgraph(int c) { diff --git a/src/unit-test-coverage/ut-stubs/src/libc-stdio-stubs.c b/src/unit-test-coverage/ut-stubs/src/libc-stdio-stubs.c index 4eb2df645..b1bfbcca4 100644 --- a/src/unit-test-coverage/ut-stubs/src/libc-stdio-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/libc-stdio-stubs.c @@ -1,10 +1,25 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for stdio.h */ #include #include #include #include "utstubs.h" -#include +#include + +struct OCS_FILE +{ + int f; +}; #define OCS_STDIO_MAX_SIZE 0x01000000 @@ -68,7 +83,7 @@ OCS_FILE *OCS_fopen (const char * filename, const char * modes) { int32 Status; OCS_FILE *retval; - static int FOPEN_FP; + static OCS_FILE FOPEN_FP = { 0 }; Status = UT_DEFAULT_IMPL(OCS_fopen); @@ -173,7 +188,7 @@ int OCS_printf (const char * format, ...) } -static int LOCAL_FP[3]; +static OCS_FILE LOCAL_FP[3] = { { 10 }, { 11 }, { 12 } }; OCS_FILE* OCS_stdin = &LOCAL_FP[0]; OCS_FILE* OCS_stdout = &LOCAL_FP[1]; diff --git a/src/unit-test-coverage/ut-stubs/src/libc-stdlib-stubs.c b/src/unit-test-coverage/ut-stubs/src/libc-stdlib-stubs.c index 6fc16b15a..7008aa452 100644 --- a/src/unit-test-coverage/ut-stubs/src/libc-stdlib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/libc-stdlib-stubs.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for stdlib.h */ #include #include @@ -5,7 +15,7 @@ #include "utstubs.h" #include "utassert.h" -#include +#include /* * The malloc emulator relies on two magic numbers; diff --git a/src/unit-test-coverage/ut-stubs/src/libc-string-stubs.c b/src/unit-test-coverage/ut-stubs/src/libc-string-stubs.c index 3eea5b420..64c1915b9 100644 --- a/src/unit-test-coverage/ut-stubs/src/libc-string-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/libc-string-stubs.c @@ -1,12 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for string.h */ #include #include #include #include "utstubs.h" -#include +#include -void* OCS_memset(void * s, int c, OCS_size_t n) +void* OCS_memset(void * s, int c, size_t n) { int32 Status; void *Result; @@ -25,7 +35,7 @@ void* OCS_memset(void * s, int c, OCS_size_t n) return Result; } -void *OCS_memcpy (void * dest, const void * src, OCS_size_t n) +void *OCS_memcpy (void * dest, const void * src, size_t n) { int32 Status; void *Result; @@ -106,7 +116,7 @@ char *OCS_strcat(char *dest, const char *src) return (char*)0; } -char *OCS_strncat(char *dest, const char *src, OCS_size_t size) +char *OCS_strncat(char *dest, const char *src, size_t size) { int32 Status; @@ -121,7 +131,7 @@ char *OCS_strncat(char *dest, const char *src, OCS_size_t size) return (char*)0; } -int OCS_strncmp(const char *s1, const char *s2, OCS_size_t size) +int OCS_strncmp(const char *s1, const char *s2, size_t size) { int32 Status; @@ -154,7 +164,7 @@ char *OCS_strcpy(char *dst, const char *src) return (char*)0; } -char *OCS_strncpy(char *dst, const char *src, OCS_size_t size) +char *OCS_strncpy(char *dst, const char *src, size_t size) { int32 Status; diff --git a/src/unit-test-coverage/ut-stubs/src/posix-dirent-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-dirent-stubs.c index ea07ffb04..99a6cbfb9 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-dirent-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-dirent-stubs.c @@ -1,11 +1,26 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for dirent.h */ #include #include #include "utstubs.h" -#include +#include + +struct OCS_DIR +{ + int d; +}; -static int OCS_LOCAL_DIR; +static struct OCS_DIR OCS_LOCAL_DIR; struct OCS_dirent OCS_LOCAL_DIRENT; int OCS_closedir (OCS_DIR * dirp) diff --git a/src/unit-test-coverage/ut-stubs/src/posix-errno-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-errno-stubs.c index 6f6ed2131..4d6ec19ff 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-errno-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-errno-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for errno.h */ #include #include #include "utstubs.h" -#include +#include int OCS_errno = 0; diff --git a/src/unit-test-coverage/ut-stubs/src/posix-fcntl-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-fcntl-stubs.c index c46a41560..14bd1155f 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-fcntl-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-fcntl-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for functions in fcntl.h */ #include #include #include "utstubs.h" -#include +#include int OCS_fcntl (int fd, int cmd, ...) { diff --git a/src/unit-test-coverage/ut-stubs/src/posix-ioctl-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-ioctl-stubs.c index adeba0615..92464706c 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-ioctl-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-ioctl-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for functions in sys/ioctl.h */ #include #include #include "utstubs.h" -#include +#include int OCS_ioctl (int fd, unsigned long req, ...) { diff --git a/src/unit-test-coverage/ut-stubs/src/posix-mqueue-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-mqueue-stubs.c index fd074f993..cb8be5759 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-mqueue-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-mqueue-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for mqueue.h */ #include #include #include "utstubs.h" -#include +#include int OCS_mq_close (OCS_mqd_t mqdes) { diff --git a/src/unit-test-coverage/ut-stubs/src/posix-pthread-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-pthread-stubs.c index 579358e50..afdc6bd69 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-pthread-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-pthread-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for pthread.h */ #include #include #include "utstubs.h" -#include +#include int OCS_pthread_attr_destroy (OCS_pthread_attr_t * attr) { @@ -156,7 +166,7 @@ int OCS_pthread_equal (OCS_pthread_t thread1, OCS_pthread_t thread2) if (Status == 2) { - Status = (thread1 == thread2); + Status = (thread1.pthr == thread2.pthr); } return Status; @@ -276,11 +286,11 @@ int OCS_pthread_mutex_unlock (OCS_pthread_mutex_t * mutex) OCS_pthread_t OCS_pthread_self (void) { - int32 Status; + OCS_pthread_t result; - Status = UT_DEFAULT_IMPL(OCS_pthread_self); + result.pthr = UT_DEFAULT_IMPL(OCS_pthread_self); - return Status; + return result; } int OCS_pthread_setschedparam (OCS_pthread_t target_thread, int policy, const struct OCS_sched_param * param) diff --git a/src/unit-test-coverage/ut-stubs/src/posix-sched-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-sched-stubs.c index d01fe0dd0..d5ba46993 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-sched-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-sched-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for sched.h */ #include #include #include "utstubs.h" -#include +#include int OCS_sched_get_priority_max(int policy) diff --git a/src/unit-test-coverage/ut-stubs/src/posix-semaphore-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-semaphore-stubs.c index 428437758..82d65849c 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-semaphore-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-semaphore-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for semaphore.h */ #include #include #include "utstubs.h" -#include +#include int OCS_sem_destroy (OCS_sem_t * sem) { diff --git a/src/unit-test-coverage/ut-stubs/src/posix-signal-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-signal-stubs.c index 58fbda272..cee024968 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-signal-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-signal-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for signal.h */ #include #include #include "utstubs.h" -#include +#include int OCS_kill (OCS_pid_t pid, int sig) { diff --git a/src/unit-test-coverage/ut-stubs/src/posix-stat-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-stat-stubs.c index 6ef76a158..cab573ee8 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-stat-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-stat-stubs.c @@ -1,10 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for functions in sys/stat.h */ #include #include #include "utstubs.h" -#include -#include +#include int OCS_fchmod (int fd, OCS_mode_t mode) @@ -25,7 +34,7 @@ int OCS_chmod (const char *path, OCS_mode_t mode) return Status; } -int OCS_mkdir (const char * path, OCS_mode_t mode) +int OCS_mkdir (const char * path, ...) { int32 Status; diff --git a/src/unit-test-coverage/ut-stubs/src/posix-time-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-time-stubs.c index 530cc6e73..b6cf38281 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-time-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-time-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for time.h */ #include #include #include "utstubs.h" -#include +#include int OCS_clock_getres (OCS_clockid_t clock_id, struct OCS_timespec * res) { diff --git a/src/unit-test-coverage/ut-stubs/src/posix-unistd-stubs.c b/src/unit-test-coverage/ut-stubs/src/posix-unistd-stubs.c index 8b02bedfe..69cf62914 100644 --- a/src/unit-test-coverage/ut-stubs/src/posix-unistd-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/posix-unistd-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for unistd.h */ #include #include #include "utstubs.h" -#include +#include #define OCS_MAX_RDWR_SIZE 0x01000000 /* 16MB */ diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-ataDrv-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-ataDrv-stubs.c index b3cedd191..f36bbd9dc 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-ataDrv-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-ataDrv-stubs.c @@ -1,11 +1,21 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for ataDrv.h */ #include #include #include "utstubs.h" -#include +#include -static int LOCAL_ATADEV; +static OCS_BLK_DEV LOCAL_ATADEV = { 0 }; OCS_BLK_DEV *OCS_ataDevCreate(int ctrl, int drive, unsigned int nBlocks, unsigned int blkOffset) { diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-dosFsLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-dosFsLib-stubs.c index 26e193c89..906a4798f 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-dosFsLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-dosFsLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for dosFsLib.h */ #include #include #include "utstubs.h" -#include +#include /* ----------------------------------------- */ diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-errnoLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-errnoLib-stubs.c index 89448d43c..a803e066e 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-errnoLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-errnoLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for errnoLib.h */ #include #include #include "utstubs.h" -#include +#include int OCS_errnoGet (void) diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c index 5801805f0..4aee060d5 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for intLib.h */ #include #include #include "utstubs.h" -#include +#include OCS_STATUS OCS_intConnect(OCS_VOIDFUNCPTR *vector, OCS_VOIDFUNCPTR routine, int parameter) diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-loadLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-loadLib-stubs.c index 64089c545..8e97e15d0 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-loadLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-loadLib-stubs.c @@ -1,12 +1,22 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for loadLib.h */ #include #include #include "utstubs.h" -#include -#include +#include +#include -static int LOCAL_MODULE = 0; +static OCS_MODULE LOCAL_MODULE = { 0 }; OCS_MODULE_ID OCS_loadModule(int fd, unsigned int symFlag) { diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-memPartLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-memPartLib-stubs.c index 87bd8348d..0425562bf 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-memPartLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-memPartLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for memPartLib.h */ #include #include #include "utstubs.h" -#include +#include OCS_STATUS OCS_memPartShow(OCS_PART_ID partId, int type) { diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-moduleLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-moduleLib-stubs.c index 745d09acd..fa75e12f7 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-moduleLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-moduleLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for moduleLib.h */ #include #include #include "utstubs.h" -#include +#include OCS_STATUS OCS_moduleInfoGet(OCS_MODULE_ID moduleId, OCS_MODULE_INFO * pModuleInfo) { diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-msgQLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-msgQLib-stubs.c index bdfe5fc63..cadeb1cb6 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-msgQLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-msgQLib-stubs.c @@ -1,11 +1,21 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for msgQLib.h */ #include #include #include "utstubs.h" -#include +#include -static int LOCAL_UT_MSGQ; +static OCS_MSG_Q LOCAL_UT_MSGQ = { 0 }; OCS_MSG_Q_ID OCS_msgQCreate(int maxMsgs, int maxMsgLength, int options) { diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-ramDrv-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-ramDrv-stubs.c index 98028880b..1d430ae66 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-ramDrv-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-ramDrv-stubs.c @@ -1,11 +1,21 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for ramDrv.h */ #include #include #include "utstubs.h" -#include +#include -static int LOCAL_RAMDEV; +static OCS_BLK_DEV LOCAL_RAMDEV = { 0 }; OCS_BLK_DEV *OCS_ramDevCreate (char *ramAddr, int bytesPerSec, int secPerTrack, int nSectors, int secOffset) diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-semLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-semLib-stubs.c index 1abfa523a..37e23268c 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-semLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-semLib-stubs.c @@ -1,13 +1,23 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for semLib.h */ #include #include #include "utstubs.h" -#include +#include -static int LOCAL_UT_SEM; +static OCS_SEM LOCAL_UT_SEM = { 0 }; -OCS_SEM_ID OCS_semBInitialize(char *pSemMem, int options, OCS_SEM_B_STATE initialState) +OCS_SEM_ID OCS_semBInitialize(OCS_SEM *pSemMem, int options, OCS_SEM_B_STATE initialState) { OCS_SEM_ID retval = NULL; int32 Status; @@ -15,7 +25,7 @@ OCS_SEM_ID OCS_semBInitialize(char *pSemMem, int options, OCS_SEM_B_STATE initia Status = UT_DEFAULT_IMPL(OCS_semBInitialize); if (Status == 0) { - retval = (OCS_SEM_ID)pSemMem; + retval = pSemMem; } return retval; @@ -33,7 +43,7 @@ OCS_SEM_ID OCS_semBCreate(int options, OCS_SEM_B_STATE initialState) return retval; } -OCS_SEM_ID OCS_semMInitialize(char *pSemMem, int options) +OCS_SEM_ID OCS_semMInitialize(OCS_SEM *pSemMem, int options) { OCS_SEM_ID retval = NULL; int32 Status; @@ -41,7 +51,7 @@ OCS_SEM_ID OCS_semMInitialize(char *pSemMem, int options) Status = UT_DEFAULT_IMPL(OCS_semMInitialize); if (Status == 0) { - retval = (OCS_SEM_ID)pSemMem; + retval = pSemMem; } return retval; @@ -59,7 +69,7 @@ OCS_SEM_ID OCS_semMCreate(int options) return retval; } -OCS_SEM_ID OCS_semCInitialize(char *pSemMem, int options, int initialCount) +OCS_SEM_ID OCS_semCInitialize(OCS_SEM *pSemMem, int options, int initialCount) { OCS_SEM_ID retval = NULL; int32 Status; @@ -67,7 +77,7 @@ OCS_SEM_ID OCS_semCInitialize(char *pSemMem, int options, int initialCount) Status = UT_DEFAULT_IMPL(OCS_semCInitialize); if (Status == 0) { - retval = (OCS_SEM_ID)pSemMem; + retval = pSemMem; } return retval; diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-shellLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-shellLib-stubs.c index f08ae4d2e..bf8962a60 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-shellLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-shellLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for shellLib.h */ #include #include #include "utstubs.h" -#include +#include OCS_STATUS OCS_shellGenericInit( const char * config, diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-symLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-symLib-stubs.c index 2dd7b942d..651ce4dc5 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-symLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-symLib-stubs.c @@ -1,12 +1,32 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for symLib.h */ #include #include #include "utstubs.h" -#include +#include + +struct OCS_SYMBOL +{ + int sym; +}; + +struct OCS_SYMTAB +{ + int symtab; +}; -static int LOCAL_SYMBOL; -static int LOCAL_SYMTAB; +static OCS_SYMBOL LOCAL_SYMBOL = { 1 }; +static OCS_SYMTAB LOCAL_SYMTAB = { 2 }; OCS_SYMTAB_ID OCS_sysSymTbl = &LOCAL_SYMTAB; diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-sysLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-sysLib-stubs.c index 1a0c91d3d..37b2093ff 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-sysLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-sysLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for sysLib.h */ #include #include #include "utstubs.h" -#include +#include int OCS_sysClkRateGet(void) { diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-taskLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-taskLib-stubs.c index 9f075b5dc..f8ae1b555 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-taskLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-taskLib-stubs.c @@ -1,10 +1,20 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for taskLib.h */ #include #include #include "utstubs.h" -#include -#include +#include +#include static OCS_WIND_TCB OCS_LOCAL_TASK = { 0 }; diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-taskVarLib-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-taskVarLib-stubs.c index 44d247751..332ccefc7 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-taskVarLib-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-taskVarLib-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for taskVarLib.h */ #include #include #include "utstubs.h" -#include +#include OCS_STATUS OCS_taskVarAdd(int tid, int *pVar) diff --git a/src/unit-test-coverage/ut-stubs/src/vxworks-xbdBlkDev-stubs.c b/src/unit-test-coverage/ut-stubs/src/vxworks-xbdBlkDev-stubs.c index 85a6f7eaf..b62aa82a9 100644 --- a/src/unit-test-coverage/ut-stubs/src/vxworks-xbdBlkDev-stubs.c +++ b/src/unit-test-coverage/ut-stubs/src/vxworks-xbdBlkDev-stubs.c @@ -1,9 +1,19 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for xbdBlkDev.h */ #include #include #include "utstubs.h" -#include +#include OCS_device_t OCS_xbdBlkDevCreateSync (OCS_BLK_DEV *bd, const char *name) { diff --git a/src/unit-test-coverage/vxworks/modules/CMakeLists.txt b/src/unit-test-coverage/vxworks/modules/CMakeLists.txt index 98a4ef915..4ef5b121c 100644 --- a/src/unit-test-coverage/vxworks/modules/CMakeLists.txt +++ b/src/unit-test-coverage/vxworks/modules/CMakeLists.txt @@ -1,3 +1,13 @@ +# +# Copyright (c) 2019, 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. +# + # -------------------------------------- # OSAL SHARED LAYER FOR COVERAGE TESTING # -------------------------------------- @@ -11,8 +21,9 @@ # stub (OCS) counterpart # - UT_C_FLAGS are enabled to include any code coverage instrumentation -# the "overrides" dir contains empty versions of the C-library include files. -include_directories(BEFORE ${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc/overrides) +# the "override_inc" dir contains replacement versions of the C-library include files. +include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/inc) +include_directories(${OSALCOVERAGE_SOURCE_DIR}/ut-stubs/override_inc) foreach(MODULE ${MODULE_LIST}) if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/ut-${MODULE}.c) diff --git a/src/unit-test-coverage/vxworks/modules/inc/ut-osapi.h b/src/unit-test-coverage/vxworks/modules/inc/ut-osapi.h index b5af17169..5f7f39a55 100644 --- a/src/unit-test-coverage/vxworks/modules/inc/ut-osapi.h +++ b/src/unit-test-coverage/vxworks/modules/inc/ut-osapi.h @@ -1,11 +1,21 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for file mode bits * this file is shared by several UT replacement headers */ #ifndef _OSAL_UT_OSAPI_H_ #define _OSAL_UT_OSAPI_H_ #include -#include -#include +#include +#include /***************************************************** * diff --git a/src/unit-test-coverage/vxworks/modules/inc/ut-osfilesys.h b/src/unit-test-coverage/vxworks/modules/inc/ut-osfilesys.h index 488c4f411..149a74258 100644 --- a/src/unit-test-coverage/vxworks/modules/inc/ut-osfilesys.h +++ b/src/unit-test-coverage/vxworks/modules/inc/ut-osfilesys.h @@ -1,10 +1,20 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for file mode bits * this file is shared by several UT replacement headers */ #ifndef _OSAL_UT_OSFILESYS_H_ #define _OSAL_UT_OSFILESYS_H_ #include -#include +#include /***************************************************** * diff --git a/src/unit-test-coverage/vxworks/modules/inc/ut-osloader.h b/src/unit-test-coverage/vxworks/modules/inc/ut-osloader.h index 00da55ee1..78e952a5e 100644 --- a/src/unit-test-coverage/vxworks/modules/inc/ut-osloader.h +++ b/src/unit-test-coverage/vxworks/modules/inc/ut-osloader.h @@ -1,10 +1,20 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for file mode bits * this file is shared by several UT replacement headers */ #ifndef _OSAL_UT_OSLOADER_H_ #define _OSAL_UT_OSLOADER_H_ #include -#include +#include /***************************************************** * diff --git a/src/unit-test-coverage/vxworks/modules/inc/ut-ostimer.h b/src/unit-test-coverage/vxworks/modules/inc/ut-ostimer.h index 58e2fb7f1..86c9522de 100644 --- a/src/unit-test-coverage/vxworks/modules/inc/ut-ostimer.h +++ b/src/unit-test-coverage/vxworks/modules/inc/ut-ostimer.h @@ -1,11 +1,21 @@ +/* + * Copyright (c) 2019, 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. + */ + /* OSAL coverage stub replacement for file mode bits * this file is shared by several UT replacement headers */ #ifndef _OSAL_UT_OSTIMER_H_ #define _OSAL_UT_OSTIMER_H_ #include -#include -#include +#include +#include /***************************************************** * diff --git a/src/unit-test-coverage/vxworks/modules/src/stub-map-to-real.h b/src/unit-test-coverage/vxworks/modules/src/stub-map-to-real.h deleted file mode 100644 index f9761ac4a..000000000 --- a/src/unit-test-coverage/vxworks/modules/src/stub-map-to-real.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2004-2015, United States government as represented by the - * administrator of the National Aeronautics Space Administration. - * All rights reserved. This software was created at NASA Glenn - * Research 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 stub-map-to-real.h - * - * Created on: Oct 29, 2015 - * Author: joseph.p.hickey@nasa.gov - * - * Map all symbols to the OCS counterpart for unit testing - * - * NOTE: Sorted alphabetically which makes things easier to - * find as well as possibly reduce merge conflicts when things - * are added. - */ - -#ifndef STUB_MAP_TO_REAL_H_ -#define STUB_MAP_TO_REAL_H_ - -#define accept OCS_accept -#define ataDevCreate OCS_ataDevCreate -#define bind OCS_bind -#define BLK_DEV OCS_BLK_DEV -#define BOOL OCS_BOOL -#define chmod OCS_chmod -#define clock_getres OCS_clock_getres -#define clock_gettime OCS_clock_gettime -#define clockid_t OCS_clockid_t -#define CLOCK_MONOTONIC OCS_CLOCK_MONOTONIC -#define clock_nanosleep OCS_clock_nanosleep -#define CLOCK_REALTIME OCS_CLOCK_REALTIME -#define clock_settime OCS_clock_settime -#define closedir OCS_closedir -#define close OCS_close -#define connect OCS_connect -#define cp OCS_cp -#define device_t OCS_device_t -#define dirent OCS_dirent -#define DIR OCS_DIR -#define DOS_CHK_ONLY OCS_DOS_CHK_ONLY -#define DOS_CHK_REPAIR OCS_DOS_CHK_REPAIR -#define DOS_CHK_VERB_0 OCS_DOS_CHK_VERB_0 -#define DOS_CHK_VERB_SILENT OCS_DOS_CHK_VERB_SILENT -#define dosFsVolFormat OCS_dosFsVolFormat -#define DOS_OPT_BLANK OCS_DOS_OPT_BLANK -#define errno OCS_errno -#define errnoGet OCS_errnoGet -#define ERROR OCS_ERROR -#define ESPIPE OCS_ESPIPE -#define EXIT_FAILURE OCS_EXIT_FAILURE -#define EXIT_SUCCESS OCS_EXIT_SUCCESS -#define exit OCS_exit -#define fclose OCS_fclose -#define fcntl OCS_fcntl -#define fgets OCS_fgets -#define FILE OCS_FILE -#define FIOCHKDSK OCS_FIOCHKDSK -#define FIOUNMOUNT OCS_FIOUNMOUNT -#define fopen OCS_fopen -#define fputs OCS_fputs -#define free OCS_free -#define FUNCPTR OCS_FUNCPTR -#define F_GETFL OCS_F_GETFL -#define gethostid OCS_gethostid -#define gethostname OCS_gethostname -#define getpid OCS_getpid -#define getsockopt OCS_getsockopt -#define hostGetByName OCS_hostGetByName -#define htons OCS_htons -#define inet_ntop OCS_inet_ntop -#define inet_pton OCS_inet_pton -#define intConnect OCS_intConnect -#define intDisable OCS_intDisable -#define intEnable OCS_intEnable -#define intLock OCS_intLock -#define intUnlock OCS_intUnlock -#define INUM_TO_IVEC(i) OCS_INUM_TO_IVEC(i) -#define ioctl OCS_ioctl -#define itimerspec OCS_itimerspec -#define listen OCS_listen -#define LOAD_ALL_SYMBOLS OCS_LOAD_ALL_SYMBOLS -#define loadModule OCS_loadModule -#define lseek OCS_lseek -#define malloc OCS_malloc -#define memcpy OCS_memcpy -#define memPartInfoGet OCS_memPartInfoGet -#define memPartShow OCS_memPartShow -#define MEM_PART_STATS OCS_MEM_PART_STATS -#define memset OCS_memset -#define memSysPartId OCS_memSysPartId -/* note: the VxWorks mkdir() function only has one argument, - * so this is defined as a macro that adds the second argument - * to the stub call, so the same OCS_mkdir stub can be used. */ -#define mkdir(x) OCS_mkdir(x, 0) -#define M_objLib OCS_M_objLib -#define mode_t OCS_mode_t -#define MODULE_ID OCS_MODULE_ID -#define moduleInfoGet OCS_moduleInfoGet -#define MODULE_INFO OCS_MODULE_INFO -#define MSG_PRI_NORMAL OCS_MSG_PRI_NORMAL -#define MSG_PRI_URGENT OCS_MSG_PRI_URGENT -#define msgQCreate OCS_msgQCreate -#define msgQDelete OCS_msgQDelete -#define MSG_Q_FIFO OCS_MSG_Q_FIFO -#define MSG_Q_ID OCS_MSG_Q_ID -#define MSG_Q_PRIORITY OCS_MSG_Q_PRIORITY -#define msgQReceive OCS_msgQReceive -#define msgQSend OCS_msgQSend -#define NO_WAIT OCS_NO_WAIT -#define nSectors OCS_nSectors -#define ntohs OCS_ntohs -#define NULLDEV OCS_NULLDEV -#define O_CREAT OCS_O_CREAT -#define OK OCS_OK -#define opendir OCS_opendir -#define open OCS_open -#define off_t OCS_off_t -#define O_NONBLOCK OCS_O_NONBLOCK -#define O_RDONLY OCS_O_RDONLY -#define O_RDWR OCS_O_RDWR -#define O_TRUNC OCS_O_TRUNC -#define O_WRONLY OCS_O_WRONLY -#define PART_ID OCS_PART_ID -#define printf(...) OCS_printf(__VA_ARGS__) -#define putchar OCS_putchar -#define ramDevCreate OCS_ramDevCreate -#define readdir OCS_readdir -#define read OCS_read -#define recvfrom OCS_recvfrom -#define remove OCS_remove -#define rename OCS_rename -#define rewinddir OCS_rewinddir -#define rmdir OCS_rmdir -#define SEEK_CUR OCS_SEEK_CUR -#define SEEK_END OCS_SEEK_END -#define SEEK_SET OCS_SEEK_SET -#define select OCS_select -#define semBCreate OCS_semBCreate -#define semBInitialize OCS_semBInitialize -#define SEM_B_STATE OCS_SEM_B_STATE -#define semCCreate OCS_semCCreate -#define semCInitialize OCS_semCInitialize -#define semDelete OCS_semDelete -#define SEM_DELETE_SAFE OCS_SEM_DELETE_SAFE -#define SEM_EMPTY OCS_SEM_EMPTY -#define SEM_EVENTSEND_ERR_NOTIFY OCS_SEM_EVENTSEND_ERR_NOTIFY -#define semFlush OCS_semFlush -#define SEM_FULL OCS_SEM_FULL -#define semGive OCS_semGive -#define SEM_ID OCS_SEM_ID -#define SEM_INVERSION_SAFE OCS_SEM_INVERSION_SAFE -#define semMCreate OCS_semMCreate -#define semMInitialize OCS_semMInitialize -#define SEM_Q_FIFO OCS_SEM_Q_FIFO -#define SEM_Q_PRIORITY OCS_SEM_Q_PRIORITY -#define semTake OCS_semTake -#define sendto OCS_sendto -#define setsockopt OCS_setsockopt -#define shellGenericInit OCS_shellGenericInit -#define sigaddset OCS_sigaddset -#define sigemptyset OCS_sigemptyset -#define sigevent OCS_sigevent -#define SIGEV_SIGNAL OCS_SIGEV_SIGNAL -#define sigismember OCS_sigismember -#define SIGRTMAX OCS_SIGRTMAX -#define SIGRTMIN OCS_SIGRTMIN -#define sigset_t OCS_sigset_t -#define sigwait OCS_sigwait -#define S_ISDIR(x) OCS_S_ISDIR(x) -#define S_IFDIR OCS_S_IFDIR -#define S_IRGRP OCS_S_IRGRP -#define S_IROTH OCS_S_IROTH -#define S_IRUSR OCS_S_IRUSR -#define S_IWGRP OCS_S_IWGRP -#define S_IWOTH OCS_S_IWOTH -#define S_IWUSR OCS_S_IWUSR -#define S_IXGRP OCS_S_IXGRP -#define S_IXOTH OCS_S_IXOTH -#define S_IXUSR OCS_S_IXUSR -#define snprintf OCS_snprintf -#define S_objLib_OBJ_DELETED OCS_S_objLib_OBJ_DELETED -#define S_objLib_OBJ_ID_ERROR OCS_S_objLib_OBJ_ID_ERROR -#define S_objLib_OBJ_NO_METHOD OCS_S_objLib_OBJ_NO_METHOD -#define S_objLib_OBJ_TIMEOUT OCS_S_objLib_OBJ_TIMEOUT -#define S_objLib_OBJ_UNAVAILABLE OCS_S_objLib_OBJ_UNAVAILABLE -#define socket OCS_socket -#define ssize_t OCS_ssize_t -#define statfs OCS_statvfs -#define stat OCS_stat -#define STATUS OCS_STATUS -#define stdout OCS_stdout -#define STDOUT_FILENO OCS_STDOUT_FILENO -#define strcat OCS_strcat -#define strchr OCS_strchr -#define strcmp OCS_strcmp -#define strcpy OCS_strcpy -#define strerror OCS_strerror -#define strlen OCS_strlen -#define strncat OCS_strncat -#define strncmp OCS_strncmp -#define strncpy OCS_strncpy -#define strrchr OCS_strrchr -#define strtoul OCS_strtoul -#define SYMBOL_ID OCS_SYMBOL_ID -#define SYMBOL OCS_SYMBOL -#define symEach OCS_symEach -#define symFindByName OCS_symFindByName -#define SYMTAB_ID OCS_SYMTAB_ID -#define SYMTAB OCS_SYMTAB -#define SYM_TYPE OCS_SYM_TYPE -#define sysClkRateGet OCS_sysClkRateGet -#define sysconf OCS_sysconf -#define sysSymTbl OCS_sysSymTbl -#define system OCS_system -#define TASK_ID OCS_TASK_ID -#define taskActivate OCS_taskActivate -#define taskDelay OCS_taskDelay -#define taskDeleteForce OCS_taskDeleteForce -#define taskDelete OCS_taskDelete -#define taskExit OCS_taskExit -#define taskIdSelf OCS_taskIdSelf -#define taskInit OCS_taskInit -#define taskNameToId OCS_taskNameToId -#define taskPrioritySet OCS_taskPrioritySet -#define taskResume OCS_taskResume -#define taskSpawn OCS_taskSpawn -#define taskSuspend OCS_taskSuspend -#define taskTcb OCS_taskTcb -#define taskVarAdd OCS_taskVarAdd -#define TIMER_ABSTIME OCS_TIMER_ABSTIME -#define timer_connect OCS_timer_connect -#define timer_create OCS_timer_create -#define timer_delete OCS_timer_delete -#define timer_gettime OCS_timer_gettime -#define timer_settime OCS_timer_settime -#define timer_t OCS_timer_t -#define timespec OCS_timespec -#define time_t OCS_time_t -#define UINT16 OCS_UINT16 -#define UINT32 OCS_UINT32 -#define UINT OCS_UINT -#define unldByModuleId OCS_unldByModuleId -#define VOIDFUNCPTR OCS_VOIDFUNCPTR -#define vsnprintf OCS_vsnprintf -#define VX_BINARY_SEMAPHORE OCS_VX_BINARY_SEMAPHORE -#define VX_COUNTING_SEMAPHORE OCS_VX_COUNTING_SEMAPHORE -#define VX_MUTEX_SEMAPHORE OCS_VX_MUTEX_SEMAPHORE -#define vxFpscrSet OCS_vxFpscrSet -#define VX_FP_TASK OCS_VX_FP_TASK -#define WAIT_FOREVER OCS_WAIT_FOREVER -#define WIND_MSG_Q_OPTION_MASK OCS_WIND_MSG_Q_OPTION_MASK -#define WIND_TCB OCS_WIND_TCB -#define write OCS_write -#define xbdBlkDevCreateSync OCS_xbdBlkDevCreateSync -#define xbdBlkDevDelete OCS_xbdBlkDevDelete - -#endif /* STUB_MAP_TO_REAL_H_ */ diff --git a/src/unit-test-coverage/vxworks/modules/src/ut-osapi.c b/src/unit-test-coverage/vxworks/modules/src/ut-osapi.c index 57c0a57b7..a46f68668 100644 --- a/src/unit-test-coverage/vxworks/modules/src/ut-osapi.c +++ b/src/unit-test-coverage/vxworks/modules/src/ut-osapi.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osapi.h" diff --git a/src/unit-test-coverage/vxworks/modules/src/ut-osfileapi.c b/src/unit-test-coverage/vxworks/modules/src/ut-osfileapi.c index 30052bd32..dfb39ab43 100644 --- a/src/unit-test-coverage/vxworks/modules/src/ut-osfileapi.c +++ b/src/unit-test-coverage/vxworks/modules/src/ut-osfileapi.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" #include "ut-osfileapi.h" diff --git a/src/unit-test-coverage/vxworks/modules/src/ut-osfilesys.c b/src/unit-test-coverage/vxworks/modules/src/ut-osfilesys.c index 23baf420e..10f2693df 100644 --- a/src/unit-test-coverage/vxworks/modules/src/ut-osfilesys.c +++ b/src/unit-test-coverage/vxworks/modules/src/ut-osfilesys.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" diff --git a/src/unit-test-coverage/vxworks/modules/src/ut-osloader.c b/src/unit-test-coverage/vxworks/modules/src/ut-osloader.c index 4f8970e3f..7befd6dcc 100644 --- a/src/unit-test-coverage/vxworks/modules/src/ut-osloader.c +++ b/src/unit-test-coverage/vxworks/modules/src/ut-osloader.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" /* diff --git a/src/unit-test-coverage/vxworks/modules/src/ut-ostimer.c b/src/unit-test-coverage/vxworks/modules/src/ut-ostimer.c index 34b8bd86a..28d0127a1 100644 --- a/src/unit-test-coverage/vxworks/modules/src/ut-ostimer.c +++ b/src/unit-test-coverage/vxworks/modules/src/ut-ostimer.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2019, 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. + */ + /* pull in the OSAL configuration */ -#include "stub-map-to-real.h" #include "osconfig.h" /* @@ -88,8 +97,8 @@ void Osapi_Internal_ResetState(void) void Osapi_Internal_Setup(uint32 local_id, int signo, bool reset_flag) { - static int FAKE_TASK; - static int FAKE_SEM; + static OCS_WIND_TCB FAKE_TASK; + static OCS_SEM FAKE_SEM; OS_impl_timebase_table[local_id].assigned_signal = signo; OS_impl_timebase_table[local_id].handler_task = &FAKE_TASK; diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c b/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c index 1fc3bf12d..855d4694d 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-osapi.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,15 +25,15 @@ #include "os-vxworks-coveragetest.h" #include "ut-osapi.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* * A chunk of memory usable as a heap for malloc() emulation diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-osfileapi.c b/src/unit-test-coverage/vxworks/src/coveragetest-osfileapi.c index 1ce265e25..35eab6101 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-osfileapi.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-osfileapi.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -14,12 +24,12 @@ #include "os-vxworks-coveragetest.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "ut-osfileapi.h" diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-osfilesys.c b/src/unit-test-coverage/vxworks/src/coveragetest-osfilesys.c index 648f328df..23d295199 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-osfilesys.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-osfilesys.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,14 +25,14 @@ #include "os-vxworks-coveragetest.h" #include "ut-osfilesys.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-osloader.c b/src/unit-test-coverage/vxworks/src/coveragetest-osloader.c index 220f772d0..fd6158050 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-osloader.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-osloader.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,13 +25,13 @@ #include "os-vxworks-coveragetest.h" #include "ut-osloader.h" -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include void Test_OS_VxWorks_ModuleAPI_Impl_Init(void) { diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-ostimer.c b/src/unit-test-coverage/vxworks/src/coveragetest-ostimer.c index 32e60c8ba..1572740d8 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-ostimer.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-ostimer.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,11 +25,11 @@ #include "os-vxworks-coveragetest.h" #include "ut-ostimer.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include void Test_OS_VxWorks_TimeBaseAPI_Impl_Init(void) diff --git a/src/unit-test-coverage/vxworks/src/coveragetest-printf.c b/src/unit-test-coverage/vxworks/src/coveragetest-printf.c index 58dba58f4..13768da72 100644 --- a/src/unit-test-coverage/vxworks/src/coveragetest-printf.c +++ b/src/unit-test-coverage/vxworks/src/coveragetest-printf.c @@ -1,3 +1,13 @@ +/* + * Copyright (c) 2019, 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. + */ + /* * Filename: osapi_testcase_common.c * @@ -15,11 +25,11 @@ #include "os-vxworks-coveragetest.h" #include "ut-osapi.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include char TestConsoleBuffer[16];