summaryrefslogtreecommitdiff
path: root/Tests
AgeCommit message (Collapse)Author
2021-09-19Tests: Conform font tests to new font formatthankyouverycool
2021-09-18AK: Make Utf8View constructors inline and remove C string constructorAndreas Kling
Using StringView instead of C strings is basically always preferable. The only reason to use a C string is because you are calling a C API.
2021-09-18LibC: Primitively implement wcscollTim Schumacher
At the moment, sorting like LC_COLLATE=C would do is better than nothing.
2021-09-17LibC: Implement towctransTim Schumacher
2021-09-17LibC: Implement iswctypeTim Schumacher
2021-09-17LibC: Implement wctransTim Schumacher
2021-09-17LibC: Implement wctypeTim Schumacher
2021-09-16crash: Don't test for qemu-unsupported featureBen Wiederhake
See #10042 for details. In short: qemu doesn't seem to implement that feature, therefore the test correctly fails. However, that does not help us, so we skip that test.
2021-09-16crash: Run automatically during CIBen Wiederhake
2021-09-15Meta: Add Meta/CMake to the CMAKE_MODULE_PATH for Serenity and LagomAndrew Kaster
This makes it so we don't need to specify the full path to all the helper scripts we include() from different places in the codebase and feels a lot cleaner.
2021-09-15LibRegex: Make the optimizer understand references and capture groupsAli Mohammad Pur
Otherwise the fork in patterns like `(1+)\1` would be (incorrectly) optimized away.
2021-09-14LibJS+LibTest: Use JS::Script and JS::SourceTextModule in test-jsAndreas Kling
Instead of creating a Parser and Lexer manually in test-js, we now use either JS::Script::parse() or JS::SourceTextModule::parse() to load tests.
2021-09-14AK: Add an abstraction over multiple disjoint buffersAli Mohammad Pur
DisjointChunks<T> provides a nice interface over multiple sequential Vector<T>'s, allowing the user to iterate over/index into/slice from said buffers as if they were a single contiguous buffer. To work with views on such objects, DisjointSpans<T> is provided, which has the same behaviour but does not own the underlying objects.
2021-09-14AK: Make URL::m_port an Optional<u16>, Expose raw port getterIdan Horowitz
Our current way of signalling a missing port with m_port == 0 was lacking, as 0 is a valid port number in URLs.
2021-09-13LibRegex: Add a basic optimization passAli Mohammad Pur
This currently tries to convert forking loops to atomic groups, and unify the left side of alternations.
2021-09-12LibJS: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-12LibWeb: Use ErrorType::NotAnObjectOfType instead of NotATimothy Flynn
2021-09-11AK: Replace the mutable String::replace API with an immutable versionIdan Horowitz
This removes the awkward String::replace API which was the only String API which mutated the String and replaces it with a new immutable version that returns a new String with the replacements applied. This also fixes a couple of UAFs that were caused by the use of this API. As an optimization an equivalent StringView::replace API was also added to remove an unnecessary String allocations in the format of: `String { view }.replace(...);`
2021-09-11Everywhere: Fix format-vulnerabilitiesBen Wiederhake
Command used: grep -Pirn '(out|warn)ln\((?!["\)]|format,|stderr,|stdout,|output, ")' \ AK Kernel/ Tests/ Userland/ (Plus some manual reviewing.) Let's pick ArgsParser as an example: outln(file, m_general_help); This will fail at runtime if the general help happens to contain braces. Even if this transformation turns out to be unnecessary in a place or two, this way the code is "more obviously" correct.
2021-09-11Tests/Kernel: Fix test after off-by-one fix in Memory::is_user_range()Brian Gianforcaro
Commit 890c647e0f fixed an off-by-one bug, so the mapping of the page at the very end of the user address space now works correctly. This change adjusts the test so cover the corner cases the original version was designed too.validate.
2021-09-10AK+Kernel: Reduce the number of template parameters of IntrusiveRBTreeAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-10AK+Everywhere: Reduce the number of template parameters of IntrusiveListAli Mohammad Pur
This makes the user-facing type only take the node member pointer, and lets the compiler figure out the other needed types from that.
2021-09-08LibUnicode+LibJS: Store locale keyword values as a single stringTimothy Flynn
Previously, LibUnicode would store the values of a keyword as a Vector. For example, the locale "en-u-ca-abc-def" would have its keyword "ca" stored as {"abc, "def"}. Then, canonicalization would occur on each of the elements in that Vector. This is incorrect because, for example, the keyword value "true" should only be dropped if that is the entire value. That is, the canonical form of "en-u-kb-true" is "en-u-kb", but "en-u-kb-abc-true" does not change for canonicalization. However, we would canonicalize that locale as "en-u-kb-abc".
2021-09-08AK: Set IntrusiveRBTree Node key on insertion instead of constructionIdan Horowitz
This makes the API look much nicer.
2021-09-08AK: Make IntrusiveRedBlackTree capable of holding non-raw pointersIdan Horowitz
This is completely based on e4412f1f599bea034dea608b8c7dcc4408d90066 and will allow us to convert some AK::HashMap users in the kernel.
2021-09-08test-js: Add a mark_as_garbage method to force GC to collect that objectdavidot
This should fix the flaky tests of test-js. It also fixes the tests when running with the -g flag since the values will not be garbage collected too soon.
2021-09-07LibRegex: Use the correct capture group index in ERE bytecode generationAli Mohammad Pur
Otherwise the left and right capture instructions wouldn't point to the same capture group if there was another nested group there.
2021-09-07Everywhere: Behaviour => BehaviorAndreas Kling
2021-09-06LibUnicode: Implement locale-aware BEFORE_DOT special casingTimothy Flynn
Note that the algorithm in the Unicode spec is for checking that a code point precedes U+0307, but the special casing condition NotBeforeDot is interested in the inverse of this rule.
2021-09-06LibUnicode: Implement locale-aware MORE_ABOVE special casingTimothy Flynn
2021-09-06LibUnicode: Implement locale-aware AFTER_SOFT_DOTTED special casingTimothy Flynn
2021-09-06LibUnicode: Implement locale-aware AFTER_I special casingTimothy Flynn
2021-09-06Tests/LibRegex: Decrease the size of the fork chain testAli Mohammad Pur
2021-09-06LibRegex: Make infinite repetitions short-circuit on empty matchesAli Mohammad Pur
This makes (addmittedly weird) patterns like `(a*)*` work correctly without going into an infinite fork loop.
2021-09-06Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safeAli Mohammad Pur
2021-09-06Everywhere: Use OOM-safe ByteBuffer APIs where possibleAli Mohammad Pur
If we can easily communicate failure, let's avoid asserting and report failure instead.
2021-09-05Tests: Reduce the execution time of the LibC TestQSort testBrian Gianforcaro
Executing 100 times vs 10 times doesn't increase test coverage substantial, this API is stable and more iterations is just a waste of time. Without KVM this test is a clear outlier in runtime during CI: ``` START LibC/TestQsort (106/172) PASS LibC/TestQsort (41.233692s) ```
2021-09-04AK: Add rvalue-ref qualifiers for Optional's value() and value_or()Andreas Kling
This avoids a value copy when calling value() or value_or() on a temporary Optional. This is very common when using the HashMap::get() API like this: auto value = hash_map.get(key).value_or(fallback_value);
2021-09-03Everywhere: Prevent risky implicit casts of (Nonnull)RefPtrDaniel Bertalan
Our existing implementation did not check the element type of the other pointer in the constructors and move assignment operators. This meant that some operations that would require explicit casting on raw pointers were done implicitly, such as: - downcasting a base class to a derived class (e.g. `Kernel::Inode` => `Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp), - casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>` in LibIMAP/Client.cpp) This, of course, allows gross violations of the type system, and makes the need to type-check less obvious before downcasting. Luckily, while adding the `static_ptr_cast`s, only two truly incorrect usages were found; in the other instances, our casts just needed to be made explicit.
2021-09-02LibUnicode: Add lexer to test if a string matches the "type" productionTimothy Flynn
2021-09-02Tests: Remove all file(GLOB) from CMakeLists in TestsAndrew Kaster
Using a file(GLOB) to find all the test files in a directory is an easy hack to get things started, but has some drawbacks. Namely, if you add a test, it won't be found again without re-running CMake. `ninja` seems to do this automatically, but it would be nice to one day stop seeing it rechecking our globbed directories.
2021-09-02Tests: Add tests for Core::deferred_invokesin-ack
2021-09-01LibUnicode: Resolve the most likely territory alias when there are manyTimothy Flynn
2021-09-01LibUnicode: Perform complex Unicode locale alias substitutionTimothy Flynn
2021-09-01LibUnicode: Canonicalize calendar subtagsTimothy Flynn
Calendar subtags are a bit of an odd-man-out in that we must match the variants "ethiopic-amete-alem" in that order, without any other variant in the locale. So a separate method is needed for this, and we now defer sorting the variant list until after other canonicalization is done.
2021-09-01LibUnicode: Canonicalize timezone subtagsTimothy Flynn
2021-09-01LibUnicode: Canonicalize the subtag "imperial" to "uksystem"Timothy Flynn
2021-09-01LibUnicode: Canonicalize the subtag "primary" and "tertiary" to "levelN"Timothy Flynn
2021-09-01LibUnicode: Canonicalize the subtag "names" to "prprname"Timothy Flynn
2021-09-01LibUnicode: Canonicalize the subtag "yes" to "true"Timothy Flynn