From aff51fd9283873477a1ae1dce55d2c5d10450956 Mon Sep 17 00:00:00 2001 From: Claudio Mandrioli <claudio.mandrioli@control.lth.se> Date: Thu, 28 Feb 2019 11:00:06 +0100 Subject: [PATCH] added test case for function Rt2d --- matlab/tests/main_runAllTests.m | 2 +- matlab/tests/test_Rt2d.m | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 matlab/tests/test_Rt2d.m diff --git a/matlab/tests/main_runAllTests.m b/matlab/tests/main_runAllTests.m index 1ae7a6e..d58750d 100644 --- a/matlab/tests/main_runAllTests.m +++ b/matlab/tests/main_runAllTests.m @@ -13,4 +13,4 @@ test_GPSaidedINS_cycling test_gravity test_Nav_eq test_q2dcm -% test_Rt2d \ No newline at end of file +test_Rt2d \ No newline at end of file diff --git a/matlab/tests/test_Rt2d.m b/matlab/tests/test_Rt2d.m new file mode 100644 index 0000000..3c6330e --- /dev/null +++ b/matlab/tests/test_Rt2d.m @@ -0,0 +1,25 @@ +% test case for function Rt2d + +%purpose: test the function in basic case to verify it runs correctly, i.e. +% returns a 3x3 matrix + +%oracle: the rotation matrix with null angles should be the identity +% matrix + +clear all %clear workspace +close all +cd .. %move to functions directory + +%initialize inputs +ang=[0,0,0]; +%execute function +R=Rt2b(ang); + +cd tests %go back to tests directory + +%verify output +if ~(R==eye(3)) + error('error in function Rt2d') +else + disp('function Rt2d ok') +end \ No newline at end of file -- GitLab