annotate test/colormaps.tst @ 33603:ea261407cb9f bytecode-interpreter tip

maint: Merge default to bytecode-interpreter
author Arun Giridhar <arungiridhar@gmail.com>
date Sat, 18 May 2024 17:42:42 -0400
parents 2e484f9f1f18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ########################################################################
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 ##
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31706
diff changeset
3 ## Copyright (C) 2016-2024 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
4 ##
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
7 ##
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
8 ## This file is part of Octave.
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
9 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
11 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
13 ## (at your option) any later version.
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
14 ##
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22323
diff changeset
18 ## GNU General Public License for more details.
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
19 ##
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
20 ## You should have received a copy of the GNU General Public License
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
22 ## <https://www.gnu.org/licenses/>.
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 ##
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ########################################################################
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
25
21980
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
26 ## This is a test that should be used on all Octave colormaps.
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
27 ## Because there is no function to get a list of all colormap
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
28 ## functions, they should be added here manually.
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
29
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
30 %!test
19669
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
31 %! hf = figure ("visible", "off");
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
32 %! unwind_protect
21980
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
33 %! all_colormaps = {@autumn, @bone, @cool, @copper, @cubehelix, ...
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
34 %! @flag, @gray, @hot, @hsv, @jet, @lines, @ocean, ...
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
35 %! @pink, @prism, @rainbow, @spring, @summer, ...
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
36 %! @viridis, @white, @winter};
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
37 %!
19669
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
38 %! for i = 1:numel (all_colormaps)
21980
19cfad4e4112 colormaps.tst: fix test after removal of colormap list (bug #48272)
Carnë Draug <carandraug@octave.org>
parents: 21580
diff changeset
39 %! f = all_colormaps{i};
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
40 %!
21580
ecce63c99c3f maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents: 19669
diff changeset
41 %! assert (iscolormap (f (1)));
ecce63c99c3f maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents: 19669
diff changeset
42 %! assert (iscolormap (f (12)));
ecce63c99c3f maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents: 19669
diff changeset
43 %! assert (iscolormap (f (200)));
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
44 %!
19669
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
45 %! ## bug #44070
21580
ecce63c99c3f maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents: 19669
diff changeset
46 %! assert (class (f (uint8 (12))), "double");
ecce63c99c3f maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents: 19669
diff changeset
47 %! assert (iscolormap (f (uint8 (12))));
19613
e8e3a89fa370 Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff changeset
48 %!
21580
ecce63c99c3f maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents: 19669
diff changeset
49 %! assert (f (0), zeros (0, 3));
19669
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
50 %! endfor
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
51 %! unwind_protect_cleanup
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
52 %! close (hf);
2099e00b1833 colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents: 19613
diff changeset
53 %! end_unwind_protect