From 511ab6334df0692de6cb71f7813b5ae7c2440fc4 Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Wed, 30 Oct 2013 16:12:15 +0000 Subject: [PATCH] Added a matlab version of the EXPECT assertion that throws a warning rather than an error on failure --- matlab/+gtsam/EXPECT.m | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 matlab/+gtsam/EXPECT.m diff --git a/matlab/+gtsam/EXPECT.m b/matlab/+gtsam/EXPECT.m new file mode 100644 index 000000000..382c200cc --- /dev/null +++ b/matlab/+gtsam/EXPECT.m @@ -0,0 +1,10 @@ +function EXPECT(name,assertion) +% EXPECT throw a warning if an assertion fails +% +% EXPECT(name,assertion) +% - name of test +% - assertion + +if (assertion~=1) + warning(['EXPECT ' name ' fails']); +end