summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2022-10-07LibUnicode: Update code point ideographic replacements for Unicode 15Timothy Flynn
2022-10-07LibUnicode: Fix Hangul syllable composition for specific casesmatcool
This fixes `combine_hangul_code_points` which would try to combine a LVT syllable with a trailing consonant, resulting in a wrong character. Also added a test for this specific case.
2022-10-06LibC: Implement `mkstemps()` in stdlib and add a testEWouters
`mkstemps` generates a unique temporary file name from a pattern like `prefixXXXXXXsuffix` where `prefix` and `suffix` can be any string with only characters that are valid in a filename. The second parameter is the length of the suffix. `mkstemp` is `mkstemps` with suffix length 0, so to avoid code duplication it calls `mkstemps`. It is unlikely this has any significant performance impact on SerenityOS. `generate_unique_filename` now takes the suffix length as a `size_t`. The original behavior of this function is preserved when specifying a suffix length of 0. All original uses of this function have been adapted. `mkstemps()` was added because it is required by version 4.6.3 of the ccache port.
2022-10-06Tests: Add tests for LibUnicode's normalizematcool
2022-10-04AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most placesNico Weber
Doesn't use them in libc headers so that those don't have to pull in AK/Platform.h. AK_COMPILER_GCC is set _only_ for gcc, not for clang too. (__GNUC__ is defined in clang builds as well.) Using AK_COMPILER_GCC simplifies things some. AK_COMPILER_CLANG isn't as much of a win, other than that it's consistent with AK_COMPILER_GCC.
2022-09-28LibTimeZone: Use the last DST rule in the TZDB if a match isn't foundTimothy Flynn
Some time zones, like "Asia/Shanghai", use a set of DST rules that end before present day. In these cases, we should fall back to last possible RULE entry from the TZDB. The time zone compiler published by IANA (zic) performs the same fallback starting with version 2 of the time zone file format.
2022-09-26Tests/Kernel: Add tests to ensure we don't regress InodeVMObjectsLiav A
2022-09-24Revert "Tests/Kernel: Add tests to ensure we don't regress InodeVMObjects"Liav A
This reverts commit b0d555163bc724542ea6560a2bc82bc3b620c31d.
2022-09-21AK+LibJS: Handle NaN-boxing pointers on AArch64Daniel Bertalan
JS::Value stores 48 bit pointers to separately allocated objects in its payload. On x86-64, canonical addresses have their top 16 bits set to the same value as bit 47, effectively meaning that the value has to be sign-extended to get the pointer. AArch64, however, expects the topmost bits to be all zeros. This commit gates sign extension behind `#if ARCH(X86_64)`, and adds an `#error` for unsupported architectures, so that we do not forget to think about pointer handling when porting to a new architecture. Fixes #15290 Fixes SerenityOS/ladybird#56
2022-09-20Kernel/Tests: Don't compile x86 IO for non-x86 buildsLiav A
x86 IO space is not relevant for non-x86 builds so it doesn't make sense to include it in such build as it will not compile anyway.
2022-09-20AK: Fix bad parsing of some file:/// URLs with base URLAndreas Kling
We were dropping the base URL path components in the resulting URL due to mistakenly determining the input URL to start with a Windows drive letter. Fix this, add a spec link, and a test.
2022-09-17LibCompress+Tests: Demonstrate and fix faulty metadata lengthBen Wiederhake
The test-case is heavily inspired by: https://github.com/google/brotli/blob/master/tests/testdata/x.compressed.01 Or in words: A metadata meta-block containing `Y` (which should be ignored), and then the actual data (a single `Z`). The bug used to skip one metadata byte too few, and thus read garbage.
2022-09-16Tests: Move the former LibM test into the LibC namespaceTim Schumacher
2022-09-16LibGL: Make GL::create_context fallibleAndrew Kaster
Propagate errors in places that are already set up to handle them, like WebGLRenderingContext and the Tubes demo, and convert other callers to using MUST.
2022-09-16Tests/Kernel: Add tests to ensure we don't regress InodeVMObjectsLiav A
2022-09-15AK+Tests: Don't double-destroy NoAllocationGuard in TestFixedArrayHendiadyoin1
This caused the m_allocation_enabled_previously member to be technically uninitialized when the compiler emits the implicit destructor call for stack allocated classes. This was pointed out by gcc on lagom builds, no clue how this was flying under the radar for so long and is not triggering CI.
2022-09-14Everywhere: Fix a variety of typosBrian Gianforcaro
Spelling fixes found by `codespell`.
2022-09-13LibJS: Mark test262's __assert_fail as `extern "C"` and useHendiadyoin1
...`__attribute__((__noreturn__))` This is more inline with the definition in glibc's version of the file, and stops clang from complaining about it originally not being declared as `[[no_return]]`.
2022-09-12LibRegex: Account for eof after \<x> when 'x' leads to legacy behaviourAli Mohammad Pur
2022-09-11LibGL+LibGPU+LibSoftGPU: Implement matrix stack per texture unitJelle Raaijmakers
Each texture unit now has its own texture transformation matrix stack. Introduce a new texture unit configuration that is synced when changed. Because we're no longer passing a silly `Vector` when drawing each primitive, this results in a slightly improved frames per second :^)
2022-09-11LibJS: Add the test-test262 utilitydavidot
This allows running of test262 (like) tests with any runner. And thus allows running the full test262 suite on Serenity itself. The functionality of test-test262 is intentionally limited at first. It does support: - Progress updates including the special serenity terminal commands - Outputting a per-file, to compare against other runs - Passing any number of parameters to the runner - Setting the batch size of the amount of tests per runner process - Outputting a summary of the test results
2022-09-11test262-runner: Don't create a VM and Interpreter if just parsingdavidot
If a test is supposed to fail during parse or early phase we can stop after parsing. Because phases in modules are not as clear we don't skip the other parts for modules.
2022-09-11test262-runner: Convert dbgln to warnlndavidot
Since this application is now supposed to be used from within Serenity we should make sure to warn the actual user.
2022-09-11test262-runner: Add option to disable core dumpingdavidot
When running a larger set of tests in Serenity the runner would otherwise trigger a lot of crash reporters. This would then in turn lead to memory starvation causes more crashes.
2022-09-11test262-runner: Attempt to resolve harness for test262 automaticallydavidot
This makes it easier to use the runner directly.
2022-09-11test262-runner: Overwrite __assertion_failed when compiling for Serenitydavidot
We also protect against recursive assert failures, for example due to being out of memory. With this change the runner now compiles and runs on Serenity :^).
2022-09-11test262-runner: Rename variable stdin to standard_inputdavidot
This was shadowing a name in LibC triggering warnings.
2022-09-11test262-runner: Use alarm instead of setitimerdavidot
Since setitimer is not implemented in Serenity we use alarm which triggers SIGALRM after the timeout. We also don't use a signal handler as we are doing things that serenity doesn't like/doesn't allow. Linux dealt with allocating and writing in a signal handler but it is undefined, so instead we just let the process die by SIGALRM. This means we instead of reading the output can detect timeouts by checking how the process died.
2022-09-11LibJS: Import the libjs-test262-runner from linusg/libjs-test262davidot
For now this is a lagom only application as it is not compatible with serenity in its current state. The only change is that it is released under a different license with permission from all the authors.
2022-09-10LibJS: Allow negative pointers in Valuedavidot
Also ensure that all a nullptr input gives null object and you don't accidentally dereference a nullptr.
2022-09-09LibC: Consume all whitespace in `scanf` if present in formatJelle Raaijmakers
We were consuming all whitespace from the format, but not the input lexer - that was left to the actual format parsing code. It so happened that we did not account for whitespace with the conversion specifier '[', causing whitespace to end up in the output variables. Fix this by always consuming all whitespace and removing the whitespace logic from the conversion code.
2022-09-05LibLocale: Move locale source files to the LibLocale libraryTimothy Flynn
Everything is now setup to create the LibLocale library and link it where needed.
2022-09-05LibLocale: Move locale test files to the LibLocale folderTimothy Flynn
2022-09-05LibLocale: Move locale source files to the LibLocale folderTimothy Flynn
These are still included in LibUnicode, but this updates their location and the include paths of other files which include them.
2022-09-05Userland: Move files destined for LibLocale to the Locale namespaceTimothy Flynn
2022-09-05LibUnicode+Userland: Migrate generated CLDR data to LibLocaleDataTimothy Flynn
Currently, LibUnicodeData contains the generated UCD and CLDR data. Move the UCD data to the main LibUnicode library, and rename LibUnicodeData to LibLocaleData. This is another prepatory change to migrate to LibLocale.
2022-09-05LibC: Remove the `LibDl` interface targetTim Schumacher
2022-09-05Everywhere: Refer to `dlfcn*.h` by its non-prefixed nameTim Schumacher
2022-09-02Meta+Tests: Allow running FLAC spec testskleines Filmröllchen
The FLAC "spec tests", or rather the test suite by xiph that exercises weird FLAC features and edge cases, can be found at https://github.com/ietf-wg-cellar/flac-test-files and is a good challenge for our FLAC decoder to become more spec compliant. Running these tests is similar to LibWasm spec tests, you need to pass INCLUDE_FLAC_SPEC_TESTS to CMake. As of integrating these tests, 23 out of 63 fail. :yakplus:
2022-09-02AK: Allow exponents in JSON double valuesdavidot
This is required for ECMA-404 compliance, but probably not for serenity itself.
2022-08-29LibRegex: Explicitly check if a character falls into a table-based rangeTimothy Flynn
Previously, for a regex such as /[a-sy-z]/i, we would incorrectly think the character "u" fell into the range "a-s" because neither of the conditions "u > s && U > s" or "u < a && U < a" would be true, resulting in the lookup falling back to assuming the character is in the range. Instead, first explicitly check if the character falls into the range, rather than checking if it falls outside the range. If the explicit checks fail, then we know the character is outside the range.
2022-08-27LibJS: Move intrinsics to the realmLinus Groh
Intrinsics, i.e. mostly constructor and prototype objects, but also things like empty and new object shape now live on a new heap-allocated JS::Intrinsics object, thus completing the long journey of taking all the magic away from the global object. This represents the Realm's [[Intrinsics]] slot in the spec and matches its existing [[GlobalObject]] / [[GlobalEnv]] slots in terms of architecture. In the majority of cases it should now be possibly to fully allocate a regular object without the global object existing, and in fact that's what we do now - the realm is allocated before the global object, and the intrinsics between both :^)
2022-08-27LibGL+LibGPU+LibSoftGPU: Implement texture pixel format supportJelle Raaijmakers
In OpenGL this is called the (base) internal format which is an expectation expressed by the client for the minimum supported texel storage format in the GPU for textures. Since we store everything as RGBA in a `FloatVector4`, the only thing we do in this patch is remember the expected internal format, and when we write new texels we fixate the value for the alpha channel to 1 for two formats that require it. `PixelConverter` has learned how to transform pixels during transfer to support this.
2022-08-27LibGL+LibGPU+LibSoftGPU: Implement flexible pixel format conversionJelle Raaijmakers
A GPU (driver) is now responsible for reading and writing pixels from and to user data. The client (LibGL) is responsible for specifying how the user data must be interpreted or written to. This allows us to centralize all pixel format conversion in one class, `LibSoftGPU::PixelConverter`. For both the input and output image, it takes a specification containing the image dimensions, the pixel type and the selection (basically a clipping rect), and converts the pixels from the input image to the output image. Effectively this means we now support almost all OpenGL 1.5 formats, and all custom logic has disappeared from: - `glDrawPixels` - `glReadPixels` - `glTexImage2D` - `glTexSubImage2D` The new logic is still unoptimized, but on my machine I experienced no noticeable slowdown. :^)
2022-08-27AK: Add `FloatingPoint.h`Jelle Raaijmakers
This is a set of functions that allow you to convert between arbitrary IEEE 754 floating point types, as long as they can be represented within 64 bits. Conversion methods between floats and doubles are provided, as well as a generic `float_to_float()`. Example usage: #include <AK/FloatingPoint.h> double val = 1.234; auto weird_f16 = convert_from_native_double<FloatingPointBits<0, 6, 10>>(val); Signed and unsigned floats are supported, and both NaN and +/-Inf are handled correctly. Values that do not fit in the target floating point type are clamped.
2022-08-26LibCrypto+LibJS: Remove the create_from methods from BigIntegerdavidot
Instead we just use a specific constructor. With this set of constructors using curly braces for constructing is highly recommended. As then it will not do too many implicit conversions which could lead to unexpected loss of data or calling the much slower double constructor. Also to ensure we don't feed (Un)SignedBigInteger infinities we throw RangeError earlier for Durations.
2022-08-26LibCrypto: Add a constructor to (Un)SignedBigInteger taking a doubledavidot
For now this will assume that the double given is exactly representable as an integer, so no NaN, infinity or rounding.
2022-08-26LibCrypto: Make the constructors of (Un)SignedBigInteger templateddavidot
This means it can take any (un)signed word of size at most Word. This means the constructor can be disambiguated if we were to add a double constructor :^). This requires a change in just one test.
2022-08-26LibCrypto: Add a rounding mode to UnsignedBigInteger::to_doubledavidot
This allows using different options for rounding, like IEEE roundTiesToEven, which is the mode that JS requires. Also fix that the last word read from the bigint for the mantissa could be shifted incorrectly leading to incorrect results.
2022-08-25LibTimeZone: Fix tests when ENABLE_TIME_ZONE_DATABASE_DOWNLOAD is OFFTimothy Flynn