mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 20:57:55 +00:00
Test code does not work with new directory locations.
Adjusted all of the source code to point to the header files in their new locations. Adjusted the makefiles for the header locations as well. Added .gitignore files in the test directories to ignore test object code.
This commit is contained in:
parent
5ce0658907
commit
d3acfa5fc0
1
.gitignore
vendored
1
.gitignore
vendored
@ -22,3 +22,4 @@ bin/trick-trk2ascii
|
||||
bin/trick-trk2csv
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
trick_test
|
||||
|
@ -310,6 +310,10 @@ PURPOSE:
|
||||
print S_SOURCE " " x 4, "return ;\n" ,
|
||||
"}\n\n" ;
|
||||
|
||||
print S_SOURCE "int master( int nargs, char ** args ) ;\n\n" ;
|
||||
print S_SOURCE "int main( int nargs, char ** args ) {\n" ;
|
||||
print S_SOURCE " " x 4 , "return master(nargs, args) ;\n" ;
|
||||
print S_SOURCE "}\n" ;
|
||||
|
||||
close S_SOURCE ;
|
||||
|
||||
|
1
trick_sims/.gitignore
vendored
1
trick_sims/.gitignore
vendored
@ -20,5 +20,6 @@ S_main_*
|
||||
S_sie.resource
|
||||
S_source.cpp
|
||||
S_source.hh
|
||||
T_main_*
|
||||
trick
|
||||
jitlib
|
||||
|
@ -4,15 +4,15 @@ import trick
|
||||
def main():
|
||||
|
||||
# Data recording HDF5 test
|
||||
#drg0 = trick.DRAscii("Ball")
|
||||
#for param in [ 'position' , 'velocity' , 'acceleration' , 'external_force' ] :
|
||||
# for index in range(0,2) :
|
||||
# var = "ball.obj.state.output." + param + "[" + str(index) + "]"
|
||||
# drg0.add_variable(var)
|
||||
#drg0.set_cycle(0.01)
|
||||
#drg0.freq = trick.DR_Always
|
||||
#drg0.thisown = 0
|
||||
#trick.add_data_record_group(drg0, trick.DR_Buffer)
|
||||
drg0 = trick.DRAscii("Ball")
|
||||
for param in [ 'position' , 'velocity' , 'acceleration' , 'external_force' ] :
|
||||
for index in range(0,2) :
|
||||
var = "ball.obj.state.output." + param + "[" + str(index) + "]"
|
||||
drg0.add_variable(var)
|
||||
drg0.set_cycle(0.01)
|
||||
drg0.freq = trick.DR_Always
|
||||
drg0.thisown = 0
|
||||
trick.add_data_record_group(drg0, trick.DR_Buffer)
|
||||
|
||||
my_integ_loop.getIntegrator( trick.Runge_Kutta_2, 4 );
|
||||
|
||||
|
4
trick_sims/SIM_trickcomm/.gitignore
vendored
Normal file
4
trick_sims/SIM_trickcomm/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
tc_client
|
||||
tc_client.dSYM
|
||||
tc_server
|
||||
tc_server.dSYM
|
@ -1,5 +1,5 @@
|
||||
|
||||
export TRICK_HOST_CPU := $(shell $(TRICK_HOME)/bin/gte TRICK_HOST_CPU)
|
||||
export TRICK_HOST_CPU := $(shell $(TRICK_HOME)/bin/trick-gte TRICK_HOST_CPU)
|
||||
|
||||
# List out sims we want to compile
|
||||
COMPILE_DIRS = SIM_Ball++_L1 \
|
||||
@ -98,7 +98,7 @@ clean:
|
||||
done
|
||||
|
||||
$(EXECUTABLES):
|
||||
@ cd $(@D) ; ${TRICK_HOME}/bin/CP -t ;
|
||||
@ cd $(@D) ; ${TRICK_HOME}/bin/trick-CP -t ;
|
||||
|
||||
$(UNIT_TEST_RESULTS): $(TRICK_HOME)/trick_test/%.xml : %/T_main_${TRICK_HOST_CPU}_test.exe
|
||||
@ cd $* ; ./T_main_${TRICK_HOST_CPU}_test.exe RUN_test/unit_test.py
|
||||
|
4
trick_source/data_products/DPX/test/unit_test/.gitignore
vendored
Normal file
4
trick_source/data_products/DPX/test/unit_test/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
*.o
|
||||
DPC_test
|
||||
DPM_test
|
||||
DS_test
|
@ -10,13 +10,13 @@
|
||||
#include "test_view.hh"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
//#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
class DPCTest : public ::testing::Test {
|
||||
protected:
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
std::string testxml[15];
|
||||
|
||||
DPCTest() {}
|
||||
@ -158,7 +158,7 @@ TEST_F(DPCTest, ValidateDTD) {
|
||||
|
||||
// Session 1_1
|
||||
TEST_F(DPCTest, VarvsTime_Binary) {
|
||||
req.add_requirement("2416241399 3201880761");
|
||||
//req.add_requirement("2416241399 3201880761");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[0].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -195,7 +195,7 @@ TEST_F(DPCTest, VarvsTime_Binary) {
|
||||
|
||||
// Session 1_2
|
||||
TEST_F(DPCTest, VarvsTime_CSV) {
|
||||
req.add_requirement("2416241399 32631267");
|
||||
//req.add_requirement("2416241399 32631267");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[1].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -257,7 +257,7 @@ TEST_F(DPCTest, SinglePlot) {
|
||||
|
||||
// Session 3_1
|
||||
TEST_F(DPCTest, SingleTable) {
|
||||
req.add_requirement("3667219994");
|
||||
//req.add_requirement("3667219994");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[3].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -322,7 +322,7 @@ TEST_F(DPCTest, PlotAttr_Binary) {
|
||||
* DPV currently only supports 2D plots.
|
||||
*/
|
||||
TEST_F(DPCTest, 3DProduct_2DPlot) {
|
||||
req.add_requirement("2469402355");
|
||||
//req.add_requirement("2469402355");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[5].c_str());
|
||||
//std::cout << tmp << std::endl;
|
||||
@ -398,7 +398,7 @@ TEST_F(DPCTest, Table_Attributes) {
|
||||
|
||||
// Session 7_1
|
||||
TEST_F(DPCTest, MultiplePlots) {
|
||||
req.add_requirement("445237094");
|
||||
//req.add_requirement("445237094");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[7].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
@ -460,7 +460,7 @@ TEST_F(DPCTest, MultiplePlots) {
|
||||
|
||||
// Session 8_1
|
||||
TEST_F(DPCTest, MultPlots_MultTables) {
|
||||
req.add_requirement("150267139 32631267");
|
||||
//req.add_requirement("150267139 32631267");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[8].c_str());
|
||||
//std::cout << tmp << std::endl;
|
||||
@ -557,7 +557,7 @@ TEST_F(DPCTest, MultPlots_MultTables) {
|
||||
// Session_8_2
|
||||
|
||||
TEST_F(DPCTest, MultTables) {
|
||||
req.add_requirement("2064022342 3201880761");
|
||||
//req.add_requirement("2064022342 3201880761");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[9].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -616,7 +616,7 @@ TEST_F(DPCTest, MultTables) {
|
||||
|
||||
// Session 9_1
|
||||
TEST_F(DPCTest, ComparisonCurves) {
|
||||
req.add_requirement("665188150");
|
||||
//req.add_requirement("665188150");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[10].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -687,7 +687,7 @@ TEST_F(DPCTest, ComparisonCurves) {
|
||||
|
||||
// Session 9_2
|
||||
TEST_F(DPCTest, DeltaCurves) {
|
||||
req.add_requirement("2904854297");
|
||||
//req.add_requirement("2904854297");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[11].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -737,7 +737,7 @@ TEST_F(DPCTest, DeltaCurves) {
|
||||
|
||||
// Session 9_3
|
||||
TEST_F(DPCTest, ContrastCurves) {
|
||||
req.add_requirement("3042036071");
|
||||
//req.add_requirement("3042036071");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[12].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -844,7 +844,7 @@ TEST_F(DPCTest, ContrastCurves) {
|
||||
}
|
||||
|
||||
TEST_F(DPCTest, DPV_Test) {
|
||||
req.add_requirement("2826924382 1366633954");
|
||||
//req.add_requirement("2826924382 1366633954");
|
||||
|
||||
std::string tmp = parseDPCData(testxml[13].c_str());
|
||||
//std::cout << tmp;
|
||||
@ -907,7 +907,7 @@ TEST_F(DPCTest, DPV_Test) {
|
||||
}
|
||||
|
||||
TEST_F(DPCTest, Plot_Matlab) {
|
||||
req.add_requirement("2533684432");
|
||||
//req.add_requirement("2533684432");
|
||||
|
||||
std::string tmp = parseDPCData("../TEST_DATA/session_mat.xml");
|
||||
//std::cout << tmp;
|
||||
|
@ -8,14 +8,14 @@
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
//#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "DPM/DPM_product.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
class DPMTest : public ::testing::Test {
|
||||
protected:
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
std::string testxml[10];
|
||||
|
||||
DPMTest() {}
|
||||
@ -130,7 +130,7 @@ TEST_F(DPMTest, ValidateDTD) {
|
||||
|
||||
// Product 1
|
||||
TEST_F(DPMTest, VarvsTime_NoAttributes) {
|
||||
req.add_requirement("2416241399");
|
||||
//req.add_requirement("2416241399");
|
||||
|
||||
std::string tmp = parseTestData(testxml[0].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
@ -165,7 +165,7 @@ TEST_F(DPMTest, VarvsTime_NoAttributes) {
|
||||
|
||||
// Product 2
|
||||
TEST_F(DPMTest, VarvsVar_NoAttributes) {
|
||||
req.add_requirement("1589175037");
|
||||
//req.add_requirement("1589175037");
|
||||
|
||||
std::string tmp = parseTestData(testxml[1].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
@ -253,7 +253,7 @@ TEST_F(DPMTest, VarvsTime_Attributes) {
|
||||
|
||||
// Product 5
|
||||
TEST_F(DPMTest, VarvsVarvsTime_Attributes) {
|
||||
req.add_requirement("2469402355");
|
||||
//req.add_requirement("2469402355");
|
||||
|
||||
std::string tmp = parseTestData(testxml[4].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
@ -340,7 +340,7 @@ TEST_F(DPMTest, Table_Attributes) {
|
||||
|
||||
// Product 7
|
||||
TEST_F(DPMTest, MultiplePlots) {
|
||||
req.add_requirement("445237094");
|
||||
//req.add_requirement("445237094");
|
||||
|
||||
std::string tmp = parseTestData(testxml[6].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
@ -402,7 +402,7 @@ TEST_F(DPMTest, MultiplePlots) {
|
||||
|
||||
// Product 8
|
||||
TEST_F(DPMTest, MultipleTables_Multipe_Plots) {
|
||||
req.add_requirement("1422666851 150267139 445237094");
|
||||
//req.add_requirement("1422666851 150267139 445237094");
|
||||
|
||||
std::string tmp = parseTestData(testxml[7].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
@ -470,7 +470,7 @@ TEST_F(DPMTest, MultipleTables_Multipe_Plots) {
|
||||
|
||||
// Product 9
|
||||
TEST_F(DPMTest, Multipe_Plots_NoAttributes) {
|
||||
req.add_requirement("445237094");
|
||||
//req.add_requirement("445237094");
|
||||
|
||||
std::string tmp = parseTestData(testxml[8].c_str());
|
||||
int result = strcmp_IgnoringWhiteSpace(
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "DPM/DPM_time_constraints.hh"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
//#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
@ -34,7 +34,7 @@ int strcmp_IgnoreWhiteSpace(const char* s1, const char* s2) {
|
||||
|
||||
class DSTest : public :: testing::Test {
|
||||
protected:
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
std::string testxml[14];
|
||||
|
||||
DSTest() {}
|
||||
@ -122,7 +122,7 @@ std::string DSTest::run(char ch) {
|
||||
|
||||
// ASCII (CSV) DATASTREAM
|
||||
TEST_F(DSTest, DataStream_Ascii) {
|
||||
req.add_requirement("32631267");
|
||||
//req.add_requirement("32631267");
|
||||
|
||||
RUN_dir = "../TEST_DATA/RUN_ASCII";
|
||||
VarName = "sun_predictor.sun.solar_azimuth";
|
||||
@ -193,7 +193,7 @@ TEST_F(DSTest, DataStream_Ascii) {
|
||||
|
||||
// TRICK BINARY DATASTREAM
|
||||
TEST_F(DSTest, DataStream_Binary) {
|
||||
req.add_requirement("3201880761");
|
||||
//req.add_requirement("3201880761");
|
||||
|
||||
RUN_dir = "../TEST_DATA/RUN_BINARY";
|
||||
VarName = "sun_predictor.sun.solar_elevation";
|
||||
@ -264,7 +264,7 @@ TEST_F(DSTest, DataStream_Binary) {
|
||||
|
||||
// MATLAB DATASTREAM
|
||||
TEST_F(DSTest, DataStream_MatLab) {
|
||||
req.add_requirement("2533684432 1366633954");
|
||||
//req.add_requirement("2533684432 1366633954");
|
||||
|
||||
RUN_dir = "../TEST_DATA/RUN_MATLAB";
|
||||
VarName = "ch_joint_angle_5";
|
||||
@ -337,7 +337,7 @@ TEST_F(DSTest, DataStream_MatLab) {
|
||||
// The delta statement is formatted as follows:
|
||||
// delta(<var1:run1>, <var2:run2>)
|
||||
TEST_F(DSTest, DataStream_Delta) {
|
||||
req.add_requirement("2904854297");
|
||||
//req.add_requirement("2904854297");
|
||||
|
||||
RUN_dir = NULL;
|
||||
char DeltaName[1000];
|
||||
@ -355,7 +355,7 @@ TEST_F(DSTest, DataStream_Delta) {
|
||||
|
||||
// DPC UNIT CONVERSION DATASTREAM
|
||||
TEST_F(DSTest, DataStream_DPCUnitConv) {
|
||||
req.add_requirement("2269871888");
|
||||
//req.add_requirement("2269871888");
|
||||
|
||||
RUN_dir = "../TEST_DATA/RUN_BINARY";
|
||||
VarName = "sun_predictor.sun.right_ascension";
|
||||
@ -383,7 +383,7 @@ TEST_F(DSTest, DataStream_DPCUnitConv) {
|
||||
|
||||
// TIME CONSTRAINT DATASTREAM
|
||||
TEST_F(DSTest, DataStream_DPCTimeCstr) {
|
||||
req.add_requirement("3610816325");
|
||||
//req.add_requirement("3610816325");
|
||||
|
||||
int i;
|
||||
DPM_time_constraints *time_constraints;
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
ifneq ($(HDF5),)
|
||||
ifneq ($(HDF5),/usr)
|
||||
@ -47,8 +47,8 @@ else
|
||||
endif
|
||||
|
||||
GTEST_LIBS = ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
TRICK_UNIT_LIBS = -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} -ltrick_units
|
||||
DP_LIBS = -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} \
|
||||
TRICK_UNIT_LIBS = -L${TRICK_LIB_DIR} -ltrick_units
|
||||
DP_LIBS = -L${TRICK_LIB_DIR} \
|
||||
-L${TRICK_HOME}/trick_source/data_products/lib_${TRICK_HOST_CPU} \
|
||||
-llog -lvar -leqparse
|
||||
MODEL_LIBS = -lxml2 \
|
||||
|
3
trick_source/sim_services/Clock/test/.gitignore
vendored
Normal file
3
trick_source/sim_services/Clock/test/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.o
|
||||
BC635Clock_test
|
||||
TPROCTEClock_test
|
@ -14,13 +14,13 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/Clock/include/Clock.hh"
|
||||
#include "sim_services/Clock/include/clock_proto.h"
|
||||
#include "sim_services/Clock/include/GetTimeOfDayClock.hh"
|
||||
#include "sim_services/Clock/include/TPROCTEClock.hh"
|
||||
#include "sim_services/Clock/include/BC635Clock.hh"
|
||||
#include "sim_services/SimObject/include/JobData.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/Clock.hh"
|
||||
#include "trick/clock_proto.h"
|
||||
#include "trick/GetTimeOfDayClock.hh"
|
||||
#include "trick/TPROCTEClock.hh"
|
||||
#include "trick/BC635Clock.hh"
|
||||
#include "trick/JobData.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
@ -34,7 +34,7 @@ class BC635ClockTest : public ::testing::Test {
|
||||
virtual void SetUp() {}
|
||||
virtual void TearDown() {}
|
||||
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
} ;
|
||||
|
||||
//std::map< std::string , unsigned int > Trick::Requirements::num_reqs;
|
||||
@ -42,7 +42,7 @@ class BC635ClockTest : public ::testing::Test {
|
||||
/* Ensure clock initializes correctly */
|
||||
TEST_F(BC635ClockTest, Initialize) {
|
||||
|
||||
req.add_requirement("BC635_clock");
|
||||
//req.add_requirement("BC635_clock");
|
||||
// "The BC635 clock shall initialize reference time of 0, and all ratios set to 1.");
|
||||
|
||||
/* General expected clock initialization */
|
||||
@ -58,7 +58,7 @@ TEST_F(BC635ClockTest, Initialize) {
|
||||
/* Run tests for when no hardware is available */
|
||||
#ifndef _BC635
|
||||
TEST_F(BC635ClockTest, ErrorMessages) {
|
||||
req.add_requirement("BC635_clock");
|
||||
//req.add_requirement("BC635_clock");
|
||||
//"The BC635 clock shall display error messages when attempting to use its functions with no hardware.");
|
||||
|
||||
/* curr_time = 0 always */
|
||||
@ -80,7 +80,7 @@ TEST_F(BC635ClockTest, ErrorMessages) {
|
||||
|
||||
/* Ensure generic clock functions still work when no hardware is available */
|
||||
TEST_F(BC635ClockTest, TestRefTimes) {
|
||||
req.add_requirement("BC635_clock");
|
||||
//req.add_requirement("BC635_clock");
|
||||
//"The BC635 clock shall provide the ability to adjust the reference time");
|
||||
|
||||
long long secs_remainder;
|
||||
|
@ -3,12 +3,12 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/Clock/include/Clock.hh"
|
||||
#include "sim_services/Clock/include/clock_proto.h"
|
||||
#include "sim_services/Clock/include/GetTimeOfDayClock.hh"
|
||||
#include "sim_services/Clock/include/TPROCTEClock.hh"
|
||||
#include "sim_services/Clock/include/BC635Clock.hh"
|
||||
#include "sim_services/SimObject/include/JobData.hh"
|
||||
#include "trick/Clock.hh"
|
||||
#include "trick/clock_proto.h"
|
||||
#include "trick/GetTimeOfDayClock.hh"
|
||||
#include "trick/TPROCTEClock.hh"
|
||||
#include "trick/BC635Clock.hh"
|
||||
#include "trick/JobData.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
#include <map>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/Clock/include/GetTimeOfDayClock.hh"
|
||||
#include "sim_services/SimObject/include/JobData.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/GetTimeOfDayClock.hh"
|
||||
#include "trick/JobData.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
#define TIME_TOL 1e3
|
||||
#define RATIO_TOL 1e-9
|
||||
@ -22,7 +22,7 @@ class GetTimeOfDayClockTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
Trick::GetTimeOfDayClock dClk;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
|
||||
GetTimeOfDayClockTest() {}
|
||||
~GetTimeOfDayClockTest() {}
|
||||
@ -32,7 +32,7 @@ class GetTimeOfDayClockTest : public ::testing::Test {
|
||||
|
||||
/* Ensure clock initializes correctly */
|
||||
TEST_F(GetTimeOfDayClockTest, Initialize) {
|
||||
req.add_requirement("timeofday_clock");
|
||||
//req.add_requirement("timeofday_clock");
|
||||
//"The system clock shall initialize with time equal to computer system time, reference time of 0, and all ratios set to 1.");
|
||||
|
||||
struct timeval res;
|
||||
@ -54,7 +54,7 @@ TEST_F(GetTimeOfDayClockTest, Initialize) {
|
||||
}
|
||||
|
||||
TEST_F(GetTimeOfDayClockTest, ClockSimRatio) {
|
||||
req.add_requirement("timeofday_clock");
|
||||
//req.add_requirement("timeofday_clock");
|
||||
//"The system clock shall provide the ability to change the sim time-to-real time ratio.");
|
||||
|
||||
long long tim_curr;
|
||||
@ -75,7 +75,7 @@ TEST_F(GetTimeOfDayClockTest, ClockSimRatio) {
|
||||
}
|
||||
|
||||
TEST_F(GetTimeOfDayClockTest, ClockRTRatio) {
|
||||
req.add_requirement("timeofday_clock");
|
||||
//req.add_requirement("timeofday_clock");
|
||||
//"The system clock shall provide the ability to adjust the reference time ratio.");
|
||||
|
||||
long long tim_curr, tim_diff;
|
||||
@ -104,7 +104,7 @@ TEST_F(GetTimeOfDayClockTest, ClockRTRatio) {
|
||||
}
|
||||
|
||||
TEST_F(GetTimeOfDayClockTest, ClockSpin) {
|
||||
req.add_requirement("timeofday_clock");
|
||||
//req.add_requirement("timeofday_clock");
|
||||
//"The system clock shall provide the ability to spin (wait) until a specified time is reached.");
|
||||
|
||||
long long tim_curr, spin_time;
|
||||
@ -122,7 +122,7 @@ TEST_F(GetTimeOfDayClockTest, ClockSpin) {
|
||||
|
||||
/* Change and test reference times */
|
||||
TEST_F(GetTimeOfDayClockTest, ReferenceTime) {
|
||||
req.add_requirement("timeofday_clock");
|
||||
//req.add_requirement("timeofday_clock");
|
||||
//"The system clock shall provide the ability to set a reference time.");
|
||||
|
||||
long long tic_adjust;
|
||||
@ -143,7 +143,7 @@ TEST_F(GetTimeOfDayClockTest, ReferenceTime) {
|
||||
}
|
||||
|
||||
TEST_F(GetTimeOfDayClockTest, ClockSync) {
|
||||
req.add_requirement("timeofday_clock");
|
||||
//req.add_requirement("timeofday_clock");
|
||||
//"The system clock shall provide the ability to sync reference time to wall clock time");
|
||||
|
||||
double align_tics_mult;
|
||||
|
@ -5,20 +5,20 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
# created to the list.
|
||||
TESTS = TPROCTEClock_test BC635Clock_test
|
||||
|
||||
OTHER_OBJECTS = ../../SimObject/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
|
@ -17,13 +17,13 @@
|
||||
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/Clock/include/Clock.hh"
|
||||
#include "sim_services/Clock/include/clock_proto.h"
|
||||
#include "sim_services/Clock/include/GetTimeOfDayClock.hh"
|
||||
#include "sim_services/Clock/include/TPROCTEClock.hh"
|
||||
#include "sim_services/Clock/include/BC635Clock.hh"
|
||||
#include "sim_services/SimObject/include/JobData.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/Clock.hh"
|
||||
#include "trick/clock_proto.h"
|
||||
#include "trick/GetTimeOfDayClock.hh"
|
||||
#include "trick/TPROCTEClock.hh"
|
||||
#include "trick/BC635Clock.hh"
|
||||
#include "trick/JobData.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
@ -37,14 +37,14 @@ class TPROCTEClockTest : public ::testing::Test {
|
||||
virtual void SetUp() {}
|
||||
virtual void TearDown() {}
|
||||
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
} ;
|
||||
|
||||
//std::map< std::string , unsigned int > TPROCTEClockTest::num_reqs;
|
||||
|
||||
/* Ensure clock initializes correctly */
|
||||
TEST_F(TPROCTEClockTest, Initialize) {
|
||||
req.add_requirement("TPROCTE_clock");
|
||||
//req.add_requirement("TPROCTE_clock");
|
||||
//"The TPROCTE clock shall initialize reference time of 0, and all ratios set to 1.");
|
||||
|
||||
/* General expected clock initialization */
|
||||
@ -60,7 +60,7 @@ TEST_F(TPROCTEClockTest, Initialize) {
|
||||
/* Run tests for when no hardware is available */
|
||||
#ifndef _TPRO_CTE
|
||||
TEST_F(TPROCTEClockTest, NoHardware) {
|
||||
req.add_requirement("TPROCTE_clock");
|
||||
//req.add_requirement("TPROCTE_clock");
|
||||
//"The TPROCTE clock shall display error messages when attempting to use its functions with no hardware");
|
||||
|
||||
long long req_time = rand();
|
||||
@ -83,7 +83,7 @@ TEST_F(TPROCTEClockTest, NoHardware) {
|
||||
|
||||
/* Ensure generic clock functions work properly */
|
||||
TEST_F(TPROCTEClockTest, TestRefTimes) {
|
||||
req.add_requirement("TPROCTE_clock");
|
||||
//req.add_requirement("TPROCTE_clock");
|
||||
//"The TPROCTE clock shall provide the ability to adjust the reference time");
|
||||
|
||||
long long secs_remainder;
|
||||
|
2
trick_source/sim_services/Executive/test/.gitignore
vendored
Normal file
2
trick_source/sim_services/Executive/test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.o
|
||||
Executive_test
|
@ -5,17 +5,15 @@
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#define protected public
|
||||
#include "sim_services/Executive/include/Exec_exception.hh"
|
||||
#include "sim_services/Executive/include/Executive.hh"
|
||||
#include "sim_services/Executive/include/exec_proto.h"
|
||||
#include "sim_services/Executive/include/exec_proto.hh"
|
||||
#include "sim_services/Message/include/MessagePublisher.hh"
|
||||
#include "sim_services/Message/include/MessageCout.hh"
|
||||
#include "sim_services/SimObject/include/SimObject.hh"
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "sim_services/MemoryManager/include/memorymanager_c_intf.h"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
|
||||
#include "trick/ExecutiveException.hh"
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/exec_proto.h"
|
||||
#include "trick/exec_proto.hh"
|
||||
#include "trick/MessagePublisher.hh"
|
||||
#include "trick/MessageCout.hh"
|
||||
#include "trick/SimObject.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "trick/memorymanager_c_intf.h"
|
||||
|
||||
void sig_hand(int sig) ;
|
||||
void ctrl_c_hand(int sig) ;
|
||||
@ -227,7 +225,7 @@ class ExecutiveTest : public ::testing::Test {
|
||||
Trick::MessagePublisher mpublisher ;
|
||||
Trick::MessageCout mcout ;
|
||||
Trick::MemoryManager mm ;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
|
||||
|
||||
ExecutiveTest() {}
|
||||
@ -281,13 +279,13 @@ void ExecutiveTest::SetUp() {
|
||||
/* JOB TESTS */
|
||||
|
||||
TEST_F(ExecutiveTest , AddSimObject) {
|
||||
req.add_requirement( "r_exec_jobs");
|
||||
//req.add_requirement( "r_exec_jobs");
|
||||
//"The Executive Scheduler shall provide a method for adding simulation objects to the scheduler"
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , AddJobsToQueue) {
|
||||
req.add_requirement( "r_exec_jobs");
|
||||
//req.add_requirement( "r_exec_jobs");
|
||||
//"The Executive Scheduler shall sort jobs with executive job classes in ScheduledJobQueues"
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
|
||||
@ -322,7 +320,7 @@ TEST_F(ExecutiveTest , AddJobsToQueue) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , JobQueueNonScheduledIDs) {
|
||||
req.add_requirement("r_exec_jobs");
|
||||
//req.add_requirement("r_exec_jobs");
|
||||
//"The Executive Scheduler shall assign job class id of the following classes < 1000, default_data , input_processor , initialization , top_of_frame , end_of_frame , shutdown , freeze_init , freeze_scheduled , freeze_automatic, freeze , unfreeze, and exec_time_tic_changed"
|
||||
EXPECT_LT( get_class_map_value("default_data") , 1000 ) ;
|
||||
EXPECT_LT( get_class_map_value("input_processor") , 1000 ) ;
|
||||
@ -339,20 +337,20 @@ TEST_F(ExecutiveTest , JobQueueNonScheduledIDs) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , AddScheduledJobClass) {
|
||||
req.add_requirement("1630595230");
|
||||
//req.add_requirement("1630595230");
|
||||
//"The Executive Scheduler shall provide a method for adding scheduled job class names"
|
||||
// some names were added in the SetUp method
|
||||
EXPECT_EQ( get_class_map_value("automatic") , 1000 ) ;
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , JobQueueStartIndex) {
|
||||
req.add_requirement("r_exec_jobs");
|
||||
//req.add_requirement("r_exec_jobs");
|
||||
//"The Executive Scheduler shall assign the first scheduled job class id = 1000"
|
||||
EXPECT_EQ( get_class_map_value("automatic") , 1000 ) ;
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , JobQueueNameOrder) {
|
||||
req.add_requirement("r_exec_jobs");
|
||||
//req.add_requirement("r_exec_jobs");
|
||||
//"The Executive Scheduler shall increment the job class id for each additional scheduled job class"
|
||||
|
||||
EXPECT_EQ( get_class_map_value("automatic") , 1000 ) ;
|
||||
@ -365,7 +363,7 @@ TEST_F(ExecutiveTest , JobQueueNameOrder) {
|
||||
// Job class ordering is tested in ScheduledJobQueue.
|
||||
|
||||
TEST_F(ExecutiveTest , AddDepends) {
|
||||
req.add_requirement("r_exec_jobs");
|
||||
//req.add_requirement("r_exec_jobs");
|
||||
//"The Executive Scheduler shall provide the capability to add dependency jobs to scheduled jobs"
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
@ -391,7 +389,7 @@ TEST_F(ExecutiveTest , AddDepends) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , UnhandledJobs) {
|
||||
req.add_requirement("r_exec_jobs");
|
||||
//req.add_requirement("r_exec_jobs");
|
||||
//"The Executive Scheduler shall provide the capability to list jobs not handled by any scheduler."
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -401,7 +399,7 @@ TEST_F(ExecutiveTest , UnhandledJobs) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , JobCycleNotDivisibleByTimeTic) {
|
||||
req.add_requirement("r_exec_jobs");
|
||||
//req.add_requirement("r_exec_jobs");
|
||||
//"The Executive Scheduler shall provide the capability to list jobs not handled by any scheduler."
|
||||
|
||||
EXPECT_EQ(exec_get_time_tic_value(), 1000000) ;
|
||||
@ -412,7 +410,7 @@ TEST_F(ExecutiveTest , JobCycleNotDivisibleByTimeTic) {
|
||||
/* INITIALIZATION */
|
||||
|
||||
TEST_F(ExecutiveTest , GoodInitialization) {
|
||||
req.add_requirement("2605574440") ;
|
||||
//req.add_requirement("2605574440") ;
|
||||
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
|
||||
@ -434,7 +432,7 @@ TEST_F(ExecutiveTest , GoodInitialization) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ErrorDefaultData) {
|
||||
req.add_requirement("773089468") ;
|
||||
//req.add_requirement("773089468") ;
|
||||
|
||||
so1.add_job(0, 101, "default_data", NULL, 1, "return_error", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
@ -455,7 +453,7 @@ TEST_F(ExecutiveTest , ErrorDefaultData) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ErrorInputProcessor) {
|
||||
req.add_requirement("773089468") ;
|
||||
//req.add_requirement("773089468") ;
|
||||
|
||||
so1.add_job(0, 101, "input_processor", NULL, 1, "return_error", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
@ -476,7 +474,7 @@ TEST_F(ExecutiveTest , ErrorInputProcessor) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ErrorInitialization) {
|
||||
req.add_requirement("773089468") ;
|
||||
//req.add_requirement("773089468") ;
|
||||
|
||||
so1.add_job(0, 101, "initialization", NULL, 1, "return_error", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
@ -497,7 +495,7 @@ TEST_F(ExecutiveTest , ErrorInitialization) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ExeceptionDefaultData) {
|
||||
req.add_requirement("773089468") ;
|
||||
//req.add_requirement("773089468") ;
|
||||
so1.add_job(0, 102, "default_data", NULL, 1, "throw_exception", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
EXPECT_EQ(exec.init() , -1 ) ;
|
||||
@ -517,7 +515,7 @@ TEST_F(ExecutiveTest , ExeceptionDefaultData) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ExeceptionInputProcessor) {
|
||||
req.add_requirement("773089468") ;
|
||||
//req.add_requirement("773089468") ;
|
||||
so1.add_job(0, 102, "input_processor", NULL, 1, "throw_exception", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
EXPECT_EQ(exec.init() , -1 ) ;
|
||||
@ -537,7 +535,7 @@ TEST_F(ExecutiveTest , ExeceptionInputProcessor) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ExeceptionInitialization) {
|
||||
req.add_requirement("2605574440") ;
|
||||
//req.add_requirement("2605574440") ;
|
||||
so1.add_job(0, 102, "initialization", NULL, 1, "throw_exception", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
EXPECT_EQ(exec.init() , -1 ) ;
|
||||
@ -559,20 +557,20 @@ TEST_F(ExecutiveTest , ExeceptionInitialization) {
|
||||
/* TIME TESTS */
|
||||
|
||||
TEST_F(ExecutiveTest , IntegerTime) {
|
||||
req.add_requirement("2618149062");
|
||||
//req.add_requirement("2618149062");
|
||||
//"The Executive Scheduler shall track simulation elapsed time by an integer count of tics/second") ;
|
||||
EXPECT_EQ(exec_get_time_tics(), 0) ;
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , DefaultTimeTicValue) {
|
||||
req.add_requirement("2436759852");
|
||||
//req.add_requirement("2436759852");
|
||||
// "The Executive Scheduler shall default to 1,000,000 tics/second") ;
|
||||
EXPECT_EQ(exec_get_time_tic_value(), 1000000) ;
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , AdvanceSimTimeToNextJob) {
|
||||
|
||||
req.add_requirement("2449626778");
|
||||
//req.add_requirement("2449626778");
|
||||
//"The Executive Scheduler shall advance simulation time to the time of the next lowest job call time if the next lowest job call time is less than the next software frame boundary ") ;
|
||||
Trick::Threads * curr_thread ;
|
||||
Trick::JobData * curr_job ;
|
||||
@ -595,7 +593,7 @@ TEST_F(ExecutiveTest , AdvanceSimTimeToNextJob) {
|
||||
|
||||
TEST_F(ExecutiveTest , AdvanceSimTimeToBoundary) {
|
||||
|
||||
req.add_requirement("4140012270");
|
||||
//req.add_requirement("4140012270");
|
||||
// "The Executive Scheduler shall advance simulation time to the time of the next software boundary if the next lowest job call time is greater than or equal to the next software frame boundary ") ;
|
||||
Trick::Threads * curr_thread ;
|
||||
|
||||
@ -615,7 +613,7 @@ TEST_F(ExecutiveTest , AdvanceSimTimeToBoundary) {
|
||||
|
||||
TEST_F(ExecutiveTest , Checkpoint) {
|
||||
|
||||
req.add_requirement("2678139818 1653083281");
|
||||
//req.add_requirement("2678139818 1653083281");
|
||||
//"The Executive Scheduler shall copy all job information to a checkpointable array before a checkpoint is executed") ;
|
||||
|
||||
unsigned int ii = 0 ;
|
||||
@ -696,7 +694,7 @@ TEST_F(ExecutiveTest , Checkpoint) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , ClearScheduledQueues) {
|
||||
req.add_requirement("");
|
||||
//req.add_requirement("");
|
||||
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
|
||||
@ -723,7 +721,7 @@ TEST_F(ExecutiveTest , ClearScheduledQueues) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , Moding) {
|
||||
req.add_requirement("411993330 2253353824 2874482372");
|
||||
//req.add_requirement("411993330 2253353824 2874482372");
|
||||
|
||||
exec.freeze() ;
|
||||
exec.async_freeze_to_exec_command() ;
|
||||
@ -737,7 +735,7 @@ TEST_F(ExecutiveTest , Moding) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , GetJob) {
|
||||
req.add_requirement("");
|
||||
//req.add_requirement("");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -763,7 +761,7 @@ TEST_F(ExecutiveTest , GetJob) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , JobCycle) {
|
||||
req.add_requirement("");
|
||||
//req.add_requirement("");
|
||||
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
EXPECT_NEAR( exec.get_job_cycle(std::string("so1.scheduled_3")) , 3.0 , 0.000001) ;
|
||||
@ -782,7 +780,7 @@ TEST_F(ExecutiveTest , JobCycle) {
|
||||
|
||||
|
||||
TEST_F(ExecutiveTest , SetSignalHandlers) {
|
||||
req.add_requirement("");
|
||||
//req.add_requirement("");
|
||||
|
||||
static struct sigaction sigact;
|
||||
|
||||
@ -826,7 +824,7 @@ TEST_F(ExecutiveTest , SetSignalHandlers) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , JobOnOff) {
|
||||
req.add_requirement("2445198072");
|
||||
//req.add_requirement("2445198072");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -844,7 +842,7 @@ TEST_F(ExecutiveTest , JobOnOff) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , SimObjectOnOff) {
|
||||
req.add_requirement("3132950280");
|
||||
//req.add_requirement("3132950280");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -863,14 +861,14 @@ TEST_F(ExecutiveTest , SimObjectOnOff) {
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , LockMemory) {
|
||||
req.add_requirement("715042410");
|
||||
//req.add_requirement("715042410");
|
||||
// Requires root to run. Will pass if run as root.
|
||||
//EXPECT_EQ(exec.set_lock_memory(true), 0) ;
|
||||
|
||||
}
|
||||
|
||||
TEST_F(ExecutiveTest , SetThreadParameters) {
|
||||
req.add_requirement("3839914374");
|
||||
//req.add_requirement("3839914374");
|
||||
|
||||
so1.add_job(1, 100, "scheduled", NULL, 1, "child_job_1", "TRK") ;
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
|
@ -5,20 +5,20 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
# created to the list.
|
||||
TESTS = Executive_test
|
||||
|
||||
OTHER_OBJECTS = ../../SimObject/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
|
2
trick_source/sim_services/Integrator/test/.gitignore
vendored
Normal file
2
trick_source/sim_services/Integrator/test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.o
|
||||
Integrator_unittest
|
@ -4,14 +4,14 @@
|
||||
// We need access to protected stuff for unit tests!
|
||||
#define protected public
|
||||
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "sim_services/Integrator/include/Integrator.hh"
|
||||
#include "sim_services/Integrator/include/IntegLoopScheduler.hh"
|
||||
#include "sim_services/Executive/include/Executive.hh"
|
||||
#include "sim_services/Executive/include/exec_proto.h"
|
||||
#include "sim_services/Executive/include/exec_proto.hh"
|
||||
#include "sim_services/SimObject/include/SimObject.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "trick/Integrator.hh"
|
||||
#include "trick/IntegLoopScheduler.hh"
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/exec_proto.h"
|
||||
#include "trick/exec_proto.hh"
|
||||
#include "trick/SimObject.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
|
||||
@ -90,7 +90,7 @@ double testSimObject::call_function_double( Trick::JobData* curr_job) {
|
||||
class IntegratorTest : public ::testing::Test {
|
||||
protected:
|
||||
Trick::MemoryManager *memmgr;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
IntegratorTest() { memmgr = new Trick::MemoryManager;}
|
||||
~IntegratorTest() { delete memmgr; }
|
||||
virtual void SetUp() {}
|
||||
@ -104,7 +104,7 @@ class IntegratorLoopTest : public ::testing::Test {
|
||||
Trick::IntegLoopScheduler* IntegLoop ;
|
||||
testSimObject uno;
|
||||
Trick::MemoryManager *memmgr;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
IntegratorLoopTest() { memmgr = new Trick::MemoryManager; IntegLoop = new Trick::IntegLoopScheduler(0.01, &uno) ;}
|
||||
~IntegratorLoopTest() { delete memmgr; delete IntegLoop; }
|
||||
virtual void SetUp() {}
|
||||
@ -119,7 +119,7 @@ class IntegratorLoopTest : public ::testing::Test {
|
||||
|
||||
TEST_F(IntegratorLoopTest, Job_Queue_Init) {
|
||||
|
||||
req.add_requirement("");
|
||||
//req.add_requirement("");
|
||||
Trick::JobData* curr_job;
|
||||
|
||||
exec_add_sim_object(&uno, "uno");
|
||||
@ -241,7 +241,7 @@ void verify_ball_sim_results(BALL *ball,
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Euler) {
|
||||
|
||||
req.add_requirement("2402458648");
|
||||
//req.add_requirement("2402458648");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Euler, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -268,7 +268,7 @@ TEST_F(IntegratorTest, Ball_Euler) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Euler_Cromer) {
|
||||
|
||||
req.add_requirement("215930604");
|
||||
//req.add_requirement("215930604");
|
||||
|
||||
Trick::Euler_Cromer_Integrator *integrator =
|
||||
(Trick::Euler_Cromer_Integrator *) Trick::getIntegrator( Euler_Cromer, 4, 0.01);
|
||||
@ -324,7 +324,7 @@ TEST_F(IntegratorTest, Ball_Nystrom_Lear_2) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Runge_Kutta_2) {
|
||||
|
||||
req.add_requirement("2472195139");
|
||||
//req.add_requirement("2472195139");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Runge_Kutta_2, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -351,7 +351,7 @@ TEST_F(IntegratorTest, Ball_Runge_Kutta_2) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Modified_Midpoint_4) {
|
||||
|
||||
req.add_requirement("2825965576");
|
||||
//req.add_requirement("2825965576");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Modified_Midpoint_4, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -378,7 +378,7 @@ TEST_F(IntegratorTest, Ball_Modified_Midpoint_4) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Runge_Kutta_4) {
|
||||
|
||||
req.add_requirement("2472195141");
|
||||
//req.add_requirement("2472195141");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Runge_Kutta_4, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -405,7 +405,7 @@ TEST_F(IntegratorTest, Ball_Runge_Kutta_4) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Runge_Kutta_Gill_4) {
|
||||
|
||||
req.add_requirement("3039955373");
|
||||
//req.add_requirement("3039955373");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Runge_Kutta_Gill_4, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -432,7 +432,7 @@ TEST_F(IntegratorTest, Ball_Runge_Kutta_Gill_4) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Runge_Kutta_Fehlberg_45) {
|
||||
|
||||
req.add_requirement("674248205");
|
||||
//req.add_requirement("674248205");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Runge_Kutta_Fehlberg_45, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -459,7 +459,7 @@ TEST_F(IntegratorTest, Ball_Runge_Kutta_Fehlberg_45) {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_Runge_Kutta_Fehlberg_78) {
|
||||
|
||||
req.add_requirement("674248511");
|
||||
//req.add_requirement("674248511");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( Runge_Kutta_Fehlberg_78, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -487,7 +487,7 @@ TEST_F(IntegratorTest, Ball_Runge_Kutta_Fehlberg_78) {
|
||||
#if 0
|
||||
TEST_F(IntegratorTest, Ball_ABM) {
|
||||
|
||||
req.add_requirement("3643754476");
|
||||
//req.add_requirement("3643754476");
|
||||
|
||||
Trick::Integrator *integrator = Trick::getIntegrator( ABM_Method, 4, 0.01);
|
||||
ASSERT_TRUE( (void*)integrator != NULL);
|
||||
@ -532,7 +532,7 @@ namespace Trick {
|
||||
|
||||
TEST_F(IntegratorTest, Ball_UserDefined) {
|
||||
|
||||
req.add_requirement("3491920037");
|
||||
//req.add_requirement("3491920037");
|
||||
|
||||
Trick::Donna_Integrator *integrator = INTEG_NEW(Trick::Donna_Integrator);
|
||||
integrator = new (integrator) Trick::Donna_Integrator(0, 0.1);
|
||||
|
@ -5,12 +5,12 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0 -DUSE_ER7_UTILS_INTEGRATORS=1
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -I${TRICK_HOME}/trick_source -I${TRICK_HOME}/include/trick/compat -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0 -DUSE_ER7_UTILS_INTEGRATORS=1
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
@ -18,17 +18,17 @@ TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_
|
||||
TESTS = Integrator_unittest
|
||||
|
||||
OTHER_OBJECTS = \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_ABM_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_Euler_Cromer_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_Euler_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/object_${TRICK_HOST_CPU}/io_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_MM4_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_NL2_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_RK2_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_RK4_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_RKF45_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_RKF78_Integrator.o \
|
||||
${TRICK_HOME}/trick_source/sim_services/Integrator/er7_algorithms/object_${TRICK_HOST_CPU}/io_RKG4_Integrator.o
|
||||
../../include/object_${TRICK_HOST_CPU}/io_ABM_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_Euler_Cromer_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_Euler_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_MM4_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_NL2_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RK2_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RK4_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RKF45_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RKF78_Integrator.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RKG4_Integrator.o
|
||||
|
||||
OTHER_OBJECTS += \
|
||||
${TRICK_HOME}/trick_source/er7_utils/integration/*/object_${TRICK_HOST_CPU}/*.o \
|
||||
@ -50,5 +50,5 @@ Integrator_unittest.o : Integrator_unittest.cc
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c $<
|
||||
|
||||
Integrator_unittest : Integrator_unittest.o
|
||||
$(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
|
||||
$(TRICK_LD) $(TRICK_LDFLAGS) -o $@ $^ $(OTHER_OBJECTS) $(TRICK_LIBS) $(TRICK_EXEC_LINK_LIBS)
|
||||
|
||||
|
20
trick_source/sim_services/MemoryManager/test/.gitignore
vendored
Normal file
20
trick_source/sim_services/MemoryManager/test/.gitignore
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
*.o
|
||||
.icg_no_found
|
||||
Bitfield_tests
|
||||
MM_alloc_deps
|
||||
MM_clear_var_unittest
|
||||
MM_creation_unittest
|
||||
MM_declare_extern_var_unittest
|
||||
MM_declare_var_2_unittest
|
||||
MM_declare_var_unittest
|
||||
MM_delete_var_unittest
|
||||
MM_get_enumerated
|
||||
MM_read_checkpoint
|
||||
MM_ref_attributes_unittest
|
||||
MM_ref_name_from_address
|
||||
MM_resize_array_unittest
|
||||
MM_sizeof_type_unittest
|
||||
MM_strdup_unittest
|
||||
MM_write_checkpoint
|
||||
MM_write_checkpoint_hexfloat
|
||||
MM_write_var_unittest
|
@ -6,8 +6,8 @@
|
||||
#include <map>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/MemoryManager/include/bitfield_proto.h"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/bitfield_proto.h"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
@ -65,7 +65,7 @@ typedef struct {
|
||||
class BitfieldsTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
|
||||
BitfieldsTest() {}
|
||||
~BitfieldsTest() {}
|
||||
@ -136,7 +136,7 @@ class BitfieldsTest : public ::testing::Test {
|
||||
|
||||
|
||||
TEST_F(BitfieldsTest, UnsignedInt) {
|
||||
req.add_requirement("3119954850") ;
|
||||
//req.add_requirement("3119954850") ;
|
||||
|
||||
int bitSizes[4] = {14, 5, 12, 1};
|
||||
|
||||
@ -144,7 +144,7 @@ TEST_F(BitfieldsTest, UnsignedInt) {
|
||||
}
|
||||
|
||||
TEST_F(BitfieldsTest, UnsignedChar) {
|
||||
req.add_requirement("3119954850") ;
|
||||
//req.add_requirement("3119954850") ;
|
||||
|
||||
int bitSizes[4] = {3, 2, 2, 1};
|
||||
|
||||
@ -152,14 +152,14 @@ TEST_F(BitfieldsTest, UnsignedChar) {
|
||||
}
|
||||
|
||||
TEST_F(BitfieldsTest, UnsignedShort) {
|
||||
req.add_requirement("3119954850") ;
|
||||
//req.add_requirement("3119954850") ;
|
||||
|
||||
int bitSizes[4] = {4, 2, 9, 1};
|
||||
|
||||
bitTest <unsigned short, ushortBits> (bitSizes, false);
|
||||
}
|
||||
TEST_F(BitfieldsTest, Int) {
|
||||
req.add_requirement("1151502390");
|
||||
//req.add_requirement("1151502390");
|
||||
|
||||
int bitSizes[4] = {7, 16, 3, 6};
|
||||
|
||||
@ -167,7 +167,7 @@ TEST_F(BitfieldsTest, Int) {
|
||||
}
|
||||
|
||||
TEST_F(BitfieldsTest, Char) {
|
||||
req.add_requirement("1151502390") ;
|
||||
//req.add_requirement("1151502390") ;
|
||||
|
||||
int bitSizes[4] = {2, 2, 2, 2};
|
||||
|
||||
@ -175,7 +175,7 @@ TEST_F(BitfieldsTest, Char) {
|
||||
}
|
||||
|
||||
TEST_F(BitfieldsTest, Short) {
|
||||
req.add_requirement("1151502390") ;
|
||||
//req.add_requirement("1151502390") ;
|
||||
|
||||
int bitSizes[4] = {8, 1, 2, 5};
|
||||
|
||||
@ -183,7 +183,7 @@ TEST_F(BitfieldsTest, Short) {
|
||||
}
|
||||
|
||||
TEST_F(BitfieldsTest, Mix) {
|
||||
req.add_requirement("1151502390") ;
|
||||
//req.add_requirement("1151502390") ;
|
||||
|
||||
int bitSizes[4] = {3, 8, 9, 12};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
|
||||
|
||||
TEST(MM_creation, NonNull) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "MM_test.hh"
|
||||
#include <iostream>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "MM_test.hh"
|
||||
#include "MM_get_enumerated.hh"
|
||||
#include "sim_services/MemoryManager/include/vval.h"
|
||||
#include "trick/vval.h"
|
||||
|
||||
// MM_sizeof_type
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "MM_user_defined_types.hh"
|
||||
#include "MM_test.hh"
|
||||
#include <iostream>
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "MM_user_defined_types.hh"
|
||||
#include "MM_test.hh"
|
||||
#include <iostream>
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "MM_user_defined_types.hh"
|
||||
#include "MM_test.hh"
|
||||
#include <iostream>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef MM_TEST_HH
|
||||
#define MM_TEST_HH
|
||||
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
|
||||
const char* ISO_6429_Restore_Default = "\x1b[00m";
|
||||
const char* ISO_6429_Bold = "\x1b[01m";
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "MM_user_defined_types.hh"
|
||||
#include "MM_test.hh"
|
||||
#include <iostream>
|
||||
|
@ -5,15 +5,15 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
#COVERAGE_FLAGS += -fprofile-arcs -ftest-coverage -O0
|
||||
#TRICK_LDFLAGS += ${COVERAGE_FLAGS}
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra ${COVERAGE_FLAGS}
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra ${COVERAGE_FLAGS}
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
@ -37,8 +37,8 @@ TESTS = MM_creation_unittest \
|
||||
MM_ref_name_from_address \
|
||||
Bitfield_tests
|
||||
|
||||
OTHER_OBJECTS = ../../SimObject/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
@ -91,24 +91,24 @@ clean :
|
||||
# Builds gtest.a and gtest_main.a.
|
||||
|
||||
io_MM_user_defined_types.o : MM_user_defined_types.hh
|
||||
${TRICK_HOME}/bin/ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c io_src/io_MM_user_defined_types.cpp
|
||||
${TRICK_HOME}/bin/trick-ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c ../../include/io_src/io_MM_user_defined_types.cpp
|
||||
|
||||
io_MM_alloc_deps.o : MM_alloc_deps.hh
|
||||
${TRICK_HOME}/bin/ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c io_src/io_MM_alloc_deps.cpp
|
||||
${TRICK_HOME}/bin/trick-ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c ../../include/io_src/io_MM_alloc_deps.cpp
|
||||
|
||||
io_MM_write_checkpoint.o : MM_write_checkpoint.hh
|
||||
${TRICK_HOME}/bin/ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c io_src/io_MM_write_checkpoint.cpp
|
||||
${TRICK_HOME}/bin/trick-ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c ../../include/io_src/io_MM_write_checkpoint.cpp
|
||||
|
||||
io_MM_get_enumerated.o : MM_get_enumerated.hh
|
||||
${TRICK_HOME}/bin/ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c io_src/io_MM_get_enumerated.cpp
|
||||
${TRICK_HOME}/bin/trick-ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c ../../include/io_src/io_MM_get_enumerated.cpp
|
||||
|
||||
io_MM_ref_name_from_address.o : MM_ref_name_from_address.hh
|
||||
${TRICK_HOME}/bin/ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c io_src/io_MM_ref_name_from_address.cpp
|
||||
${TRICK_HOME}/bin/trick-ICG -s $(TRICK_CPPFLAGS) $<
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c ../../include/io_src/io_MM_ref_name_from_address.cpp
|
||||
|
||||
MM_creation_unittest.o : MM_creation_unittest.cc
|
||||
$(TRICK_CPPC) $(TRICK_CPPFLAGS) -c $<
|
||||
|
3
trick_source/sim_services/MonteCarlo/test/.gitignore
vendored
Normal file
3
trick_source/sim_services/MonteCarlo/test/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.o
|
||||
MonteCarlo_exceptions
|
||||
MonteCarlo_test
|
@ -5,10 +5,10 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
ifeq ($(HAVE_GSL),1)
|
||||
TRICK_CXXFLAGS += -D_HAVE_GSL
|
||||
ifneq ($(GSL_HOME),/usr)
|
||||
@ -16,7 +16,7 @@ TRICK_CXXFLAGS += -I${GSL_HOME}/include
|
||||
endif
|
||||
endif
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick_pyip.a ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick_pyip.a ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
@ -24,10 +24,10 @@ TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_
|
||||
TESTS = MonteCarlo_test MonteCarlo_exceptions
|
||||
|
||||
|
||||
OTHER_OBJECTS = ../../SimObject/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o \
|
||||
../object_${TRICK_HOST_CPU}/io_MonteCarlo.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RemoteShell.o
|
||||
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_MonteCarlo.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_RemoteShell.o
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
|
@ -6,12 +6,12 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/MonteCarlo/include/MonteCarlo.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVar.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVarFile.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVarRandom.hh"
|
||||
#include "sim_services/SimObject/include/SimObject.hh"
|
||||
#include "sim_services/Executive/include/Exec_exception.hh"
|
||||
#include "trick/MonteCarlo.hh"
|
||||
#include "trick/MonteVar.hh"
|
||||
#include "trick/MonteVarFile.hh"
|
||||
#include "trick/MonteVarRandom.hh"
|
||||
#include "trick/SimObject.hh"
|
||||
#include "trick/ExecutiveException.hh"
|
||||
|
||||
|
||||
void sig_hand(int sig) ;
|
||||
@ -45,7 +45,7 @@ TEST_F(MonteCarloTest, MonteVarFile_ColException) {
|
||||
try {
|
||||
Trick::MonteVarFile var("time_to_fire_1", "M_jet_firings_inline", 7) ;
|
||||
var.get_next_value();
|
||||
} catch (Trick::Exec_exception &e) {
|
||||
} catch (Trick::ExecutiveException &e) {
|
||||
std::cout << e.message << std::endl;
|
||||
got_exception = true;
|
||||
}
|
||||
@ -58,7 +58,7 @@ TEST_F(MonteCarloTest, MonteVarFile_BadFileException) {
|
||||
try {
|
||||
Trick::MonteVarFile var("time_to_fire_1", "_M_jet_firings_inline", 1) ;
|
||||
var.get_next_value();
|
||||
} catch (Trick::Exec_exception &e) {
|
||||
} catch (Trick::ExecutiveException &e) {
|
||||
std::cout << e.message << std::endl;
|
||||
got_exception = true;
|
||||
}
|
||||
@ -74,7 +74,7 @@ TEST_F(MonteCarloTest, MonteVarFile_FileException) {
|
||||
var.input_file_stream->close();
|
||||
var.get_next_value();
|
||||
var.get_next_value();
|
||||
} catch (Trick::Exec_exception &e) {
|
||||
} catch (Trick::ExecutiveException &e) {
|
||||
std::cout << e.message << std::endl;
|
||||
got_exception = true;
|
||||
}
|
||||
@ -91,7 +91,7 @@ TEST_F(MonteCarloTest, TestMonteVarRandom_Exception) {
|
||||
var1.set_max(4.000001) ;
|
||||
exec.add_variable(&var1) ;
|
||||
var1.get_next_value();
|
||||
} catch (Trick::Exec_exception &e) {
|
||||
} catch (Trick::ExecutiveException &e) {
|
||||
std::cout << e.message;
|
||||
got_exception = true;
|
||||
}
|
||||
|
@ -9,22 +9,22 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/Executive/include/Exec_exception.hh"
|
||||
#include "sim_services/Executive/include/Executive.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteCarlo.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVar.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVarCalculated.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVarFile.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVarFixed.hh"
|
||||
#include "sim_services/MonteCarlo/include/MonteVarRandom.hh"
|
||||
#include "sim_services/MonteCarlo/include/montecarlo_c_intf.h"
|
||||
#include "sim_services/Executive/include/exec_proto.h"
|
||||
#include "sim_services/Executive/include/exec_proto.hh"
|
||||
#include "sim_services/SimObject/include/SimObject.hh"
|
||||
#include "sim_services/MemoryManager/include/MemoryManager.hh"
|
||||
#include "sim_services/MemoryManager/include/memorymanager_c_intf.h"
|
||||
#include "trick_utils/math/include/rand_generator.h"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/ExecutiveException.hh"
|
||||
#include "trick/Executive.hh"
|
||||
#include "trick/MonteCarlo.hh"
|
||||
#include "trick/MonteVar.hh"
|
||||
#include "trick/MonteVarCalculated.hh"
|
||||
#include "trick/MonteVarFile.hh"
|
||||
#include "trick/MonteVarFixed.hh"
|
||||
#include "trick/MonteVarRandom.hh"
|
||||
#include "trick/montecarlo_c_intf.h"
|
||||
#include "trick/exec_proto.h"
|
||||
#include "trick/exec_proto.hh"
|
||||
#include "trick/SimObject.hh"
|
||||
#include "trick/MemoryManager.hh"
|
||||
#include "trick/memorymanager_c_intf.h"
|
||||
#include "trick/rand_generator.h"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
void sig_hand(int sig) ;
|
||||
void child_handler(int sig) ;
|
||||
@ -83,7 +83,7 @@ class MonteCarloTest : public ::testing::Test {
|
||||
Trick::MonteCarlo exec;
|
||||
Trick::Executive executive;
|
||||
testSimObject so1 ;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
Trick::MemoryManager mm ;
|
||||
|
||||
MonteCarloTest() { exec_register_scheduler(&exec) ; }
|
||||
@ -103,7 +103,7 @@ class MonteCarloTest : public ::testing::Test {
|
||||
} ;
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Master_Init) {
|
||||
req.add_requirement("722132127");
|
||||
//req.add_requirement("722132127");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -119,7 +119,7 @@ TEST_F(MonteCarloTest , Job_Queue_Master_Init) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Master_Pre) {
|
||||
req.add_requirement("587551115");
|
||||
//req.add_requirement("587551115");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -135,7 +135,7 @@ TEST_F(MonteCarloTest , Job_Queue_Master_Pre) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Master_Post) {
|
||||
req.add_requirement("4165308678");
|
||||
//req.add_requirement("4165308678");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -151,7 +151,7 @@ TEST_F(MonteCarloTest , Job_Queue_Master_Post) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Master_Shutdown) {
|
||||
req.add_requirement("3461634900");
|
||||
//req.add_requirement("3461634900");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -167,7 +167,7 @@ TEST_F(MonteCarloTest , Job_Queue_Master_Shutdown) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Slave_Init) {
|
||||
req.add_requirement("1412318284");
|
||||
//req.add_requirement("1412318284");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -183,7 +183,7 @@ TEST_F(MonteCarloTest , Job_Queue_Slave_Init) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Slave_Pre) {
|
||||
req.add_requirement("3301658297");
|
||||
//req.add_requirement("3301658297");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -199,7 +199,7 @@ TEST_F(MonteCarloTest , Job_Queue_Slave_Pre) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Slave_Post) {
|
||||
req.add_requirement("3882184138");
|
||||
//req.add_requirement("3882184138");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -215,7 +215,7 @@ TEST_F(MonteCarloTest , Job_Queue_Slave_Post) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Job_Queue_Slave_Shutdown) {
|
||||
req.add_requirement("350185460");
|
||||
//req.add_requirement("350185460");
|
||||
|
||||
Trick::JobData * curr_job ;
|
||||
|
||||
@ -231,7 +231,7 @@ TEST_F(MonteCarloTest , Job_Queue_Slave_Shutdown) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest , Good_Initialization) {
|
||||
req.add_requirement("1452306647");
|
||||
//req.add_requirement("1452306647");
|
||||
|
||||
exec_add_sim_object(&so1 , "so1") ;
|
||||
EXPECT_EQ(exec.execute_monte() , 0 ) ;
|
||||
@ -254,7 +254,7 @@ TEST_F(MonteCarloTest , TestDefaultValues) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest, TestSettingValues) {
|
||||
req.add_requirement("2840823120");
|
||||
//req.add_requirement("2840823120");
|
||||
|
||||
exec.set_enabled(true) ;
|
||||
EXPECT_EQ(exec.get_enabled(), true) ;
|
||||
@ -292,7 +292,7 @@ TEST_F(MonteCarloTest, TestRanges) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest, TestSlaves) {
|
||||
req.add_requirement("1098748189");
|
||||
//req.add_requirement("1098748189");
|
||||
|
||||
Trick::MonteSlave slave0("localhost") ;
|
||||
Trick::MonteSlave slave1("WonderWoman") ;
|
||||
@ -321,7 +321,7 @@ TEST_F(MonteCarloTest, TestSlaves) {
|
||||
TEST_F(MonteCarloTest, MonteVarFile) {
|
||||
std::string buffer;
|
||||
std::string buffer2;
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
|
||||
// Test MonteVarFile
|
||||
Trick::MonteVarFile var0("time_to_fire_1", "M_jet_firings_inline", 2) ;
|
||||
@ -334,7 +334,7 @@ TEST_F(MonteCarloTest, MonteVarFile) {
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_Gaussian) {
|
||||
std::string str;
|
||||
double value;
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
|
||||
// Test MonteVarRandom
|
||||
// Gaussian
|
||||
@ -366,7 +366,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_Gaussian) {
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_Poisson) {
|
||||
std::string str;
|
||||
double value;
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
|
||||
// Test MonteVarRandom
|
||||
// Poisson
|
||||
@ -401,7 +401,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_Poisson) {
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_Flat) {
|
||||
std::string str;
|
||||
double value;
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
|
||||
// Test MonteVarRandom
|
||||
// Flat
|
||||
@ -428,7 +428,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_Flat) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_NonGSL) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
|
||||
Trick::MonteVarRandom var4("time_to_fire_1", Trick::MonteVarRandom::GAUSSIAN) ;
|
||||
var4.set_mu(4.0) ;
|
||||
@ -451,7 +451,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_NonGSL) {
|
||||
}
|
||||
|
||||
TEST_F(MonteCarloTest, MonteVarFixed) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
|
||||
// Test MonteVarFixed
|
||||
Trick::MonteVarFixed var5("time_to_fire_5", 3.1415) ;
|
||||
@ -464,7 +464,7 @@ TEST_F(MonteCarloTest, MonteVarFixed) {
|
||||
|
||||
///@brief check that the final distribution is correct. (Bug 6950: The non-GSL was wrong for GAUSSIAN and FLAT)
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_Gaussian_distributionMatchesSpec) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -517,7 +517,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_Gaussian_distributionMatchesSpec) {
|
||||
|
||||
///@brief set_sigma_range(int) feature was only implemented for nonGsl with non-C++11 fallbacks
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_Gaussian_nonGslSigmaRangeDefaulted_maxDeviationFromMeanIs1Sigma) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -569,7 +569,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_Gaussian_nonGslSigmaRangeDefaulted_maxDevi
|
||||
|
||||
///@brief test set_sigma_range feature works for STL random
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_nonGslSigmaRangeDefaulted_maxDeviationFromMeanIs1Sigma) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -625,7 +625,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_nonGslSigmaRangeDefaulted_maxD
|
||||
#if (defined(_HAVE_TR1_RANDOM) || defined(_HAVE_STL_RANDOM))
|
||||
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_distributionMatchesSpec) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -676,7 +676,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_distributionMatchesSpec) {
|
||||
|
||||
///@breif test relative min/max work as expected for STL
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_relativeMinMaxWorks) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -723,7 +723,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_relativeMinMaxWorks) {
|
||||
|
||||
///@breif test relative min/max works after calling set_mu, as expected for STL
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_callSetMu_relativeMinMaxWorks) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -771,7 +771,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_callSetMu_relativeMinMaxWorks)
|
||||
|
||||
///@breif test absolute min/max works after changing from relative, as expected for STL
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_changeToAbsolute_MinMaxWorks) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
@ -819,7 +819,7 @@ TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_changeToAbsolute_MinMaxWorks)
|
||||
|
||||
///@brief test that the sequence repeats after calling set_seed
|
||||
TEST_F(MonteCarloTest, MonteVarRandom_StlGaussian_setSeed_TakesEffect) {
|
||||
req.add_requirement("3932595803");
|
||||
//req.add_requirement("3932595803");
|
||||
std::string str ;
|
||||
double value ;
|
||||
|
||||
|
2
trick_source/sim_services/ScheduledJobQueue/test/.gitignore
vendored
Normal file
2
trick_source/sim_services/ScheduledJobQueue/test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.o
|
||||
ScheduledJobQueue_test
|
@ -5,20 +5,20 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
# created to the list.
|
||||
TESTS = ScheduledJobQueue_test
|
||||
|
||||
OTHER_OBJECTS = ../../SimObject/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
|
@ -4,8 +4,8 @@
|
||||
#include <signal.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/ScheduledJobQueue/include/ScheduledJobQueue.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/ScheduledJobQueue.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
@ -13,7 +13,7 @@ class ScheduledJobQueueTest : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
Trick::ScheduledJobQueue sjq;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
|
||||
ScheduledJobQueueTest() {}
|
||||
~ScheduledJobQueueTest() {}
|
||||
@ -23,7 +23,7 @@ class ScheduledJobQueueTest : public ::testing::Test {
|
||||
} ;
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , PushJobsbyJobOrder ) {
|
||||
req.add_requirement("815793485");
|
||||
//req.add_requirement("815793485");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
@ -71,7 +71,7 @@ TEST_F( ScheduledJobQueueTest , PushJobsbyJobOrder ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , PushJobsbySimObjectOrder ) {
|
||||
req.add_requirement("512154259");
|
||||
//req.add_requirement("512154259");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
@ -114,7 +114,7 @@ TEST_F( ScheduledJobQueueTest , PushJobsbySimObjectOrder ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , PushJobsbyPhaseOrder ) {
|
||||
req.add_requirement("3144632784");
|
||||
//req.add_requirement("3144632784");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
@ -157,7 +157,7 @@ TEST_F( ScheduledJobQueueTest , PushJobsbyPhaseOrder ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , PushJobsbyJobClassOrder ) {
|
||||
req.add_requirement("925196430");
|
||||
//req.add_requirement("925196430");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
@ -200,7 +200,7 @@ TEST_F( ScheduledJobQueueTest , PushJobsbyJobClassOrder ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , PushJobsIgnoreSimObject ) {
|
||||
req.add_requirement("815793485");
|
||||
//req.add_requirement("815793485");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
@ -243,7 +243,7 @@ TEST_F( ScheduledJobQueueTest , PushJobsIgnoreSimObject ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , TopJob ) {
|
||||
req.add_requirement("");
|
||||
//req.add_requirement("");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
@ -285,7 +285,7 @@ TEST_F( ScheduledJobQueueTest , TopJob ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , FindNextJob ) {
|
||||
req.add_requirement("3664773300 1758653947");
|
||||
//req.add_requirement("3664773300 1758653947");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
long long curr_time ;
|
||||
@ -399,7 +399,7 @@ TEST_F( ScheduledJobQueueTest , FindNextJob ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , TestNextJob ) {
|
||||
req.add_requirement("1758653947 3664773300");
|
||||
//req.add_requirement("1758653947 3664773300");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
long long curr_time ;
|
||||
@ -517,7 +517,7 @@ TEST_F( ScheduledJobQueueTest , TestNextJob ) {
|
||||
}
|
||||
|
||||
TEST_F( ScheduledJobQueueTest , InstrumentBeforeAll ) {
|
||||
req.add_requirement("3990429752");
|
||||
//req.add_requirement("3990429752");
|
||||
|
||||
Trick::JobData * job_ptr ;
|
||||
|
||||
|
2
trick_source/sim_services/Timer/test/.gitignore
vendored
Normal file
2
trick_source/sim_services/Timer/test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.o
|
||||
ITimer_test
|
@ -11,10 +11,10 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "sim_services/Timer/include/ITimer.hh"
|
||||
#include "sim_services/Clock/include/GetTimeOfDayClock.hh"
|
||||
#include "sim_services/SimObject/include/SimObject.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/ITimer.hh"
|
||||
#include "trick/GetTimeOfDayClock.hh"
|
||||
#include "trick/SimObject.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
namespace Trick {
|
||||
|
||||
@ -22,7 +22,7 @@ class ITimerTest : public testing::Test {
|
||||
|
||||
public:
|
||||
Trick::GetTimeOfDayClock dClk;
|
||||
Trick::RequirementScribe req;
|
||||
//Trick::RequirementScribe req;
|
||||
double sec;
|
||||
long long tim_st, tim_elap;
|
||||
|
||||
@ -34,7 +34,7 @@ class ITimerTest : public testing::Test {
|
||||
|
||||
/* Proper initialization of ITimer */
|
||||
TEST_F(ITimerTest, Initialize) {
|
||||
req.add_requirement("timer");
|
||||
//req.add_requirement("timer");
|
||||
//"The ITimer shall initialize with disabled and inactive status.");
|
||||
|
||||
Trick::ITimer *iTim;
|
||||
@ -56,7 +56,7 @@ TEST_F(ITimerTest, Initialize) {
|
||||
|
||||
/* Timer not enabled; ensure no activity when starting, pausing, etc */
|
||||
TEST_F(ITimerTest, TimerNotEnabled) {
|
||||
req.add_requirement("timer");
|
||||
//req.add_requirement("timer");
|
||||
//"The ITimer shall start if and only if the ITimer is enabled to do so.");
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ TEST_F(ITimerTest, TimerNotEnabled) {
|
||||
|
||||
/* Tolerance: 2 ms */
|
||||
TEST_F(ITimerTest, TimerStartSuccess) {
|
||||
req.add_requirement("timer");
|
||||
//req.add_requirement("timer");
|
||||
//"The ITimer shall sleep when commanded, thereby releasing the processor for a specified amount of time.");
|
||||
|
||||
sec = 0.05;
|
||||
@ -110,7 +110,7 @@ TEST_F(ITimerTest, TimerStartSuccess) {
|
||||
}
|
||||
|
||||
TEST_F(ITimerTest, TimerStartReset) {
|
||||
req.add_requirement("timer");
|
||||
//req.add_requirement("timer");
|
||||
//"The ITimer shall reset to a new alarm time when commanded if the current time until alarm has not yet expired.");
|
||||
|
||||
sec = 0.05;
|
||||
@ -138,7 +138,7 @@ TEST_F(ITimerTest, TimerStartReset) {
|
||||
}
|
||||
|
||||
TEST_F(ITimerTest, TimerStartStop) {
|
||||
req.add_requirement("timer");
|
||||
//req.add_requirement("timer");
|
||||
//"The ITimer shall stop when commanded if the time until alarm has not yet expired.");
|
||||
|
||||
sec = 0.05;
|
||||
@ -171,7 +171,7 @@ TEST_F(ITimerTest, TimerStartStop) {
|
||||
|
||||
|
||||
TEST_F(ITimerTest, TimerStartFailure) {
|
||||
req.add_requirement("timer");
|
||||
//req.add_requirement("timer");
|
||||
//"The ITimer shall not initiate with start times that are negative or less than 10 ms");
|
||||
|
||||
sec = 0.05;
|
||||
|
@ -5,20 +5,20 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
# All tests produced by this Makefile. Remember to add new tests you
|
||||
# created to the list.
|
||||
TESTS = ITimer_test
|
||||
|
||||
OTHER_OBJECTS = ../../SimObject/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
OTHER_OBJECTS = ../../include/object_${TRICK_HOST_CPU}/io_JobData.o \
|
||||
../../include/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
|
||||
# House-keeping build targets.
|
||||
|
||||
|
@ -18,7 +18,7 @@ PROGRAMMERS: ( (Robert W. Bailey) (LinCom) (April 1992) )
|
||||
//TODO move to proto
|
||||
void memory_init(void);
|
||||
|
||||
int main( int nargs, char **args) {
|
||||
int master( int nargs, char **args) {
|
||||
|
||||
int ret ;
|
||||
|
||||
|
1
trick_source/trick_utils/comm/test/.gitignore
vendored
Normal file
1
trick_source/trick_utils/comm/test/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
comm_test
|
@ -1,10 +1,10 @@
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/makefiles/Makefile.tricklib
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
|
||||
|
||||
INCLUDE_DIRS = -I$(GTEST_HOME) -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source
|
||||
INCLUDE_DIRS = -I$(GTEST_HOME) -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include
|
||||
|
||||
TRICK_LIBS := ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS := ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
TRICK_CXXFLAGS += ${INCLUDE_DIRS} -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
@ -13,7 +13,7 @@ TRICK_CXXFLAGS += ${INCLUDE_DIRS} -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TESTS = comm_test
|
||||
TEST_CPP = $(subst $(OBJ_DIR)/,,$(subst .o,.cpp,$(CPP_OBJS)))
|
||||
|
||||
OTHER_OBJECTS = ../../../sim_services/SimObject/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
OTHER_OBJECTS = ../../../sim_services/include/object_${TRICK_HOST_CPU}/io_SimObject.o
|
||||
|
||||
default : all
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
class TCBlockioTest : public testing::Test {
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
class TCConnectTest : public testing::Test {
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
|
||||
class TCDevCopyTest : public testing::Test {
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
|
||||
class TCDisconnectTest : public testing::Test {
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
class TCErrorTest : public testing::Test {
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
class TCIsValidTest : public testing::Test {
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
class TCPendingTest : public testing::Test {
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
|
||||
class TCReadByteSwapTest : public testing::Test {
|
||||
|
@ -1,12 +1,12 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "trick_utils/comm/include/tc.h"
|
||||
#include "trick_utils/comm/include/attributes.h"
|
||||
#include "trick_utils/comm/include/hs_msg.h"
|
||||
#include "trick_utils/comm/include/tc_proto.h"
|
||||
#include "trick_utils/comm/include/trick_byteswap.h"
|
||||
#include "trick_utils/comm/include/trick_error_hndlr.h"
|
||||
#include "trick/tc.h"
|
||||
#include "trick/attributes.h"
|
||||
#include "trick/hs_msg.h"
|
||||
#include "trick/tc_proto.h"
|
||||
#include "trick/trick_byteswap.h"
|
||||
#include "trick/trick_error_hndlr.h"
|
||||
|
||||
class TCSetBlockIOTest : public testing::Test {
|
||||
|
||||
|
2
trick_source/trick_utils/interpolator/test/.gitignore
vendored
Normal file
2
trick_source/trick_utils/interpolator/test/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.o
|
||||
Interpolator_unittest
|
@ -1,14 +1,14 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <iostream>
|
||||
#include "trick_utils/interpolator/include/Interpolator.hh"
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
#include "trick/Interpolator.hh"
|
||||
//#include "trick/RequirementScribe.hh"
|
||||
|
||||
#define EXCEPTABLE_ERROR 0.2
|
||||
|
||||
TEST(Interpolator_unittest, OneDimension) {
|
||||
Trick::RequirementScribe req;
|
||||
req.add_requirement("3369678360");
|
||||
//Trick::RequirementScribe req;
|
||||
//req.add_requirement("3369678360");
|
||||
|
||||
bool exception_thrown;
|
||||
double result;
|
||||
@ -94,8 +94,8 @@ TEST(Interpolator_unittest, TwoDimension) {
|
||||
// Reference: http://en.wikipedia.org/wiki/Body_mass_index
|
||||
//
|
||||
|
||||
Trick::RequirementScribe req;
|
||||
req.add_requirement("715834524");
|
||||
//Trick::RequirementScribe req;
|
||||
//req.add_requirement("715834524");
|
||||
|
||||
|
||||
double weight_lb[] = { 88.2, 110.25, 132.3, 154.35, 176.4, 198.45, 220.5, 242.55, 264.65, 286.65, 308.6, 330.75, 352.7};
|
||||
|
@ -5,12 +5,12 @@
|
||||
# make TARGET - makes the given target.
|
||||
# make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CPPFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
|
||||
|
3
trick_source/trick_utils/units/test/.gitignore
vendored
Normal file
3
trick_source/trick_utils/units/test/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.o
|
||||
UnitConvTestSuite
|
||||
UnitTestSuite
|
@ -1,6 +1,6 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "../include/units_conv.h"
|
||||
#include "trick/units_conv.h"
|
||||
|
||||
#define TOL 1e-13
|
||||
/*
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include "../include/Unit.hh"
|
||||
#include "trick/Unit.hh"
|
||||
#include <math.h>
|
||||
#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
//#include "trick_utils/reqs/include/RequirementScribe.hh"
|
||||
|
||||
/*********************FIXME**********************************************************************************
|
||||
* 1. The behavior of the conversion between composite units containing
|
||||
@ -61,6 +61,7 @@ double tolerance(int exp)
|
||||
* cause an error
|
||||
**********************************************************************/
|
||||
|
||||
#if 0
|
||||
void units_requirements(bool isThrow) {
|
||||
Trick::RequirementScribe req;
|
||||
|
||||
@ -71,6 +72,7 @@ void units_requirements(bool isThrow) {
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void clean_up_UCFn(UCFn** ptr)
|
||||
{
|
||||
@ -104,7 +106,7 @@ void test_conversion_no_throw(std::string unitString1, std::string unitString2,
|
||||
clean_up_UCFn(&cf);
|
||||
ASSERT_EQ((UCFn*) NULL, cf);
|
||||
|
||||
units_requirements(false);
|
||||
//units_requirements(false);
|
||||
|
||||
}
|
||||
|
||||
@ -165,13 +167,13 @@ void test_conversion_throw(std::string unitString1, std::string unitString2)
|
||||
}
|
||||
ASSERT_EQ((UCFn*) NULL, cf);
|
||||
|
||||
units_requirements(true);
|
||||
//units_requirements(true);
|
||||
}
|
||||
|
||||
class UnitConversion : public ::testing::Test {
|
||||
|
||||
protected:
|
||||
Trick::RequirementScribe testReq;
|
||||
//Trick::RequirementScribe testReq;
|
||||
|
||||
UnitConversion() {}
|
||||
~UnitConversion() {}
|
||||
@ -647,7 +649,7 @@ TEST_F(UnitConversion, FootPoundsToNewtonMeters)
|
||||
|
||||
TEST_F(UnitConversion, FootPoundsToNewtonMetersWithConvertTo)
|
||||
{
|
||||
testReq.add_requirement("2060756805");
|
||||
//testReq.add_requirement("2060756805");
|
||||
|
||||
ASSERT_NO_THROW(Unit NewtonMeter("N*m"));
|
||||
Unit NewtonMeter("N*m");
|
||||
@ -704,7 +706,7 @@ TEST_F(UnitConversion, PerSecondPerSecondToPerSecondSquared)
|
||||
|
||||
TEST_F(UnitConversion, GetUnitName)
|
||||
{
|
||||
testReq.add_requirement("");
|
||||
//testReq.add_requirement("");
|
||||
|
||||
Unit meter_per_second_squared("m/s2");
|
||||
std::string unit = "m/s2";
|
||||
@ -716,7 +718,7 @@ TEST_F(UnitConversion, GetUnitName)
|
||||
|
||||
TEST_F(UnitConversion, SetUnitName)
|
||||
{
|
||||
testReq.add_requirement("");
|
||||
//testReq.add_requirement("");
|
||||
|
||||
Unit meter_per_second_squared("m/s2");
|
||||
Unit copy;
|
||||
@ -737,7 +739,7 @@ TEST_F(UnitConversion, SetUnitName)
|
||||
|
||||
TEST_F(UnitConversion, InvalidUnit)
|
||||
{
|
||||
testReq.add_requirement("2743423356");
|
||||
//testReq.add_requirement("2743423356");
|
||||
|
||||
std::cerr << "The purpose of this test is to throw to an exception. Error messages are expected." << std::endl;
|
||||
ASSERT_THROW(Unit u("foo"), Unit::CONVERSION_ERROR);
|
||||
@ -751,7 +753,7 @@ TEST_F(UnitConversion, MissingProduct)
|
||||
|
||||
TEST_F(UnitConversion, InvalidExponent)
|
||||
{
|
||||
testReq.add_requirement("2743423356");
|
||||
//testReq.add_requirement("2743423356");
|
||||
|
||||
std::cerr << "The purpose of this test is to throw to an exception. Error messages are expected." << std::endl;
|
||||
ASSERT_THROW(Unit u("m4"), Unit::CONVERSION_ERROR);
|
||||
@ -760,7 +762,7 @@ TEST_F(UnitConversion, InvalidExponent)
|
||||
|
||||
TEST_F(UnitConversion, InvalidRatio)
|
||||
{
|
||||
testReq.add_requirement("2743423356");
|
||||
//testReq.add_requirement("2743423356");
|
||||
|
||||
std::cerr << "The purpose of this test is to throw to an exception. Error messages are expected." << std::endl;
|
||||
ASSERT_THROW(Unit u("/C"), Unit::CONVERSION_ERROR);
|
||||
@ -769,7 +771,7 @@ TEST_F(UnitConversion, InvalidRatio)
|
||||
|
||||
TEST_F(UnitConversion, InvalidFootPound)
|
||||
{
|
||||
testReq.add_requirement("2743423356");
|
||||
//testReq.add_requirement("2743423356");
|
||||
std::cerr << "The purpose of this test is to throw to an exception. Error messages are expected." << std::endl;
|
||||
ASSERT_THROW(Unit u("lbfft"), Unit::CONVERSION_ERROR);
|
||||
}
|
||||
@ -779,7 +781,7 @@ TEST_F(UnitConversion, InvalidFootPound)
|
||||
|
||||
TEST_F(UnitConversion, NewtonMeterToInvalidFootPound)
|
||||
{
|
||||
testReq.add_requirement("2743423356");
|
||||
//testReq.add_requirement("2743423356");
|
||||
Unit unit1("N*m");
|
||||
|
||||
std::cerr << "The purpose of this test is to throw to an exception. Error messages are expected." << std::endl;
|
||||
|
@ -4,12 +4,12 @@
|
||||
# make TARGET - makes the given target.
|
||||
# # make clean - removes all files generated by make.
|
||||
|
||||
include ${TRICK_HOME}/makefiles/Makefile.common
|
||||
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
|
||||
|
||||
# Flags passed to the preprocessor.
|
||||
TRICK_CPPFLAGS += -I${GTEST_HOME}/include -I$(TRICK_HOME)/trick_source -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
TRICK_CPPFLAGS += -I${GTEST_HOME}/include -I$(TRICK_HOME)/include -g -Wall -Wextra -DGTEST_HAS_TR1_TUPLE=0
|
||||
|
||||
TRICK_LIBS = ${TRICK_HOME}/lib_${TRICK_HOST_CPU}/libtrick_units.a
|
||||
TRICK_LIBS = ${TRICK_LIB_DIR}/libtrick_units.a
|
||||
TRICK_EXEC_LINK_LIBS += ${GTEST_HOME}/lib/libgtest.a ${GTEST_HOME}/lib/libgtest_main.a
|
||||
|
||||
#Added pthreads for Ubuntu
|
||||
|
Loading…
Reference in New Issue
Block a user