1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00
Commit graph

78 commits

Author SHA1 Message Date
Roland Heyder 2d8a7b897f Fix hash test
- ok, that was my fault?, no it wasn't,
- console is ignoring trailing space when copying text from it
2024-02-03 14:35:55 +01:00
Roland Heyder 212986abd8 Fix hash test
- hopefully
2024-02-03 14:11:59 +01:00
Roland Heyder 2b3743e190 Adds test case for hashing 2024-02-03 12:24:34 +01:00
Matthew Kilgore 585002507c Avoid newline characters in test 2024-01-19 21:30:10 -05:00
Matthew Kilgore 1a087609bf Add support for ASC() and CHR$() 2024-01-18 13:00:13 -05:00
Matthew Kilgore 90941fffa7 Replace CONSTs while we have the individual elements
This moves the CONST replacement up before we turn the elements into a
single string. The advantage is that we don't have to worry about
splitting the string properly to find the CONST names as the elements
are already split for us.t
2024-01-18 13:00:13 -05:00
Samuel Gomes 103e0f0873 Cleanup FS_GetKnownDirectory() and make libqb/ compile using -O2 2024-01-02 23:49:43 +05:30
Samuel Gomes 8c61cac457 Merge branch 'filesystem-refactor-and-update' of https://github.com/a740g/QB64pe into filesystem-refactor-and-update 2023-12-28 00:10:52 +05:30
Roland Heyder 0adcd6c5a7 Another try... 2023-12-15 20:45:02 +01:00
Roland Heyder 395af5c486 Avoid OS differences in tests 2023-12-15 19:59:48 +01:00
Roland Heyder d37d0ffc48 Fixing the test 2023-12-15 18:31:47 +01:00
Roland Heyder 84cd58162c Adds an test case
simple test case, which just embeds the `test.output` file and prints it
2023-12-15 18:03:36 +01:00
Roland Heyder 1358716115 Fixing tests
forget AddQuotes$(), rather make file.bas self-contained using CHR$(34)
2023-12-13 22:11:14 +01:00
Roland Heyder 34bbdae052 Fixing tests
try again...
2023-12-13 21:42:53 +01:00
Samuel Gomes 901bdb4cd3 Add filesys test 2023-12-13 12:26:09 +05:30
Samuel Gomes fbaff265d1 Add CHDIR _STARTDIR$ to svg_test.bas 2023-12-05 09:49:03 +05:30
Samuel Gomes bb269c0d40 Fix svg_test.bas test image path 2023-12-05 09:30:30 +05:30
Samuel Gomes bbfd228597 Check for SVG start tag and add tests 2023-12-05 09:20:25 +05:30
SteveMcNeill 1be3e366ac Final fixes to math stuff (I hope)
Fix to CONST with the math evaluator to toss a message and error with values out of acceptable range for ARCSEC and ARCCSC.

Tweak to _PI to add constexpr for speedier execution.

Fix to the math tests for the new (and unbuggy) values for ARCSEC and ARCCSC.
2023-10-31 11:32:22 -04:00
Samuel Gomes b4d013d0e3 Remove midi-openal test 2023-09-22 10:53:21 +05:30
Samuel Gomes 4f004c117b
Merge branch 'main' into audio-enhancements 2023-09-21 01:13:54 +05:30
Samuel Gomes 46d2d1c671 Update test license output files 2023-09-21 00:13:25 +05:30
Samuel Gomes 9d3cafd3ea Update test license check files 2023-09-19 02:49:32 +05:30
Samuel Gomes 4c8d56a274 Add test for loading font file from memory 2023-04-28 23:23:08 +05:30
Matthew Kilgore 8e1e7bc540 Fix keyboard _Device on Windows
Currently the Keyboard _Devices entry on Windows does not report all the
key presses and releases. This is due to missing some messages in the
form of WM_SYSKEYDOWN and WM_SYSKEYUP. Additionally Windows is weird
about report the state of the individual shift keys, so we add some
logic using GetAsyncKeyState() to fix that up.

