[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #8119] Allow variable tolerance and improv
From: |
Dan Sebald |
Subject: |
[Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script |
Date: |
Mon, 05 Aug 2013 23:12:37 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 SeaMonkey/2.15 |
Follow-up Comment #10, patch #8119 (project octave):
OK, I get it now. There was actually a bug or two still in the script.
Attached is a new version with all output packed into the error message so
that test.m's try/catch can handle the display.
>> test clf
***** xtest
hf = figure ("visible", "off");
unwind_protect
plot (1:10);
set (hf, "papertype", "tabloid");
clf (hf);
assert (isempty (get (gcf, "children")));
assert (get (hf, "papertype"), "tabloid");
plot (1:10);
clf (hf, "reset");
kids = get (hf, "children");
assert (isempty (get (gcf, "children")));
assert (get (hf, "papertype"), "usletter");
unwind_protect_cleanup
close (hf);
end_unwind_protect
!!!!! known failure
ASSERT errors for: assert (get (hf, "papertype"),"usletter")
Location | Observed | Expected | Reason
[] tabloid usletter Strings don't match
PASSES 3 out of 3 tests (1 expected failures)
So that's an incremental step in the right direction. I did find what seems
like a bug in test.m. I'll submit a new report for that.
The one thing I can think of to do would be something more descriptive for the
recursive assert calls. For example, here is the output of a recursive cell
test:
>> assert (x, y)
error: ASSERT errors for: assert (cond {i},expected {i},tol)
Location | Observed | Expected | Reason
1 3 2 Exceeds abs tol 0 by 1
ASSERT errors for: assert (cond {i},expected {i},tol)
Location | Observed | Expected | Reason
1 100 101 Exceeds abs tol 0 by 1
ASSERT errors for: assert (cond {i},expected {i},tol)
Location | Observed | Expected | Reason
1 1 0 Exceeds abs tol 0 by 1
ASSERT errors for: assert (cond {i},expected {i},tol)
Location | Observed | Expected | Reason
[] dog cat Strings don't match
Notice how the arguments of the "assert" command are generic cell contents.
One could parse the original command for the variable names and either:
1) Create local variables with names similar to input... problematic if the
variable matches something in the local space.
2) Temporarily redefine the "in" string... problematic if more than one level
of recursion because original contents of "in" is lost.
We'll leave that for later.
(file #28770)
_______________________________________________________
Additional Item Attachment:
File name: octave-assert_vector_tolerance-2013aug05.patch Size:14 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?8119>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Rik, 2013/08/01
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/02
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/02
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Rik, 2013/08/02
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/02
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/04
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/05
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Rik, 2013/08/05
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script,
Dan Sebald <=
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Rik, 2013/08/06
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/07
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/07
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/07
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Rik, 2013/08/07
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/07
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Rik, 2013/08/08
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/11
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/12
- [Octave-patch-tracker] [patch #8119] Allow variable tolerance and improve error messages for assert.m script, Dan Sebald, 2013/08/12