summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2022-06-04LibGL: Reject GL_LEFT and GL_RIGHT in glCullFaceLuke Wilde
glCullFace only accepts GL_FRONT, GL_BACK and GL_FRONT_AND_BACK. We checked if the mode was valid by performing ``` cull_mode < GL_FRONT || cull_mode > GL_FRONT_AND_BACK ``` However, this range also contains GL_LEFT and GL_RIGHT, which we would accept when we should return a GL_INVALID_ENUM error.
2022-06-02LibGL: Check that texture name is allocated before marking it as freeLuke Wilde
glDeleteTextures previously did not check that the texture name was allocated by glGenTextures before adding it to the free texture name list. This means that if you delete a texture twice in a row, the name will appear twice in the free texture list, making glGenTextures return the same texture name twice in a row.
2022-05-30LibXML+Tests: Consume `>` in the character data ending `]]>` and test itLuke Wilde
For example, with this input: ```xml <C>]]> ``` After seeing `<C>`, the parser will start parsing the content of the element. The content parser will then parse any character data it sees. The character parser would see the first two `]]` and consume them. Then, it would see the `>` and set the state machine to say we have seen this, but it did _not_ consume it and would instead tell GenericLexer that it should stop consuming characters. Therefore, we only consumed 2 characters. Then, it would see that we are in the state where we've seen the full `]]>` and try to take off three characters from the end of the consumed input when we only have 2 characters, causing an assertion failure as we are asking to take off more characters than there really is.
2022-05-21LibCompress: Implement Brotli decompressorMichiel Visser
This implements the BrotliDecompressionStream, which is a Core::Stream that can decompress another Core::Stream.
2022-05-20Tests: Add tests for posix_memalign(3) and aligned_alloc(3)Peter Elliott
2022-05-12LibCrypto: Add Ed25519stelar7
2022-05-12Tests: Fix new GCC 12 warningsDaniel Bertalan
2022-05-09LibGL+LibGPU+LibSoftGPU: Implement point and line drawingJelle Raaijmakers
Implement (anti)aliased point drawing and anti-aliased line drawing. Supported through LibGL's `GL_POINTS`, `GL_LINES`, `GL_LINE_LOOP` and `GL_LINE_STRIP`. In order to support this, `LibSoftGPU`s rasterization logic was reworked. Now, any primitive can be drawn by invoking `rasterize()` which takes care of the quad loop and fragment testing logic. Three callbacks need to be passed: * `set_coverage_mask`: the primitive needs to provide initial coverage mask information so fragments can be discarded early. * `set_quad_depth`: fragments survived stencil testing, so depth values need to be set so depth testing can take place. * `set_quad_attributes`: fragments survived depth testing, so fragment shading is going to take place. All attributes like color, tex coords and fog depth need to be set so alpha testing and eventually, fragment rasterization can take place. As of this commit, there are four instantiations of this function: * Triangle rasterization * Points - aliased * Points - anti-aliased * Lines - anti-aliased In order to standardize vertex processing for all primitive types, things like vertex transformation, lighting and tex coord generation are now taking place before clipping.
2022-05-05Everywhere: Purge all support and usage of framebuffer devicesLiav A
Long live the DisplayConnector object!
2022-05-05Everywhere: Rename FB prefix name ioctls => GRAPHICSLiav A
2022-05-03LibJS: Remove implicit wrapping/unwrapping of completion recordsLinus Groh
This is an editorial change in the ECMA-262 spec, with similar changes in some proposals. See: - https://github.com/tc39/ecma262/commit/7575f74 - https://github.com/tc39/proposal-array-grouping/commit/df899eb - https://github.com/tc39/proposal-shadowrealm/commit/9eb5a12 - https://github.com/tc39/proposal-shadowrealm/commit/c81f527
2022-05-02Kernel: Stop requiring working malloc for syscall.h includesPatrick Meyer
Fixes #13869
2022-04-22LibRegex: Check inverse_matched after every op, not just at the endAli Mohammad Pur
Fixes #13755. Co-Authored-By: Damien Firmenich <fir.damien@gmail.com>
2022-04-21LibCore: Introduce SharedSingleProducerCircularQueuekleines Filmröllchen
This new class with an admittedly long OOP-y name provides a circular queue in shared memory. The queue is a lock-free synchronous queue implemented with atomics, and its implementation is significantly simplified by only accounting for one producer (and multiple consumers). It is intended to be used as a producer-consumer communication datastructure across processes. The original motivation behind this class is efficient short-period transfer of audio data in userspace. This class includes formal proofs of several correctness properties of the main queue operations `enqueue` and `dequeue`. These proofs are not 100% complete in their existing form as the invariants they depend on are "handwaved". This seems fine to me right now, as any proof is better than no proof :^). Anyways, the proofs should build confidence that the implemented algorithms, which are only roughly based on existing work, operate correctly in even the worst-case concurrency scenarios.
2022-04-20LibGL: Set W-coordinate to 1 in `glRect*`Jelle Raaijmakers
According to the spec, these calls should be identical to an invocation of `glVertex2*`, which sets the W-coordinate to 1 by default. This fixes the credits sequence rendering of Tux Racer.
2022-04-17LibTLS: Fix TestTLSHandshake by correctly reading the CA certificatesMichiel Visser
2022-04-17Tests: Implement reference image testing for LibGLJelle Raaijmakers
Each LibGL test can now be tested against a reference QOI image. Initially, these images can be generated by setting `SAVE_OUTPUT` to `true`, which will save a bunch of QOI images to `/home/anon`.
2022-04-16LibCore+Everywhere: Make Core::Stream read_line() return StringViewSam Atkins
Similar reasoning to making Core::Stream::read() return Bytes, except that every user of read_line() creates a StringView from the result, so let's just return one right away.
2022-04-16LibCore+Everywhere: Make Core::Stream::read() return BytesSam Atkins
A mistake I've repeatedly made is along these lines: ```c++ auto nread = TRY(source_file->read(buffer)); TRY(destination_file->write(buffer)); ``` It's a little clunky to have to create a Bytes or StringView from the buffer's data pointer and the nread, and easy to forget and just use the buffer. So, this patch changes the read() function to return a Bytes of the data that were just read. The other read_foo() methods will be modified in the same way in subsequent commits. Fixes #13687
2022-04-14Tests: Add a test for printf truncationTim Schumacher
2022-04-13LibCrypto: Add ChaCha20stelar7
2022-04-11AK: Disable the HashTable<double> test until UB issue is fixedAndreas Kling
2022-04-10AK: Add hash traits for floating-point primitivesAndreas Kling
This allows us to use float and double as hash keys.
2022-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-04-09LibGfx: Move TTF files from TrueTypeFont/ to Font/TrueType/Simon Wanner
2022-04-08test-js: Define detachArrayBuffer global functionTimothy Flynn
2022-04-08LibCrypto: Add Poly1305stelar7
2022-04-06Tests: Remove test-webAndreas Kling
This was not used or maintained, and relied on InProcessWebView which we need to get rid of.
2022-04-05AK: Invalidate UTF-8 encoded code points larger than U+10ffffTimothy Flynn
On oss-fuzz, the LibJS REPL is provided a file encoded with Windows-1252 with the following contents: /ô¡°½/ The REPL assumes the input file is UTF-8. So in Windows-1252, the above is represented as [0x2f 0xf4 0xa1 0xb0 0xbd 0x2f]. The inner 4 bytes are actually a valid UTF-8 encoding if we only look at the most significant bits to parse leading/continuation bytes. However, it decodes to the code point U+121c3d, which is not a valid code point. This commit adds additional validation to ensure the decoded code point itself is also valid.
2022-04-04AK: Allow Optional<T&> to existAli Mohammad Pur
This implements Optional<T&> as a T*, whose presence has been missing since the early days of Optional. As a lot of find_foo() APIs return an Optional<T> which imposes a pointless copy on the underlying value, and can sometimes be very misleading, with this change, those APIs can return Optional<T&>.
2022-04-03Tests: Make TestEFault not rely on automatic guard pagesAndreas Kling
I'm about to break automatic guard page allocation in sys$mmap(), so we need to fix this test to not rely on it.
2022-04-03Tests: Clear errno before syscalls in TestEFaultAndreas Kling
This makes the debug output a little more helpful.
2022-04-03Tests: Remove unused macro in TestEFaultAndreas Kling
2022-04-03Tests: Add some test coverage for the TTF parserNico Weber
This is in Tests/LibTTF instead of Tests/LibGfx because Tests/LibGfx depends on serenity's file system layout and can't run in lagom, but this new test runs just fine in lagom.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-31Tests: Test non-trivial re-hashing in HashTablekleines Filmröllchen
This caused a system-wide crash because of a previous bug relating to non-trivial types in HashTable. Therefore, check that such types actually work under various workloads.
2022-03-31Tests: Introduce a HashTable benchmark for "table thrashing"kleines Filmröllchen
Thrashing is what I call the situations where a table is mostly filled with deleted markers, causing an increase in size (at least temporarily) when a simple re-hash would be enough to get rid of those. This happens when a hash table (especially with many elements) has a lot of deletes and re-inserts done to it, which is what this benchmark does.
2022-03-30AK: Allow printing wide characters using %ls modifiersafarp
2022-03-29LibPDF: Add implementation of the Standard security handlerMatthew Olsson
Security handlers manage encryption and decription of PDF files. The standard security handler uses RC4/MD5 to perform its crypto (AES as well, but that is not yet implemented).
2022-03-29Tests: Add a basic UTF-8 to UTF-8 LibTextCodec testKarol Kosek
2022-03-27AK: Add an ArbitrarySizedEnum templateLinus Groh
This is an enum-like type that works with arbitrary sized storage > u64, which is the limit for a regular enum class - which limits it to 64 members when needing bit field behavior. Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
2022-03-26LibCrypto: Correctly add length to SHA384 and SHA512 hashesMichiel Visser
The SHA384 and SHA512 hashes would produce incorrect results for data where the length % 128 was in the range 112-119. This was because the total number of bits in the hashed values was added at the end as a 64-bit number instead of a 128-bit number. In most cases this would not cause any issues, as this space was padded with zeroes, however in the case that the length % 128 was 112-119, some incorrect data ended up where this 128-bit length value was expected. This change fixes the problems in LibTLS where some websites would result in a DecryptError on handshake.
2022-03-24Userland+Tests: Convert File::read_link() from String to ErrorOr<String>Kenneth Myhra
This converts the return value of File::read_link() from String to ErrorOr<String>. The rest of the change is to support the potential of an Error being returned and subsequent release of the value when no Error is returned. Unfortunately at this stage none of the places affected can utililize our TRY() macro.
2022-03-20Everywhere: Move commonmark.spec.json to /home/anon/TestsBrian Gianforcaro
2022-03-20Everywhere: Move cpp-tests under /home/anon/TestsBrian Gianforcaro
2022-03-20LibCrypto: Add DH exchange for SECP256r1 to TestCurvesMichiel Visser
2022-03-20LibCrypto+LibTLS: Add SECP256r1 support to LibTLSMichiel Visser
Add the required methods to SECP256r1 to conform to the EllipticCurve virtual base class. Using this updated version of SECP256r1, support in LibTLS is implemented.
2022-03-20LibCrypto+LibTLS: Generalize the elliptic curve interfaceMichiel Visser
These changes generalize the interface with an elliptic curve implementation. This allows LibTLS to support elliptic curves generally without needing the specifics of elliptic curve implementations. This should allow for easier addition of other elliptic curves.
2022-03-18AK+Tests: Fix StringUtils::contains() being confused by repeating textSam Atkins
Previously, case-insensitively searching the haystack "Go Go Back" for the needle "Go Back" would return false: 1. Match the first three characters. "Go ". 2. Notice that 'G' and 'B' don't match. 3. Skip ahead 3 characters, plus 1 for the outer for-loop. 4. Now, the haystack is effectively "o Back", so the match fails. Reducing the skip by 1 fixes this issue. I'm not 100% convinced this fixes all cases, but I haven't been able to find any cases where it doesn't work now. :^)
2022-03-18LibCrypto: Implement the SECP256r1 elliptic curveMichiel Visser
This implementation of the secp256r1 elliptic curve uses two techniques to improve the performance of the operations. 1. All coordinates are stored in Jacobian form, (X/Z^2, Y/Z^3, Z), which removes the need for division operations during point addition or doubling. The points are converted at the start of the computation, and converted back at the end. 2. All values are transformed to Montgomery form, to allow for faster modular multiplication using the Montgomery modular multiplication method. This means that all coordinates have to be converted into this form, and back out of this form before returning them.