Mercurial > repos > public > sbplib
comparison +grid/evalOnTest.m @ 425:e56dbd9e4196 feature/grids
Merge feature/beams
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 07 Feb 2017 16:09:02 +0100 |
parents | 4c3f55a628c8 |
children | 190941ec12d8 |
comparison
equal
deleted
inserted
replaced
423:a2cb0d4f4a02 | 425:e56dbd9e4196 |
---|---|
20 g = getTestGrid('1d'); | 20 g = getTestGrid('1d'); |
21 | 21 |
22 for i = 1:length(in) | 22 for i = 1:length(in) |
23 gf = grid.evalOn(g,in{i}); | 23 gf = grid.evalOn(g,in{i}); |
24 testCase.verifyEqual(gf, out{i}); | 24 testCase.verifyEqual(gf, out{i}); |
25 end | |
26 end | |
27 | |
28 % evalOn should give and error if the number of inputs to func is not the same as | |
29 % the number of dimensions of the grid. | |
30 function testNumberOfInputs(testCase) | |
31 cases = { | |
32 {getTestGrid('1d'), @(x,y)x-y}, | |
33 {getTestGrid('2d'), @(x)x }, | |
34 } | |
35 | |
36 for i = 1:length(cases) | |
37 g = cases{i}{1}; | |
38 f = cases{i}{2}; | |
39 testCase.verifyError(@()grid.evalOn(g, f),'grid:evalOn:WrongNumberOfInputs',sprintf('in(%d) = %s',i,toString(f))); | |
25 end | 40 end |
26 end | 41 end |
27 | 42 |
28 function testInputScalarFunction1d(testCase) | 43 function testInputScalarFunction1d(testCase) |
29 in = { | 44 in = { |