Mercurial > octave-nkf
annotate test/colormaps.tst @ 20614:10ec79b47808
use new string_value method to handle value extraction errors
* __voronoi__.cc, chol.cc, colamd.cc, fftw.cc:
Use new string_value method.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 08 Oct 2015 18:15:56 -0400 |
parents | 2099e00b1833 |
children |
rev | line source |
---|---|
19647
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 |
19703
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
20 %! hf = figure ("visible", "off"); |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
21 %! unwind_protect |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
22 %! all_colormaps = colormap ("list"); |
19647
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
23 %! |
19703
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
24 %! assert (numel (all_colormaps) > 0) |
19647
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
25 %! |
19703
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
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:
19647
diff
changeset
|
27 %! f = str2func (all_colormaps{i}); |
19647
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
28 %! |
19703
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
29 %! assert (iscolormap (f (1))) |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
30 %! assert (iscolormap (f (12))) |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
31 %! assert (iscolormap (f (200))) |
19647
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
32 %! |
19703
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
33 %! ## bug #44070 |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
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:
19647
diff
changeset
|
35 %! assert (iscolormap (f (uint8 (12)))) |
19647
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
36 %! |
19703
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
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:
19647
diff
changeset
|
38 %! endfor |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
39 %! unwind_protect_cleanup |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
40 %! close (hf); |
2099e00b1833
colormaps.tst: Don't show a figure during 'make check'
Mike Miller <mtmiller@ieee.org>
parents:
19647
diff
changeset
|
41 %! end_unwind_protect |
19647
e8e3a89fa370
Fix colormap functions when N is not of class double (bug #44070)
Carnë Draug <carandraug@octave.org>
parents:
diff
changeset
|
42 |