Fixes: #333
2023-04-25 19:12:01 -04:00
Matthew Kilgore f931566a6b Add tests of $MidiSoundFont file resolution 2023-04-25 09:48:08 -04:00
Matthew Kilgore e657412b80 Apply .compile-from-base to existing filename-based tests 2023-04-25 09:48:08 -04:00
Matthew Kilgore 68335187cf Add tests of new .h file resolution 2023-04-25 09:48:08 -04:00
Samuel Gomes f72aaa7c3c Update tests 2023-03-19 04:12:46 +05:30
Matthew Kilgore fac5375ea6 Fix DECLARE LIBRARY against stripped .so file
.so files can be stripped such that they contain no "regular" symbol
table but do still contain the "dynamic" symbol table, this is pretty
typical for .so files. QB64-PE is supposed to check both tables when
linking against a .so file, but a bug in ab0c2b18 meant that the second
run of nm with the -D flag to check the dynamic symbol table no longer
happens. The fix is to introduce a new output file for the dynamic run
so that they are handled separately in terms of caching the result.

A new test .so file that only contains a dynamic symbol table was added
to avoid this in the future.

Fixes: #301
2023-02-19 02:10:51 -05:00
Matthew Kilgore df70f7e708 The -o flag should not strip extensions except for .exe
Current the -o flag will strip any "extension" on the provided filename,
which is fairly problimatic on Linux and Mac OS since those executes do
not have other extensions and names like "foobar.v1" will get the ".v1"
stripped off. This can happen on Windows as well if you leave off the
.exe (QB64-PE will add it for you, but also strip off the existing
extension).

