Mercurial > octave
annotate test/colormaps.tst @ 19669:2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
* colormaps.tst: Create an invisible figure to prevent empty figure from
showing during tests. Add unwind_protect block to close figure.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sat, 07 Feb 2015 11:32:47 -0500 |
parents | e8e3a89fa370 |
children | ecce63c99c3f |
rev | line source |
---|---|
19613
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
1 ## Copyright (C) 2015 Carnë Draug |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
2 ## |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
3 ## 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
|
4 ## |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
8 ## your option) any later version. |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
9 ## |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
10 ## 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
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
13 ## General Public License for more details. |
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 ## 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
|
16 ## along with Octave; see the file COPYING. If not, see |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
18 |
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
19 %!test |
19669
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
20 %! hf = figure ("visible", "off"); |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
21 %! unwind_protect |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
22 %! all_colormaps = colormap ("list"); |
19613
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
23 %! |
19669
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
24 %! assert (numel (all_colormaps) > 0) |
19613
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
25 %! |
19669
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
26 %! for i = 1:numel (all_colormaps) |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
27 %! f = str2func (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
|
28 %! |
19669
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
29 %! assert (iscolormap (f (1))) |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
30 %! assert (iscolormap (f (12))) |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
31 %! 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
|
32 %! |
19669
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
33 %! ## bug #44070 |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
34 %! assert (class (f (uint8 (12))), "double") |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
35 %! 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
|
36 %! |
19669
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
37 %! assert (f (0), zeros (0, 3)) |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
38 %! endfor |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
39 %! unwind_protect_cleanup |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
40 %! close (hf); |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19613
diff
changeset
|
41 %! end_unwind_protect |
19613
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
42 |