summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2022-08-04Tests: Update TestFontHandling and add new testthankyouverycool
Updates BitmapFont testing for fallible writes and adds a new test font file for use in a new un/masking test.
2022-08-04Tests: Add a test for markdown image sizesMacDue
2022-07-27Everywhere: Make the codebase more architecture awareUndefine
2022-07-27LibCore: Implement four-digit modes for `FilePermissionsMask` parsingTim Schumacher
2022-07-27LibCore: Implement the 'X' modifier into `FilePermissionMask`Tim Schumacher
2022-07-22Everywhere: Prefix 'TYPEDEF_DISTINCT_NUMERIC_GENERAL' with 'AK_'Linus Groh
2022-07-22Tests: Add a test for `pthread_cancel`Tim Schumacher
2022-07-22Tests: Add tests for `pthread_setcancel{state,type}`Tim Schumacher
We likely won't be able to test `pthread_cancel` itself, but this at least makes sure that we use the correct values by default and that we correctly reject invalid values.
2022-07-20LibRegex: Partially implement the ECMAScript unicodeSets proposalAli Mohammad Pur
This skips the new string unicode properties additions, along with \q{}.
2022-07-19LibC: Remove the `LibPthread` interface targetTim Schumacher
2022-07-19Tests: Move the LibPthread tests to the correct namespaceTim Schumacher
2022-07-19Everywhere: Refer to `pthread.h` by its non-prefixed nameTim Schumacher
This removes a bit of noise from the following patches, where we will move the `pthread.h` header out of the `LibPthread` directory.
2022-07-14AK: Use the correct data types in bitap_bitwise()Ali Mohammad Pur
Otherwise the bit twiddling goes all wrong and breaks some boundary cases. Fixes `StringView::contains(31-chars)`.
2022-07-12Tests: Remove StringView char const* initialization testsin-ack
We now explicitly disallow this.
2022-07-12AK+Userland+Tests: Remove URL(char const*) constructorsin-ack
The StringView(char const*) constructor is being removed, and there was only a few users of this left, which are also cleaned up in this commit.
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-12Everywhere: Explicitly specify the size in StringView constructorssin-ack
This commit moves the length calculations out to be directly on the StringView users. This is an important step towards the goal of removing StringView(char const*), as it moves the responsibility of calculating the size of the string to the user of the StringView (which will prevent naive uses causing OOB access).
2022-07-12Tests: Convert TestQuotedPrintable decode test to use StringViewssin-ack
2022-07-12Tests: Convert TestBase64 decode test to use StringViews directlysin-ack
Previously it would rely on the implicit StringView conversions. Now the decode_equal function will directly use StringViews.
2022-07-12Tests: Make TestSourceLocation basic_scenario specify StringView lengthsin-ack
2022-07-10AK: Treat empty string as invalid JSONLuke Wilde
Previously we would treat the empty string as `null`. This caused JavaScript like this to fail: ```js var object = {}; try { object = JSON.parse(""); } catch {} var array = object.array || []; ``` Since `JSON.parse("")` returned null instead of throwing, it would set `object` to null and then try and use it instead of using the default backup value.
2022-07-10LibXML: Fail gracefully on integer overflow in character referencesIdan Horowitz
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47738
2022-07-10LibRegex: Treat inverted Compare entries as disjunctionsAli Mohammad Pur
[^XYZ] is not(X | Y | Z), we used to translate this to not(X) | not(Y) | not(Z), this commit makes LibRegex interpret this pattern as not(X) & not(Y) & not(Z).
2022-07-09AK: Add IPv4Address::netmask_from_cidrMaciej
2022-07-09LibRegex: Fix lookup table-based range checks in CompareAli Mohammad Pur
The lowercase version of a range is not required to be a valid range, instead of casefolding the range and making it invalid, check twice with both cases of the input character (which are the same as the input if not insensitive). This time includes an actual test :^)
2022-07-08Tests: Remove the RDTSC kernel crash testTim Schumacher
We will remove the RDTSC instruction restriction to allow QEMU to read an accurate time, so this will no longer crash and therefore fail the test.
2022-07-06AK: Use an enum instead of a bool for String::replace(all_occurences)DexesTTP
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
2022-07-05Tests: Add tests for inheriting signal handlersTim Schumacher
2022-07-05LibRegex: Use proper CharRange constructor instead of bit_castingAli Mohammad Pur
Otherwise the range order would be inverted.
2022-07-04LibRegex: Fully interpret the Compare Op when looking for overlapsAli Mohammad Pur
We had a really naive and simplistic implementation, which lead to various issues where the optimiser incorrectly rewrote the regex to use atomic groups; this commit fixes that.
2022-07-04Tests: Move sprintf test from AK/ to LibC/Daniel Bertalan
This test doesn't test AK::String, but LibC's sprintf instead, so it does not belong in `Tests/AK`. This also means this test won't be ran on Lagom using the host OS's printf implementation. Fixes a deprecated declaration warning when compiling with macOS SDK 13.
2022-06-30Tests: Add tests for <ctype.h> functions declared in the C StandardAndrew Kaster
2022-06-24Tests: Add test for dlsym(RTLD_DEFAULT) for symbols from dlopen'd libsAndrew Kaster
This broke with recent changes to library loading and mapping order.
2022-06-23AK: Zero previous pointer *after* fixing the insertion list in HashTableHendiadyoin1
2022-06-23Tests: Add tests for `wcsftime`Tim Schumacher
2022-06-23LibJS: Implement WeakMap changes from 'Symbol as WeakMap Keys Proposal'Idan Horowitz
2022-06-22AK: Clear the previous and next pointers of deleted HashTable bucketsIdan Horowitz
Usually the values of the previous and next pointers of deleted buckets are never used, as they're not part of the main ordered bucket chain, but if an in-place rehashing is done, which results in the bucket being turned into a free bucket, the stale pointers will remain, at which point any item that is inserted into said free-bucket will have either a stale previous pointer if the HashTable was empty on insertion, or a stale next pointer, resulting in undefined behaviour. This commit also includes a new HashMap test that reproduces this issue
2022-06-13AK/ByteBuffer+Everywhere: Handle errors in ByteBuffer::slice()Matthias Zimmerman
2022-06-10Tests: Add tests for the LibPthread cleanup handlersTim Schumacher
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