-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2759dd7
commit 783cca2
Showing
58 changed files
with
900 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
## addpath_full.m:01 | ||
%!test | ||
%! try | ||
%! dirname = "."; | ||
%! addpath_full(dirname); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
## addpath_full.m:02 | ||
%!demo | ||
%! try | ||
%! addpath_full("~"); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
## assert_simple.m:02 | ||
%!test # 2-D matrix | ||
%! try | ||
%! A = [1 2 3]'*[1,2]; | ||
%! assert_simple (A, A); | ||
%! fail ("assert_simple (A.*(A!=2),A)"); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch | ||
%!test | ||
%! try | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
## assert_simple.m:03 | ||
%!test # N-D matrix | ||
%! try | ||
%! X = zeros (2,2,3); | ||
%! Y = X; | ||
%! Y(1,2,3) = 1.5; | ||
%! fail ("assert_simple (X,Y)"); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch | ||
%!assert (100+100*eps, 100, -2*eps) | ||
%!assert (100, 100+100*eps, -2*eps) | ||
%!error <Rel err .* exceeds tol> assert_simple (100+300*eps, 100, -2*eps) | ||
%!error <Rel err .* exceeds tol> assert_simple (100, 100+300*eps, -2*eps) | ||
%!test | ||
%! try | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
## assert_simple.m:04 | ||
%!test assert_simple (0.1+eps, 0.1, 2*eps); | ||
%!test | ||
%! try | ||
%! assert_simple (0.1+eps, 0.1, 2*eps); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch | ||
%!error <Rel err 2.2204e-0?15 exceeds tol> assert_simple (0.1+eps, 0.1, -2*eps) | ||
%!test | ||
%! try | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
## assert_simple.m:09 | ||
%!test | ||
%! try | ||
%! x = {{{1}}, 2}; # cell with multiple levels | ||
%! y = x; | ||
%! assert_simple (x,y); | ||
%! y{1}{1}{1} = 3; | ||
%! fail ("assert_simple (x,y)"); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch | ||
%!assert (@sin, @sin) | ||
%!error <Function handles don't match> assert_simple (@sin, @cos) | ||
%!error <Expected function handle, but observed double> assert_simple (pi, @cos) | ||
%!error <Class function_handle != double> assert_simple (@sin, pi) | ||
%!test | ||
%! try | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
## assert_simple.m:12 | ||
%!test | ||
%! try | ||
%! x = [-40:0]; | ||
%! y1 = (10.^x).*(10.^x); | ||
%! y2 = 10.^(2*x); | ||
%! ## Increase tolerance from eps (y1) to 4*eps (y1) because of an upstream bug | ||
%! ## in mingw-w64: https://sourceforge.net/p/mingw-w64/bugs/466/ | ||
%! assert_simple (y1, y2, 4*eps (y1)); | ||
%! fail ("assert_simple (y1, y2 + eps*1e-70, eps (y1))"); | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch | ||
%!test | ||
%! try | ||
%! catch | ||
%! gtest_error = lasterror(); | ||
%! gtest_fail(gtest_error, evalin("caller", "__file")); | ||
%! rethrow(gtest_error); | ||
%! end_try_catch |
Oops, something went wrong.