diff scripts/testfun/assert.m @ 18538:fcd87f68af4f

Deprecate nfields and replace with numfields. * NEWS: Announce deprecation of nfields and addition of new function numfields. * container.txi: Add numfields to the manual. * oct-map.cc (octave_map::cat): Change %!tests to use numfields. * ov-struct.cc (Fnumfields): Function renamed from nfields. * scripts/deprecated/nfields.m: Add m-file which warns about nfields deprecation. * scripts/deprecated/module.mk: Add nfields.m to build system. * fieldnames.m: Change seealso link to point to numfields. * __isequal__.m: Use numfields to simplify code. * imwrite.m: Replace 'isempty (fieldnames (fmt))' with 'numfields (fmt) > 0' for clarity. * imageIO.m: Replace 'isempty (fieldnames (fmt))' with 'numfields (fmt) > 0' for clarity. * importdata.m: Use numfields to simplify code. * assert.m: Use numfields to simplify code.
author Rik <rik@octave.org>
date Sun, 02 Mar 2014 12:56:11 -0800
parents 7994d3ce6e8e
children b83fca22bb4c
line wrap: on
line diff
--- a/scripts/testfun/assert.m	Sat Mar 01 22:11:32 2014 -0800
+++ b/scripts/testfun/assert.m	Sun Mar 02 12:56:11 2014 -0800
@@ -148,7 +148,7 @@
         err.reason{end+1} = ["Expected struct, but observed " class(cond)];
       elseif (ndims (cond) != ndims (expected)
               || any (size (cond) != size (expected))
-              || rows (fieldnames (cond)) != rows (fieldnames (expected)))
+              || numfields (cond) != numfields (expected))
 
         err.index{end+1} = ".";
         err.observed{end+1} = ["O(" sprintf("%dx", size(cond))(1:end-1) ")"];