summaryrefslogtreecommitdiffstats
path: root/tests/nonRegression/bug2045.sci
blob: 83fc930d9f38fd942f7b33d31c059d81b5a30312 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// <-- Non-regression test for bug 2045 -->
//
// <-- Bugzilla URL -->
// http://www.scilab.org/cgi-bin/bugzilla_bug_II/show_bug.cgi?id=2045
//
// <-- Short Description -->
//    xpolys([],[],-1)
//    kills scilex

// Copyright INRIA
// Scilab Project - Jean-Baptiste Silvy
// Copyright INRIA 2006
// Date : October 27 2006

// should not draw anything
xpolys([],[],-1) ;

e = gce() ;

if ( e.type <> "Axes" ) then
  affich_result(%F,2045) ;
end


xpoly([],[]) ;

// should create an empty polyline
e = gce() ;

if ( e.type <> "Polyline" ) then
  affich_result(%F,2045) ;
end

if ( size(e.data) <> [0,0] ) then
  affich_result(%F,2045) ;
end

// check if scilab don't crash
plot3d ;

e.data = rand(100,2) ;

e.data = [] ;

xdel(winsid()) ;

// check if nothing is broken
xpolys(rand(12,12), rand(12,12) ) ;

e = gce() ;

if ( e.type <> "Compound" ) then
  affich_result(%F,2045) ;
end

if ( size(e.children) <> 12 ) then
  affich_result(%F,2045) ;
end

delete(gca()) ;

xpoly( rand(1,12), rand(1,12) ) ;

e = gce() ;

if ( e.type <> "Polyline" ) then
  affich_result(%F,2045) ;
end

affich_result(%T,2045) ;