1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-05-12 12:00:13 +00:00
Commit graph

121 commits

Author SHA1 Message Date
Samuel Gomes 3d43883b6e Fix NOT working correctly when combined with other operators in an expression 2024-04-28 18:57:44 +05:30
Samuel Gomes 4e4b8149b4 Add test for boolean logical ops 2024-04-06 22:19:13 +05:30
Samuel Gomes 20f1871966 Add clipboard test and add clip license 2024-03-29 23:21:10 +05:30
Roland Heyder be46dc870e Fix tests
according to: https://discord.com/channels/975381912350752819/975389657212805160/1219440128150208534
2024-03-19 01:32:11 +01:00
Matthew Kilgore 871da4fc12 Fix divide in CONST
The regular division symbol always converts its arguments to floating
point before dividing, similar to how integer division converts its
arguments to integers before dividing.
2024-02-25 01:36:56 -05:00
Matthew Kilgore ada8255572 Fix unsigned multiplication in CONST
Multiplication wasn't using the ParseNum helper methods and as a result
wasn't setting num.ui, resulting in the wrong answer when using
unsigned.

I additionally switch it to use the proper signed vs unsigned type when
doing the multiplication.
2024-02-13 15:59:38 -05:00
Roland Heyder 36af0b292a 7.) Fix test case
- add SYSTEM to avoid deadlock of workflow
2024-02-07 22:01:34 +01:00
Roland Heyder e09c4a9ec9 6.) Add a test case for $INCLUDEONCE 2024-02-07 21:33:32 +01:00
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
Matt Kilgore 71b5ddd432
Merge branch 'main' into main 2023-12-12 12:04:12 -05:00
Matthew Kilgore 06941f1aaf Add a short delay after killing pulseaudio
It seems to sometimes not be dead when we go to start it, presumably the
`puleaudio -k` doesn't actually wait for the process to exit.
2023-12-08 13:06:36 -05:00
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
RainRat 3914037c0f fix typos 2023-04-30 15:20:42 -07:00
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
Matthew Kilgore 1f49cee3d1 Add the ability to compile tests from base folder 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