test_get_settings_car.m 856 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% test case for function get_settings_car

%purpose: checks that the get_settings_car function returns a struct with
%the right fields

%oracle:  the fields of the returned struct are sigma_acc sigma_giro
%sigma_acc_bias sigma_giro_bias sigma_gps factp

clear all             %clear workspace 
close all
cd ..                 %move to functions directory           

%execute function
settings=get_settings_car();

cd tests              %go back to tests directory

%verify output
if    ~(isfield(settings, 'sigma_acc') && ...
        isfield(settings, 'sigma_gyro') && ...
        isfield(settings, 'sigma_acc_bias') && ...
        isfield(settings, 'sigma_gyro_bias') && ...
        isfield(settings, 'sigma_gps') && ...
        isfield(settings, 'factp'))
    error('error in function get_settings_car')
else
    disp('function get_settings_car ok')
end