diff --git a/matlab/tests/main_runAllTests.m b/matlab/tests/main_runAllTests.m index 3c16658f31ca882be4dfdd6f047ebee0ab07b886..cf1de78d6483209a711687f00ff32b19231051e6 100644 --- a/matlab/tests/main_runAllTests.m +++ b/matlab/tests/main_runAllTests.m @@ -8,8 +8,8 @@ test_get_settings_car test_get_settings_cycling test_gps_randomized_car test_gps_randomized_cycling -% test_GPSaidedINS_car -% test_GPSaidedINS_cycling +test_GPSaidedINS_car +test_GPSaidedINS_cycling % test_gravity % test_main_car % test_main_cycling diff --git a/matlab/tests/test_gravity.m b/matlab/tests/test_gravity.m new file mode 100644 index 0000000000000000000000000000000000000000..53108ba48210fd9a77175e98cacee1122abae667 --- /dev/null +++ b/matlab/tests/test_gravity.m @@ -0,0 +1,25 @@ +% test case for function gravity + +%purpose: test that function runs without errors and returns a vector with +% magnitude around 9.8 + +%oracle: the gravity acceleration is around 9.8 + +clear all %clear workspace +close all +cd .. %move to functions directory + +%execute function +rng(1); +lambda=10*rand(1); +h=200; +g=gravity(lambda,h); + +cd tests %go back to tests directory + +%verify output +if ~(abs(9.8-sqrt(g'*g))<=0.2) + error('error in function gravity') +else + disp('function gravity ok') +end \ No newline at end of file