Skip to content

Commit 38f2d4a

Browse files
committed
test: Make implementation of loadobj function in test less restrictive.
* test/classdef-load-save/loadobj_saveobj_class.m (loadobj): Adapt to work with struct or classdef object input argument. There is a dedicated test that checks for the type of the input argument of the loadobj function.
1 parent 351a1b3 commit 38f2d4a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

test/classdef-load-save/loadobj_saveobj_class.m

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
methods (Static)
33
function obj = loadobj (s)
44
obj = loadobj_saveobj_class ();
5-
if (isstruct (s))
6-
obj.a = s.a;
7-
obj.b = s.b;
8-
obj.c = s.c;
9-
obj.d = s.d;
10-
obj.e = s.e;
11-
endif
5+
obj.a = s.a;
6+
obj.b = s.b;
7+
obj.c = s.c;
8+
obj.d = s.d;
9+
obj.e = s.e;
1210
endfunction
1311
endmethods
1412

0 commit comments

Comments
 (0)