summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2023-02-01CI: Move running LibWeb layout tests to AzureTimothy Flynn
The current config on GitHub Actions does not use ccache, so it takes quite a while to build. Instead, let's just run these tests on Azure where we already build Ladybird and have ccache enabled. This also lets us sanitize LibWeb on both Linux and macOS. The script changes here are to A) handle differences between Azure and GitHub Actions and B) to support running on macOS.
2023-02-01LibGfx+Tests: Remove code unnecessary after 9e7c16d0a44052e598103Nico Weber
2023-02-01LibGfx: Move TestImageDecoder over to input file approach in 8cfabbcd933Nico Weber
Rather than reading files out of /res, put them in a subfolder of Tests/LibGfx/ and pick the path based on AK_OS_SERENITY. That way, the tests can also pass when run under lagom. (I just `cp`d all the files that the test previously read from random places into Tests/LibGfx/test-inputs.)
2023-02-01LibGfx: Move TestFontHandling over to input file approach in 8cfabbcd933Nico Weber
Rather than reading files out of /res, put them in a subfolder of Tests/LibGfx/ and pick the path based on AK_OS_SERENITY. That way, the tests can also pass when run under lagom.
2023-01-31AK: Fix all quadratic-time append-loops over ByteBufferBen Wiederhake
2023-01-29AK: Move memory streams from `LibCore`Tim Schumacher
2023-01-29Tests: Remove the 10KB file read test for AllocatingMemoryStreamTim Schumacher
When we move the test to AK (together with the actual stream implementation), finding the input file to read from is going to become significantly harder, since the test also runs outside of SerenityOS. Since this was just a smoke test during early development (and we should now have reasonable coverage with actual usages in the other parts of the OS), let's just remove that test instead of trying to make input file lookups work.
2023-01-29AK: Move bit streams from `LibCore`Tim Schumacher
2023-01-29AK: Move `Stream` and `SeekableStream` from `LibCore`Tim Schumacher
`Stream` will be qualified as `AK::Stream` until we remove the `Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is defined by `SeekableStream`, since defining its own would require us to qualify it with `AK::SeekMode` everywhere.
2023-01-29AK: Move `Handle` from `LibCore` and name it `MaybeOwned`Tim Schumacher
The new name should make it abundantly clear what it does.
2023-01-29AK: Deprecate the old `AK::Stream`Tim Schumacher
This also removes a few cases where the respective header wasn't actually required to be included.
2023-01-29Tests: Modernize TestImageDecoder a bitNico Weber
- Use MUST() instead of checking plugin_decoder_or_error.is_error() - Use MappedFile::bytes() - Don't use EXPECT_EQ when comparing to fixed bools No intended behavior change.
2023-01-29Tests: Make LibGfx tests not depend on LibGUINico Weber
As far as I can tell, that's not needed and never was.
2023-01-29Tests: Add LibWeb layout testsAliaksandr Kalenik
2023-01-29LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocateTimothy Flynn
Callers that are already in a fallible context will now TRY to allocate cells. Callers in infallible contexts get a FIXME.
2023-01-29LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errorsTimothy Flynn
Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations.
2023-01-28LibAudio: Remove `try_` prefix from fallible LoaderPlugin methodsLinus Groh
2023-01-28LibCore: Remove `try_` prefix from fallible SharedCircularQueue methodsLinus Groh
2023-01-28AK: Remove `try_` prefix from FixedArray creation functionsLinus Groh
2023-01-28AK: Add String::trimTimothy Flynn
2023-01-28AK: Add String::joinTimothy Flynn
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2023-01-27LibJS+LibLocale: Port Intl.DateTimeFormat to StringTimothy Flynn
2023-01-27AK: Add an overload of String::find_byte_offset for StringViewTimothy Flynn
2023-01-26LibGfx: Remove `try_` prefix from bitmap creation functionsTim Schumacher
Those don't have any non-try counterpart, so we might as well just omit it.
2023-01-26Tests: Replace uses of JsonObject::get_deprecated()/get_ptr()Sam Atkins
2023-01-25LibWasm: Port the parser to `Core::Stream`Tim Schumacher
2023-01-24AK: Add a method to create a String with a repeated code pointTimothy Flynn
2023-01-24AK: Add a method to find the byte offset of a code pointTimothy Flynn
2023-01-24AK: Print leading zeroes after the dot for FixedPoint numbersNico Weber
As a nearby comment says, "This is a terrible approximation". This doesn't make things less terrible, but it does make things more correct in the given framework of terribleness. Fixes #17156.
2023-01-22LibTextCodec: Make utf-16be and utf-16le codecs actually workNico Weber
There were two problems: 1. They didn't handle surrogates 2. They used signed chars, leading to eg 0x00e4 being treated as 0xffe4 Also add a basic test that catches both issues. There's some code duplication with Utf16CodePointIterator::operator*(), but let's get things working first.
2023-01-22AK: Add a String factory to create a string from a single code pointTimothy Flynn
2023-01-21Kernel+LibC: Move LibC/signal_numbers.h to Kernel/API/POSIXAndrew Kaster
Make Userland and Tests users just include signal.h, and move Kernel users to the new API file.
2023-01-21AK: Add `split()` for `String`martinfalisse
2023-01-21AK: Rename double_hash to rehash_for_collisionTimothy Flynn
The name is currently quite confusing as it indicates it hashes doubles.
2023-01-20LibCore: Remove `FileStream`Tim Schumacher
2023-01-20Tests: Use `Core::Stream` to write output files in LibGL testsTim Schumacher
2023-01-20AK: Remove `DuplexMemoryStream`Tim Schumacher
2023-01-20LibCore: Avoid logical OOB read in AllocatingMemoryStream::offset_of()Ali Mohammad Pur
The previous impl was trimming the last chunk to the free space instead of the used space, which yielded an OOB read if the needle wasn't found.
2023-01-20AK: Support creating known short string literals at compile timeTimothy Flynn
In cases where we know a string literal will fit in the short string storage, we can do so at compile time without needing to handle error propagation. If the provided string literal is too long, a compilation error will be emitted due to the failed VERIFY statement being a non- constant expression.
2023-01-20Tests: Use AK::shuffle() for shufflingSam Atkins
2023-01-20Tests/LibGfx: Fix test_gif test caseLiav A
We should expect the GIF image to be animated, therefore fix that condition.
2023-01-20Tests/LibGfx: Fix test_not_ico test caseLiav A
We should expect the sniffing method and the initialize method to fail because this test case is testing that the ICO image decoder should not decode random data within it.
2023-01-20LibGfx: Re-structure the whole initialization pattern for image decodersLiav A
When trying to figure out the correct implementation, we now have a very strong distinction on plugins that are well suited for sniffing, and plugins that need a MIME type to be chosen. Instead of having multiple calls to non-static virtual sniff methods for each Image decoding plugin, we have 2 static methods for each implementation: 1. The sniff method, which in contrast to the old method, gets a ReadonlyBytes parameter and ensures we can figure out the result with zero heap allocations for most implementations. 2. The create method, which just creates a new instance so we don't expose the constructor to everyone anymore. In addition to that, we have a new virtual method called initialize, which has a per-implementation initialization pattern to actually ensure each implementation can construct a decoder object, and then have a correct context being applied to it for the actual decoding.
2023-01-19LibLocale+LibJS: Port locale parsing and processing to StringTimothy Flynn
In order to prevent this commit from having to refactor almost all of Intl, the goal here is to update the internal parsing/canonicalization of locales within LibLocale only. Call sites which are already equiped to handle String and OOM errors do so, however.
2023-01-19Tests: Mark TestCommonmark as DISABLEDSam Atkins
This has no effect right now, but will allow us to use this same cmake file from Lagom.
2023-01-19Tests: Add missing library dependency for LibTimeZone testsSam Atkins
2023-01-19Tests: Add missing library dependencies for LibGL testsSam Atkins
These are required for running on Lagom.
2023-01-19Tests: Move test PDF files into Tests/LibPDFSam Atkins
Let's put test files with the tests themselves, instead of a random user directory. (But still copy them so they appear in the user directory for convenience.)
2023-01-19Tests: Correct `serenity_test()` invocation for LibTTFSam Atkins
Putting the LibTTF tests into the LibGfx directory worked fine before, but causes issues if we try and call this from Lagom. Also, it's tidier to put LibTTF tests in a LibTTF directory. :^)