From afbfe2090472a6eeeb1f5166e839f8f13e0bfe0c Mon Sep 17 00:00:00 2001
From: Claudio Mandrioli <claudio.mandrioli@control.lth.se>
Date: Wed, 27 Feb 2019 19:46:22 +0100
Subject: [PATCH] added test case for function gps_randomized_cycling

---
 matlab/tests/test_gps_randomized_car.m     |  2 +-
 matlab/tests/test_gps_randomized_cycling.m | 32 ++++++++++++++++++++++
 2 files changed, 33 insertions(+), 1 deletion(-)
 create mode 100644 matlab/tests/test_gps_randomized_cycling.m

diff --git a/matlab/tests/test_gps_randomized_car.m b/matlab/tests/test_gps_randomized_car.m
index 1daa01d..5974c33 100644
--- a/matlab/tests/test_gps_randomized_car.m
+++ b/matlab/tests/test_gps_randomized_car.m
@@ -2,7 +2,7 @@
 
 %purpose: verify that the transition turn_on is taken from initial state
 
-%oracle:  
+%oracle:  the transition brings in the state cold_start
 
 clear all             %clear workspace 
 close all
diff --git a/matlab/tests/test_gps_randomized_cycling.m b/matlab/tests/test_gps_randomized_cycling.m
new file mode 100644
index 0000000..e1566f7
--- /dev/null
+++ b/matlab/tests/test_gps_randomized_cycling.m
@@ -0,0 +1,32 @@
+% test case for function gps_randomized_cycling
+
+%purpose: verify that the transition turn_on is taken from initial state
+
+%oracle:  the transition brings in the state cold_start
+
+clear all             %clear workspace 
+close all
+cd ..                 %move to functions directory           
+
+%initialize input data
+sensor.state='no_info';
+sensor.fetchfp=1.0;
+sensor.geteph=Inf;
+sensor.ephExp=1800.0;
+sensor.fp=0;
+sensor.eph=5;
+turn=true;
+time=0;
+sv=5;
+%execute function
+sensor=gps_randomized_cycling(time,sensor,turn,sv);
+
+
+cd tests              %go back to tests directory
+
+%verify output
+if ~(strcmp(sensor.state,'cold_start'))
+    error('error in function gps_randomized_cycling')
+else
+    disp('function gps_randomized_ccycling ok')
+end
\ No newline at end of file
-- 
GitLab