From 146e57ca3b9dd0e7913043e44096b77f4b2f00f3 Mon Sep 17 00:00:00 2001 From: Claudio Mandrioli <claudio.mandrioli@control.lth.se> Date: Wed, 27 Feb 2019 19:32:44 +0100 Subject: [PATCH] added test case for function get_settings_cycling --- matlab/tests/test_get_settings_cycling.m | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 matlab/tests/test_get_settings_cycling.m diff --git a/matlab/tests/test_get_settings_cycling.m b/matlab/tests/test_get_settings_cycling.m new file mode 100644 index 0000000..5f1710d --- /dev/null +++ b/matlab/tests/test_get_settings_cycling.m @@ -0,0 +1,28 @@ +% test case for function get_settings_cycling + +%purpose: checks that the get_settings_cycling 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_cycling(); + +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_cycling') +else + disp('function get_settings_cycling ok') +end \ No newline at end of file -- GitLab