diff --git a/matlab/tests/main_runAllTests.m b/matlab/tests/main_runAllTests.m index c5e7161829603d2c852abfc02a68a2162ccc892b..44d43337b3b449ef6497f1ef3ac8893cfa764f7d 100644 --- a/matlab/tests/main_runAllTests.m +++ b/matlab/tests/main_runAllTests.m @@ -4,8 +4,8 @@ % every time a new test-case is define simply add it here test_dcm2q -% test_get_settings_car -% test_get_settings_cycling +test_get_settings_car +test_get_settings_cycling % test_gps_randomized_car % test_gps_randomized_cycling % test_GPSaidedINS_car diff --git a/matlab/tests/test_dcm2q.m b/matlab/tests/test_dcm2q.m index a48088c0967724fd9d424b8de1b98af553c03741..2017d1d4c8c303a0eb3dec14b9c91834f3bd0c26 100644 --- a/matlab/tests/test_dcm2q.m +++ b/matlab/tests/test_dcm2q.m @@ -5,15 +5,17 @@ %oracle: easy to chekc from the formulae -clear all +clear all %clear workspace close all -cd .. +cd .. %move to functions directory +%execute function R=zeros(4,4); q=dcm2q(R); cd tests +%verify output if q~=[0;0;0;0.5] error('error in function dcm_2q') else diff --git a/matlab/tests/test_gps_randomized_car.m b/matlab/tests/test_gps_randomized_car.m new file mode 100644 index 0000000000000000000000000000000000000000..1daa01d5c0d02ac68cbd65917b3b487753fd9129 --- /dev/null +++ b/matlab/tests/test_gps_randomized_car.m @@ -0,0 +1,32 @@ +% test case for function gps_randomized_car + +%purpose: verify that the transition turn_on is taken from initial state + +%oracle: + +clear all %clear workspace +close all +cd .. %move to functions directory + +%initialize input data +sensor.state='no_info'; +sensor.fetchfp=1.0; +sensor.geteph=Inf; +sensor.ephExp=1800.0; +sensor.fp=0; +sensor.eph=5; +turn=true; +time=0; +sv=5; +%execute function +sensor=gps_randomized_car(time,sensor,turn,sv); + + +cd tests %go back to tests directory + +%verify output +if ~(strcmp(sensor.state,'cold_start')) + error('error in function gps_randomized_car') +else + disp('function gps_randomized_car ok') +end \ No newline at end of file