Fix FXGLVisual.supported
It did not return an Array as intended, but only true or false.
This caused random failures of the test suite.
To follow ruby best practice, supported? returns the GL support state (true/false) only.
Lars Kanis
6 years ago
76 | 76 |
# even support no OpenGL at all! This function returns the lesser
|
77 | 77 |
# of the client support level and the display server support level.
|
78 | 78 |
#
|
|
79 |
# Return an array with the following 3 elements: [supported, major, minor]
|
|
80 |
#
|
|
81 |
def FXGLVisual.supported(app); end
|
|
82 |
|
|
83 |
# Test if OpenGL is possible.
|
|
84 |
#
|
|
85 |
# Same as {FXGLVisual.supported?}, but returns the first element (true/false) only.
|
|
86 |
#
|
79 | 87 |
def FXGLVisual.supported?(app); end
|
80 | 88 |
|
81 | 89 |
# Return +true+ if double-buffered
|
40 | 40 |
* of the client support level and the display server support level.
|
41 | 41 |
*/
|
42 | 42 |
%extend {
|
43 | |
static FXbool supported(FXApp* application){
|
|
43 |
static VALUE supported(FXApp* application){
|
44 | 44 |
int major,minor;
|
45 | 45 |
FXbool answer=FXGLVisual::supported(application,major,minor);
|
46 | 46 |
return rb_ary_new3(3,answer?Qtrue:Qfalse,INT2NUM(major),INT2NUM(minor));
|
11 | 11 |
end
|
12 | 12 |
|
13 | 13 |
def test_supported
|
14 | |
assert FXGLVisual.supported?(app)
|
|
14 |
arr = FXGLVisual.supported(app)
|
|
15 |
assert_equal 3, arr.length, "return array should have elements [support, major, minor]"
|
|
16 |
assert_true arr[0], "OpenGL should be supported"
|
|
17 |
assert_operator 1, :<=, arr[1], "OpenGL should be version 1.0 or greater"
|
|
18 |
end
|
|
19 |
|
|
20 |
def test_supported?
|
|
21 |
assert_true FXGLVisual.supported?(app), "OpenGL should be supported"
|
15 | 22 |
end
|
16 | 23 |
|
17 | 24 |
def test_nil_app_raises_argument_error
|