mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-04 04:50:22 +00:00
Add GLUT initialization tests
These tests cover all the commands that generally interact with GLUT. The ensure that these functions can be used at the very beginning of a program with no issues. Additionally they verify the behavior of these functions in the presence of `$SCREENHIDE`, and also `_ScreenHide`.
This commit is contained in:
parent
e12b13eebf
commit
a79c943d36
6
tests/compile_tests/glut/README.md
Normal file
6
tests/compile_tests/glut/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
Glut
|
||||
====
|
||||
|
||||
These tests cover the initialization of GLUT, and verify that even when these
|
||||
statements which make use of GLUT are the first thing in the program they still
|
||||
execute correctly.
|
5
tests/compile_tests/glut/desktopheight.bas
Normal file
5
tests/compile_tests/glut/desktopheight.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _DesktopHeight > 0
|
||||
System
|
1
tests/compile_tests/glut/desktopheight.output
Normal file
1
tests/compile_tests/glut/desktopheight.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
5
tests/compile_tests/glut/desktopwidth.bas
Normal file
5
tests/compile_tests/glut/desktopwidth.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _DesktopWidth > 0
|
||||
System
|
1
tests/compile_tests/glut/desktopwidth.output
Normal file
1
tests/compile_tests/glut/desktopwidth.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
6
tests/compile_tests/glut/icon.bas
Normal file
6
tests/compile_tests/glut/icon.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_Icon
|
||||
Print "Got Past Icon!"
|
||||
System
|
1
tests/compile_tests/glut/icon.output
Normal file
1
tests/compile_tests/glut/icon.output
Normal file
|
@ -0,0 +1 @@
|
|||
Got Past Icon!
|
6
tests/compile_tests/glut/mousehide.bas
Normal file
6
tests/compile_tests/glut/mousehide.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_MouseHide
|
||||
Print "Got Past MouseHide!"
|
||||
System
|
1
tests/compile_tests/glut/mousehide.output
Normal file
1
tests/compile_tests/glut/mousehide.output
Normal file
|
@ -0,0 +1 @@
|
|||
Got Past MouseHide!
|
6
tests/compile_tests/glut/mouseshow.bas
Normal file
6
tests/compile_tests/glut/mouseshow.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_MouseShow
|
||||
Print "Got Past MouseShow!"
|
||||
System
|
1
tests/compile_tests/glut/mouseshow.output
Normal file
1
tests/compile_tests/glut/mouseshow.output
Normal file
|
@ -0,0 +1 @@
|
|||
Got Past MouseShow!
|
BIN
tests/compile_tests/glut/qb64pe.ico
Normal file
BIN
tests/compile_tests/glut/qb64pe.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 67 KiB |
5
tests/compile_tests/glut/screenexists.bas
Normal file
5
tests/compile_tests/glut/screenexists.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _ScreenExists
|
||||
System
|
1
tests/compile_tests/glut/screenexists.output
Normal file
1
tests/compile_tests/glut/screenexists.output
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
6
tests/compile_tests/glut/screenhide.bas
Normal file
6
tests/compile_tests/glut/screenhide.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_ScreenHide
|
||||
Print "Got Past ScreenHide!"
|
||||
System
|
1
tests/compile_tests/glut/screenhide.output
Normal file
1
tests/compile_tests/glut/screenhide.output
Normal file
|
@ -0,0 +1 @@
|
|||
Got Past ScreenHide!
|
58
tests/compile_tests/glut/screenhide_commands.bas
Normal file
58
tests/compile_tests/glut/screenhide_commands.bas
Normal file
|
@ -0,0 +1,58 @@
|
|||
$SCREENHIDE
|
||||
$CONSOLE
|
||||
_Dest _Console
|
||||
ON ERROR GOTO errorhand
|
||||
|
||||
$IF WIN THEN
|
||||
Print _DesktopHeight > 0
|
||||
$ELSE
|
||||
Print _DesktopHeight = 0
|
||||
$END IF
|
||||
|
||||
$IF WIN THEN
|
||||
Print _DesktopWidth > 0
|
||||
$ELSE
|
||||
Print _DesktopWidth = 0
|
||||
$END IF
|
||||
|
||||
_Icon
|
||||
Print "Got past icon!"
|
||||
|
||||
_MouseHide
|
||||
Print "Got past MouseHide!"
|
||||
|
||||
_MouseShow
|
||||
Print "Got past MouseHide!"
|
||||
|
||||
Print _ScreenExists
|
||||
|
||||
_ScreenHide
|
||||
Print "Got past ScreenHide"
|
||||
|
||||
Print _ScreenIcon <> 0
|
||||
|
||||
$IF LINUX THEN
|
||||
' Since these functions don't work on linux they also don't trigger errors
|
||||
' We're just printing the error manually so the test passes on Linux
|
||||
Print "Error:"; 5
|
||||
Print "Error:"; 5
|
||||
$ELSE
|
||||
Print _ScreenX >= 0
|
||||
Print _ScreenY >= 0
|
||||
$END IF
|
||||
|
||||
_Title "foobar"
|
||||
Print "Title: "; _Title$
|
||||
|
||||
Print _WindowHandle <> 0
|
||||
Print _WindowHasFocus <= 0 ' This can be a bit random
|
||||
|
||||
_ScreenShow
|
||||
Print "Got past ScreenShow!"
|
||||
System
|
||||
|
||||
System
|
||||
|
||||
errorhand:
|
||||
PRINT "Error:"; ERR
|
||||
RESUME NEXT
|
14
tests/compile_tests/glut/screenhide_commands.output
Normal file
14
tests/compile_tests/glut/screenhide_commands.output
Normal file
|
@ -0,0 +1,14 @@
|
|||
-1
|
||||
-1
|
||||
Got past icon!
|
||||
Got past MouseHide!
|
||||
Got past MouseHide!
|
||||
0
|
||||
Got past ScreenHide
|
||||
0
|
||||
Error: 5
|
||||
Error: 5
|
||||
Title: foobar
|
||||
0
|
||||
-1
|
||||
Got past ScreenShow!
|
30
tests/compile_tests/glut/screenhide_sub.bas
Normal file
30
tests/compile_tests/glut/screenhide_sub.bas
Normal file
|
@ -0,0 +1,30 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_ScreenHide
|
||||
Print _DesktopHeight > 0
|
||||
Print _DesktopWidth > 0
|
||||
_Icon
|
||||
Print "Got Past Icon!"
|
||||
_MouseHide
|
||||
Print "Got Past MouseHide!"
|
||||
_MouseShow
|
||||
Print "Got Past MouseShow!"
|
||||
Print _ScreenExists
|
||||
Print _ScreenIcon <> 0
|
||||
Print _ScreenX >= 0
|
||||
Print _ScreenY >= 0
|
||||
_Title "foobar"
|
||||
Print "Title: "; _Title$
|
||||
|
||||
$IF WIN THEN
|
||||
Print _WindowHandle <> 0
|
||||
$ELSE
|
||||
Print _WindowHandle = 0
|
||||
$END IF
|
||||
|
||||
Print _WindowHasFocus <= 0 ' This can be a bit random
|
||||
|
||||
_ScreenShow
|
||||
Print "Got past ScreenShow!"
|
||||
System
|
13
tests/compile_tests/glut/screenhide_sub.output
Normal file
13
tests/compile_tests/glut/screenhide_sub.output
Normal file
|
@ -0,0 +1,13 @@
|
|||
-1
|
||||
-1
|
||||
Got Past Icon!
|
||||
Got Past MouseHide!
|
||||
Got Past MouseShow!
|
||||
1
|
||||
0
|
||||
-1
|
||||
-1
|
||||
Title: foobar
|
||||
-1
|
||||
-1
|
||||
Got past ScreenShow!
|
5
tests/compile_tests/glut/screenicon.bas
Normal file
5
tests/compile_tests/glut/screenicon.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _ScreenIcon <> 0
|
||||
System
|
1
tests/compile_tests/glut/screenicon.output
Normal file
1
tests/compile_tests/glut/screenicon.output
Normal file
|
@ -0,0 +1 @@
|
|||
0
|
6
tests/compile_tests/glut/screenshow.bas
Normal file
6
tests/compile_tests/glut/screenshow.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_ScreenShow
|
||||
Print "Got past ScreenShow!"
|
||||
System
|
1
tests/compile_tests/glut/screenshow.output
Normal file
1
tests/compile_tests/glut/screenshow.output
Normal file
|
@ -0,0 +1 @@
|
|||
Got past ScreenShow!
|
5
tests/compile_tests/glut/screenx.bas
Normal file
5
tests/compile_tests/glut/screenx.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _ScreenX >= 0
|
||||
System
|
1
tests/compile_tests/glut/screenx.output
Normal file
1
tests/compile_tests/glut/screenx.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
5
tests/compile_tests/glut/screeny.bas
Normal file
5
tests/compile_tests/glut/screeny.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _ScreenY >= 0
|
||||
System
|
1
tests/compile_tests/glut/screeny.output
Normal file
1
tests/compile_tests/glut/screeny.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
6
tests/compile_tests/glut/title.bas
Normal file
6
tests/compile_tests/glut/title.bas
Normal file
|
@ -0,0 +1,6 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
_Title "foobar"
|
||||
Print "Got past Title!"
|
||||
System
|
1
tests/compile_tests/glut/title.output
Normal file
1
tests/compile_tests/glut/title.output
Normal file
|
@ -0,0 +1 @@
|
|||
Got past Title!
|
5
tests/compile_tests/glut/title_func.bas
Normal file
5
tests/compile_tests/glut/title_func.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print "Title: "; _Title$
|
||||
System
|
1
tests/compile_tests/glut/title_func.output
Normal file
1
tests/compile_tests/glut/title_func.output
Normal file
|
@ -0,0 +1 @@
|
|||
Title:
|
11
tests/compile_tests/glut/windowhandle.bas
Normal file
11
tests/compile_tests/glut/windowhandle.bas
Normal file
|
@ -0,0 +1,11 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
' _WindowHandle only returns an actual handle on Windows
|
||||
$IF WIN THEN
|
||||
Print _WindowHandle <> 0
|
||||
$ELSE
|
||||
Print _WindowHandle = 0
|
||||
$END IF
|
||||
|
||||
System
|
1
tests/compile_tests/glut/windowhandle.output
Normal file
1
tests/compile_tests/glut/windowhandle.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
5
tests/compile_tests/glut/windowhasfocus.bas
Normal file
5
tests/compile_tests/glut/windowhasfocus.bas
Normal file
|
@ -0,0 +1,5 @@
|
|||
$CONSOLE
|
||||
_Dest _Console
|
||||
|
||||
Print _WindowHasFocus <= 0 ' This can be a bit random
|
||||
System
|
1
tests/compile_tests/glut/windowhasfocus.output
Normal file
1
tests/compile_tests/glut/windowhasfocus.output
Normal file
|
@ -0,0 +1 @@
|
|||
-1
|
Loading…
Reference in a new issue