QB64-PE stripping off the ".exe" when provided that on Linux and Mac OS
might actually be useful behavior people are relying on (so that they
don't need to provide different names when compiling on Linux/Mac OS) so
we are preserving that and still removing the extension if it is exactly
"EXE", otherwise we now leave it in place.

Fixes: #297
2023-02-18 14:50:31 -05:00
Matthew Kilgore e810229d11 Fix _RGB32() optional arguments
The new optional arguments for functions broke _RGB32() because it uses
some custom flags ('overloaded' and 'minargs' on the id Type) to control
its parameter passing. You are allowed passing any number from 1 to 4 args
to `func__rgb32` and there are 4 overloaded C++ functions that will get
picked from. This is different from how this typically would work, with
all 4 parameters always passed and an extra argument to specify the
parameters that were passed.

Rather than change `func__rgb32` I simply adjusted the optional argument
logic to account for the flags used by `_RGB32()` - if the `overloaded`
flag is set, then we don't need to add extra `NULL` parameters for any
parameter that wasn't specified in the argument list. Instead we simply
don't emit anything for those.
2023-02-13 00:25:51 -05:00
Matthew Kilgore 0836cf31eb Format source, apply Option _Explicit in tests 2023-02-12 22:38:50 -05:00
Matthew Kilgore 83533dc319 Add support for optional function arguments
Currently functions only have very limited optional argument support,
this expands it so that we can have more complex sets of optional
arguments for functions, such as multiple arguments where not all need
to be provided. This will be used in the future for some upcoming
functionality.

Note that this does not support any generic optional argument format,
the commas always have to be provided unless an optional argument is at
the end of the parameter list. Thus, if you have a format with two
optional arguments and you want to omit the second, then you need to call
it as 'foo(2, , 3)`, rather than `foo(2, 3)`. This is important for
avoiding ambiguous situations, and is how many SUBs currently function.

The two functions that violate that requirement are INSTR() and
_INSTRREV(), which use the format `[?],?,?` and allow omitting the comma
for the first argument. This format is simply handled as a special case.

Fixes: #303
2023-02-12 22:38:50 -05:00
Matthew Kilgore d4ed371681 Stopped timers don't trigger on TIMER ON
If a timer expires while stopped, it should trigger when TIMER ON is
run. Instead, on QB64 it triggers randomly after the TIMER ON happens.

The basic issue is that `qbevent` needs to be set to trigger the timer,
but TIMER ON doesn't do that. The regular timer logic that does that
already set it when the timer expired while sleeping, so it won't set it
again. The simplest solution is to just alway set qbevent = 1 when TIMER
ON is done. It's slightly less efficent but doesn't hurt to set it even
when there are no timers that expired.

Fixes: #293
2023-02-12 21:27:25 -05:00
Matthew Kilgore f995f38e38 Using Sleep with Console programs does not trigger timers
The command Sleep is supposed to allow timers to trigger while the
program is sleeping on the delay. This is achieved in QB64 by having
commands that do delays manually call evnt() to trigger events if they
come up (of which timers are one).

Sleep has a custom implementation for console programs on Windows which
doesn't do this, so I redid the logic so that it calls evnt() at regular
intervals while waiting for input. Additionally, due to now calling
evnt() we also need to check if we should exit sleep early due to an
evnt() firing.

Fixes: #294
2023-02-12 21:27:25 -05:00
Matthew Kilgore f21ce09e2d Replace time() with std::chrono, fix startup delay
Currently main() includes logic that is intended to sync time() with
GetTicks() for the purpose of using GetTicks() to get millisecond
accuracy with time(), which only has second accuracy. Unfortunately, the
'syncing' up of these time sources results in an average of a half
second delay in starting a QB64-PE program.

This logic is easly replaced with std::chrono, which provides a real
time clock which is also millisecond accurate. That removes the need to
use time() and GetTicks() together to get millisecond accuracy, and
means the delay syncing them is no longer necessary.

I also separated most of the "delay" and "time" related functions into
datetime.cpp, and included the new std::chrono code into that file.

Since I needed to call some of the rounding functions in datetime.cpp I
also moved that stuff out into its own .cpp and header files to clean
things up a bit.

Fixes: #282
2023-01-08 20:24:25 -05:00
Samuel Gomes 845931bf39 Fix all test failures 2023-01-06 18:31:27 +05:30
Samuel Gomes e5b5a86b96 Update test to inlcude invalid parameters for _NEWSND 2023-01-06 12:39:44 +05:30
Samuel Gomes 6c72deafc1 Improve _SNDOPEN test and supress printfs in Hively replayer code 2023-01-01 23:14:05 +05:30
Samuel Gomes 061bf6af3d Rename _NEWSOUND to _SNDNEW to align with _SND* APIs 2022-12-31 12:00:38 +05:30
Samuel Gomes 1179d3c084 Update sndopen_mem_test to not use any file I/O 2022-12-31 07:47:20 +05:30
Samuel Gomes b2723cf057 Fix path for file in test for *nix 2022-12-31 05:40:39 +05:30
Samuel Gomes 31257262a8 Add tests for _NEWSOUND and _SNDOPEN 2022-12-31 04:22:42 +05:30
Matthew Kilgore a79c943d36 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`.
2022-11-29 20:04:53 -05:00
Matthew Kilgore 11a5b8be8e _OpenClient() should return zero on connection failure, not error 2022-11-20 18:44:24 -05:00
Matthew Kilgore 445408d95b _StatusCode() should give the correct error on invalid handle type
Passing a handle of the invalid type (Ex. TCP) to _StatusCode should
give error 52, but it gies error 9.
2022-11-20 04:38:03 -05:00
Matthew Kilgore 12c9c35db5 Add _StatusCode command for HTTP handles
The _StatusCode command returns the status code on the HTTP response
when given a HTTP handle from _OpenClient().
2022-11-20 04:04:02 -05:00
Matthew Kilgore e8ebf56a2f Add basic http tests
These tests cover basic HTTP functionality via _OPENCLIENT(), and also
that it fails to work without `$Unstable:Http` in place.
2022-11-19 15:13:26 -05:00
Matthew Kilgore c5e2be53f9 Swap bmp test images for png
Functionally it doesn't matter what kind of images we store for the
tests, as _LOADIMAGE() will open them exactly the same. png however has
the advantages of being substantially smaller, and also viewable
directly on GitHub in PRs, making them easier to review.
2022-11-09 21:56:44 -05:00