diff testing/utp_1.1/utp_fcns/get_test_objects_timespan.m @ 44:409a22968d5e default

Add unit tests
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 18:42:11 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testing/utp_1.1/utp_fcns/get_test_objects_timespan.m	Tue Dec 06 18:42:11 2011 +0100
@@ -0,0 +1,45 @@
+% GET_TEST_OBJECTS_TIMESPAN returns a set of TIMESPAN objects suitable for many of the UTPs
+%
+% CALL:     [ts1, ts2, ts3, ts4, ts5, ts6, tsv, tsm] = get_test_objects_timespan
+%
+% OUTPUTS:
+%           ts1  - An empty timespan
+%           ts2  - A timespan
+%           ts3  - A timespan
+%           ts4  - A timespan 
+%           ts5  - A timespan
+%           ts6  - A timespan
+%           tsv  - [ts6 ts2 ts5]
+%           tsm  - [ts1 ts2 ts3; ts4 ts5 ts6];
+%
+% M Hewitson 06-08-08
+%
+% $Id: get_test_objects_timespan.m,v 1.3 2009/08/03 18:34:11 ingo Exp $
+%
+function [ts1, ts2, ts3, ts4, ts5, ts6, tsv, tsm] = get_test_objects_timespan
+
+  %% TS1
+  ts1 = timespan();
+  ts1.setName();
+  %% TS2
+  ts2 = timespan(1000, 10000);
+  ts2.setName();
+  %% TS3
+  ts3 = timespan('2008-08-08 12:00:00', '2008-08-08 13:00:00');
+  ts3.setName();
+  %% TS4
+  ts4 = timespan(time(10), time(100));
+  ts4.setName();
+  %% TS5
+  pl = plist('timezone', 'PST', 'timeformat', 'HH:MM:SS.FFF', 'startT', time(1234), 'endT', time(12345));
+  ts5 = timespan(pl);
+  ts5.setName();
+  %% TS6
+  ts6 = timespan(10, time(100), 'HH:MM:SS');
+  ts6.setName();
+  %% TSV
+  tsv = [ts6 ts2 ts5];
+  %% TSM
+  tsm = [ts1 ts2 ts3; ts4 ts5 ts6];
+
+end