1/* 2 * ticket-777.sli 3 * 4 * This file is part of NEST. 5 * 6 * Copyright (C) 2004 The NEST Initiative 7 * 8 * NEST is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * NEST is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with NEST. If not, see <http://www.gnu.org/licenses/>. 20 * 21 */ 22 23/** @BeginDocumentation 24 25Name: testsuite::ticket-777 - SLI conditional jump typecheck bool arg 26 27Synopsis: (ticket-777) run -> NEST exits if test fails 28 29Description: 30Ensure that conditional jump instructions only accept /booltype as condition (as expected by the PostScript reference). 31 32Author: Mikael Naveau, 2013-10-17 33 */ 34 35(unittest) run 36/unittest using 37 38M_ERROR setverbosity 39 40%% each test ensure that the conditional instruction fails if the condition is not a boolean 41 42%% insert here each datatype you want to test 43/tested_type [0 1.0 (hello) [] << >>] def 44 45tested_type 46{ 47/condition Set 48 49%% if 50{condition {} if} 51({/) condition type cvs join ( /proc if} should not be allowed) join fail_or_die 52 53%% elseif 54{condition {} {} elseif} 55({/) condition type cvs join ( /proc1 /proc2 elseif} should not be allowed) join fail_or_die 56 57} forall %% tested_type 58