summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2020-08-30Tests: Optionally switch off 858081 lines of dbg() in test-jsBen Wiederhake
2020-08-28ls: Fix issue with too-narrow columns in "ls" outputAndreas Kling
There was a logic mistake in the code that computes the offset between columns, forgetting to account for the extra characters after a name. The comment was accurate, but the code didn't match the comment.
2020-08-28HackStudio: Mark compilation-unit-only functions as staticBen Wiederhake
2020-08-28Userland: Stop passing ignored timezones to gettimeofdayNico Weber
2020-08-26LibCompress: Implement DEFLATE properly.asynts
Now we have an actual stream implementation that can read arbitrary (dynamic codes aren't supported yet) deflate encoded data. Even if the blocks are really large. And all of that happens with a single buffer of 32KiB. DEFLATE is amazing!
2020-08-26LibJS: Add a helper for calling JS::Function's with argumentsAnotherTest
The fact that a `MarkedValueList` had to be created was just annoying, so here's an alternative. This patchset also removes some (now) unneeded MarkedValueList.h includes.
2020-08-25LibDebug: Move everything into the "Debug" namespaceLuke
2020-08-24Meta+Userland: Run the TLS test tooAnotherTest
While this _does_ add a point of failure, it'll be a pretty bad day when google goes down. And this is unlikely to put a (positive) dent in their incoming requests, so let's just roll with it until we have our own TLS server.
2020-08-24Userland: Add missing HMAC-SHA1 testsAnotherTest
2020-08-24Tests: Prefer strlcpy over strncpyBen Wiederhake
Because it looks nicer.
2020-08-24Userland: Prefer strlcpy over strcpy in pingBen Wiederhake
This is supposed to serve as a reminder if and when someone decides to make the 'msg' field configurable.
2020-08-24Userland: Prefer strlcpy over strncpy in ifconfig, fixes off-by-oneBen Wiederhake
A malicious caller of ifconfig could have caused the ifr_name field to lack NUL-termination. I don't think this was an actual problem, though, as the Kernel always forces NUL-termination by overwriting ifr_name's last byte with NUL. However, it feels better to do it properly.
2020-08-24LibC: Stub and test strlcpyBen Wiederhake
2020-08-24Tests: Remove unused includeBen Wiederhake
2020-08-23test-web: Add updates from test-jsLuke
These should definitely be deduplicated at some point.
2020-08-23test-js+test-web: Clear taskbar progress on error/assertion failureLuke
Closes #3240
2020-08-22LibC+Userland: Prefer snprintf over sprintfBen Wiederhake
I ignored the sprintf in Userland/cal.cpp because it's too much trouble. However, this only underlines the need for bounds checking.
2020-08-22LibC: Demonstrate off-by-one in current snprintfBen Wiederhake
The function whose main selling point is that there always is a NUL-terminator ... missed the NUL-terminator.
2020-08-22test-js: Sometimes include more details for failuresNico Weber
LibJS doesn't store stacks for exception objects, so this only amends test-common.js's __expect() with an optional `details` function that can produce a more detailed error message, and it lets test-js.cpp read and print that error message. I added the optional details parameter to a few matchers, most notably toBe() where it now prints expected and actual value. It'd be nice to have line numbers of failures, but that seems hard to do with the current design, and this is already much better than the current state.
2020-08-22test-js: Print parse error if test-common.js fails to parseNico Weber
2020-08-22Userland: Use TestSuite.h in test-compress.asynts
2020-08-21LibLine: Handle interrupts/window size changes internallyAnotherTest
2020-08-20LibCompress: Turn the DEFLATE implementation into a stream.asynts
Previously, the implementation would produce one Vector<u8> which would contain the whole decompressed data. That can be a lot and even exhaust memory. With these changes it is still necessary to store the whole input data in one piece (I am working on this next,) but the output can be read block by block. (That's not optimal either because blocks can be arbitrarily large, but it's good for now.)
2020-08-17LibWeb: Add more document tests, add comment, text and mixin testsLuke
Also adds a TypeScript definition file for the test runner object.
2020-08-17LibWeb: Rename PageView => InProcessWebViewAndreas Kling
2020-08-17disasm: Use make<X86::ELFSymbolProvider> instead of naked newAndreas Kling
2020-08-17Userland: Explicitly ignore number of types read, found by CoverityBrian Gianforcaro
2020-08-17Userland: Provide a misbehaving applicationBen Wiederhake
This will be a test case for #2977.
2020-08-16disasm: For ELF inputs, pass an ELFSymbolProvider to disassemblerNico Weber
This lets disasm output contain the symbol names of call and jump destinations: 8048111: e8 88 38 01 00 call 805b99e <__cxa_atexit> ... 8048150: 74 15 je 8048167 <_start+0x4c> The latter (the symbol of the current function with an offset) is arguably more distracting than useful because you usually want to look at the instruction at the absolute offset in this case, but the former is very nice to have. For reasons I do not understand, this cuts the time to run `disasm /bin/id` in half, from ~1s to ~0.5s.
2020-08-16LibCrypto: Fix random number generationBen Wiederhake
2020-08-16LibCrypto: Demonstrate that primality and random numbers are brokenBen Wiederhake
2020-08-16Userland/tt: Switch to MiBNico Weber
2020-08-16Userland/allocate: Switch to KiB/MiBNico Weber
2020-08-16Everywhere: Consolidate human_readable_size() implementationsNico Weber
Let's use the one in AK/NumberFormat.h everywhere. It has slightly different behavior than some of the copies this removes, but it's probably nice to have uniform human readable size outputs across the system.
2020-08-16AK: Rename KB, MB, GB to KiB, MiB, GiBNico Weber
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9". The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30". Let's use the correct name, at least in code. Only changes the name of the constants, no other behavior change.
2020-08-15Refactor: Use ReadonlyBytes instead of const ReadonlyBytes&.asynts
2020-08-15AK: Rename span() to bytes() when appropriate.asynts
I originally defined the bytes() method for the String class, because it made it obvious that it's a span of bytes instead of span of characters. This commit makes this more consistent by defining a bytes() method when the type of the span is known to be u8. Additionaly, the cast operator to Bytes is overloaded for ByteBuffer and such.
2020-08-15Misc: Use automatic window positioning in more applicationsLinus Groh
This is a follow up to #2936 / d3e3b4ae56aa79d9bde12ca1f143dcf116f89a4c. Affected programs: - Applications: Browser (Download, View source, Inspect DOM tree, JS console), Terminal (Settings) - Demos: Cube, Eyes, Fire, HelloWorld, LibGfxDemo, WebView, WidgetGallery - DevTools: HackStudio, Inspector, Profiler - Games: 2048, Minesweeper, Snake, Solitaire - Userland: test-web A few have been left out where manual positioning is done on purpose, e.g. ClipboardManager (to be close to the menu bar) or VisualBuilder (to preserve alignment of the multiple application windows).
2020-08-14LibJS+LibWeb: Clear exceptions after call'ing JavaScript functionsAndreas Kling
Decorated Interpreter::call() with [[nodiscard]] to provoke thinking about the returned value at each call site. This is definitely not perfect and we should really start thinking about slimming down the public-facing LibJS interpreter API. Fixes #3136.
2020-08-14ifconfig: Fix capitalization of "kiB"Nico Weber
2020-08-14disasm: Print correct offset-relative jumps in ELF file disassemblyNico Weber
2020-08-12Test: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code. Also, in the case of test-crypto.cpp, I took the liberty to add the prefix 'g_' to the global event loop.
2020-08-12Userland: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code.
2020-08-12Meta: Replace remaining LibM/math.h includes with math.hLinus Groh
2020-08-12Userland: Make 'tt t' spawn a thread and stand stillBen Wiederhake
This is useful to test SystemMonitor and /proc, because all other multi-threaded processes tend to be moving targets.
2020-08-11LibCrypto+LibTLS+Kernel: Switch the Cipher::Mode interface to use SpanAnotherTest
This shaves 2.5 more runtime seconds off 'disasm /bin/id', and makes the Mode<T> interface a lot more allocation-friendly.
2020-08-11mv: Accept (but ignore) -fAndreas Kling
Many scripts seem to use "mv -f", so let's support that.
2020-08-11rm: Implement a basic -f modeAndreas Kling
2020-08-10Userland: Add a simple dirname(1) utilityAndreas Kling
2020-08-10Kernel: Demonstrate kill's pid/tid confusion bugBen Wiederhake