diff --git a/matlab/tests/main_runAllTests.m b/matlab/tests/main_runAllTests.m index 44d43337b3b449ef6497f1ef3ac8893cfa764f7d..3c16658f31ca882be4dfdd6f047ebee0ab07b886 100644 --- a/matlab/tests/main_runAllTests.m +++ b/matlab/tests/main_runAllTests.m @@ -6,8 +6,8 @@ test_dcm2q test_get_settings_car test_get_settings_cycling -% test_gps_randomized_car -% test_gps_randomized_cycling +test_gps_randomized_car +test_gps_randomized_cycling % test_GPSaidedINS_car % test_GPSaidedINS_cycling % test_gravity diff --git a/matlab/tests/test_GPSaidedINS_car.m b/matlab/tests/test_GPSaidedINS_car.m new file mode 100644 index 0000000000000000000000000000000000000000..aae6a5b6ba1c5c1024ac918920fd15b6b8b3bc79 --- /dev/null +++ b/matlab/tests/test_GPSaidedINS_car.m @@ -0,0 +1,32 @@ +% test case for function GPSaidedINS_car + +%purpose: test that the function runs without errors and outputs the +% correct struct + +%oracle: returns a non-empty struct with fields: x_h, delta_u_h, diag_P, +% energy and error + +clear all %clear workspace +close all +cd .. %move to functions directory + +%initialize input data +load('car_input_data.mat'); +settings=get_settings_car(); +settings.P_treshold=4.1; +%execute function +out_data=GPSaidedINS_car(in_data,settings); + +cd tests %go back to tests directory + +%verify output +if ~(isfield(out_data, 'x_h') && ... + isfield(out_data, 'delta_u_h') && ... + isfield(out_data, 'diag_P') && ... + isfield(out_data, 'energy') && ... + isfield(out_data, 'error')... + ) + error('error in function GPSaidedINS_car') +else + disp('function GPSaidedINS_car ok') +end \ No newline at end of file diff --git a/matlab/tests/test_GPSaidedINS_cycling.m b/matlab/tests/test_GPSaidedINS_cycling.m new file mode 100644 index 0000000000000000000000000000000000000000..016fc9bc0fd72a9a5685dc27bf784edb8f92f3dd --- /dev/null +++ b/matlab/tests/test_GPSaidedINS_cycling.m @@ -0,0 +1,32 @@ +% test case for function GPSaidedINS_cycling + +%purpose: test that the function runs without errors and outputs the +% correct struct + +%oracle: returns a non-empty struct with fields: x_h, delta_u_h, diag_P, +% energy and error + +clear all %clear workspace +close all +cd .. %move to functions directory + +%initialize input data +load('cycling_input_data.mat'); +settings=get_settings_cycling(); +settings.P_treshold=4.1; +%execute function +out_data=GPSaidedINS_cycling(in_data,settings); + +cd tests %go back to tests directory + +%verify output +if ~(isfield(out_data, 'x_h') && ... + isfield(out_data, 'delta_u_h') && ... + isfield(out_data, 'diag_P') && ... + isfield(out_data, 'energy') && ... + isfield(out_data, 'error')... + ) + error('error in function GPSaidedINS_cycling') +else + disp('function GPSaidedINS_cycling ok') +end \ No newline at end of file