From 339222a3a1b2c7013f3d02012a198f703fb9bd73 Mon Sep 17 00:00:00 2001 From: Claudio Mandrioli <claudio.mandrioli@control.lth.se> Date: Wed, 27 Feb 2019 19:06:07 +0100 Subject: [PATCH] created forlder for test cases and main script --- matlab/tests/main_runAllTests.m | 22 ++++++++++++++++++++++ matlab/tests/test_dcm2q.m | 21 +++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 matlab/tests/main_runAllTests.m create mode 100644 matlab/tests/test_dcm2q.m diff --git a/matlab/tests/main_runAllTests.m b/matlab/tests/main_runAllTests.m new file mode 100644 index 0000000..c5e7161 --- /dev/null +++ b/matlab/tests/main_runAllTests.m @@ -0,0 +1,22 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% script that runs all the test cases defined +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% every time a new test-case is define simply add it here +test_dcm2q +% test_get_settings_car +% test_get_settings_cycling +% test_gps_randomized_car +% test_gps_randomized_cycling +% test_GPSaidedINS_car +% test_GPSaidedINS_cycling +% test_gravity +% test_main_car +% test_main_cycling +% test_main_tradeoff_car +% test_main_tradeoff_cycling +% test_Nav_eq +% test_plot_single_trace +% test_plot_tradeoff +% test_q2dcm +% test_Rt2d \ No newline at end of file diff --git a/matlab/tests/test_dcm2q.m b/matlab/tests/test_dcm2q.m new file mode 100644 index 0000000..a48088c --- /dev/null +++ b/matlab/tests/test_dcm2q.m @@ -0,0 +1,21 @@ +% test case for function test_dcm2q + +%purpose: verify correctness of the function in the basic case of null +% cosine matrix and that the function runs without interruption + +%oracle: easy to chekc from the formulae + +clear all +close all +cd .. + +R=zeros(4,4); +q=dcm2q(R); + +cd tests + +if q~=[0;0;0;0.5] + error('error in function dcm_2q') +else + disp('function dcm_2q ok') +end \ No newline at end of file -- GitLab