1
1
Fork 0
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:
Matthew Kilgore 2022-11-22 23:30:20 -05:00
parent e12b13eebf
commit a79c943d36
36 changed files with 223 additions and 0 deletions

View 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.

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _DesktopHeight > 0
System

View file

@ -0,0 +1 @@
-1

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _DesktopWidth > 0
System

View file

@ -0,0 +1 @@
-1

View file

@ -0,0 +1,6 @@
$CONSOLE
_Dest _Console
_Icon
Print "Got Past Icon!"
System

View file

@ -0,0 +1 @@
Got Past Icon!

View file

@ -0,0 +1,6 @@
$CONSOLE
_Dest _Console
_MouseHide
Print "Got Past MouseHide!"
System

View file

@ -0,0 +1 @@
Got Past MouseHide!

View file

@ -0,0 +1,6 @@
$CONSOLE
_Dest _Console
_MouseShow
Print "Got Past MouseShow!"
System

View file

@ -0,0 +1 @@
Got Past MouseShow!

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _ScreenExists
System

View file

@ -0,0 +1 @@
1

View file

@ -0,0 +1,6 @@
$CONSOLE
_Dest _Console
_ScreenHide
Print "Got Past ScreenHide!"
System

View file

@ -0,0 +1 @@
Got Past ScreenHide!

View 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

View 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!

View 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

View 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!

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _ScreenIcon <> 0
System

View file

@ -0,0 +1 @@
0

View file

@ -0,0 +1,6 @@
$CONSOLE
_Dest _Console
_ScreenShow
Print "Got past ScreenShow!"
System

View file

@ -0,0 +1 @@
Got past ScreenShow!

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _ScreenX >= 0
System

View file

@ -0,0 +1 @@
-1

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _ScreenY >= 0
System

View file

@ -0,0 +1 @@
-1

View file

@ -0,0 +1,6 @@
$CONSOLE
_Dest _Console
_Title "foobar"
Print "Got past Title!"
System

View file

@ -0,0 +1 @@
Got past Title!

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print "Title: "; _Title$
System

View file

@ -0,0 +1 @@
Title:

View 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

View file

@ -0,0 +1 @@
-1

View file

@ -0,0 +1,5 @@
$CONSOLE
_Dest _Console
Print _WindowHasFocus <= 0 ' This can be a bit random
System

View file

@ -0,0 +1 @@
-1