Skip to content
Snippets Groups Projects
Commit 14f582d1 authored by Claudio Mandrioli's avatar Claudio Mandrioli
Browse files

added test case for function gravity

parent 3ab2b2b7
No related branches found
No related tags found
No related merge requests found
...@@ -8,8 +8,8 @@ test_get_settings_car ...@@ -8,8 +8,8 @@ test_get_settings_car
test_get_settings_cycling test_get_settings_cycling
test_gps_randomized_car test_gps_randomized_car
test_gps_randomized_cycling test_gps_randomized_cycling
% test_GPSaidedINS_car test_GPSaidedINS_car
% test_GPSaidedINS_cycling test_GPSaidedINS_cycling
% test_gravity % test_gravity
% test_main_car % test_main_car
% test_main_cycling % test_main_cycling
......
% 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment