aboutsummaryrefslogtreecommitdiff
path: root/src/tests
Commit message (Collapse)AuthorAgeFilesLines
...
| * core: Switch to unique_ptr for usage of Common::Fiber.bunnei2021-02-271-21/+18
| | | | | | | | | | - With using unique_ptr instead of shared_ptr, we have more explicit ownership of the context. - Fixes a memory leak due to circular reference of the shared pointer.
* | [network] Error handling reformcomex2021-02-282-0/+29
|/ | | | | | | | | | | | | | | | | | | | | `network.cpp` has several error paths which either: - report "Unhandled host socket error=n" and return `SUCCESS`, or - switch on a few possible errors, log them, and translate them to Errno; the same switch statement is copied and pasted in multiple places in the code Convert these paths to use a helper function `GetAndLogLastError`, which is roughly the equivalent of one of the switch statements, but: - handling more cases (both ones that were already in `Errno`, and a few more I added), and - using OS functions to convert the error to a string when logging, so it'll describe the error even if it's not one of the ones in the switch statement. - To handle this, refactor the logic in `GetLastErrorMsg` to expose a new function `NativeErrorToString` which takes the error number explicitly as an argument. And improve the Windows version a bit. Also, add a test which exercises two random error paths.
* common/cityhash: Use common typesReinUsesLisp2021-02-181-2/+2
| | | | | | | | Allow sharing return types with the rest of the code base. For example, we use 'u128 = std::array<u64, 2>', meanwhile Google's code uses 'uint128 = std::pair<u64, u64>'. While we are at it, use size_t instead of std::size_t.
* tests: Add tests for CityHashReinUsesLisp2021-02-182-0/+23
|
* tests/buffer_base: Add cached CPU writes testsReinUsesLisp2021-02-131-0/+76
| | | | Ensure the behavior of the previous commit in tests.
* ring_buffer: Remove granularity template argumentMerryMage2021-02-061-5/+5
| | | | | | Non-obvious bug in RingBuffer::Push(std::vector<T>&) when granularity != 1 Just remove it altogether because we do not have a use for granularity != 1
* Merge pull request #5262 from ReinUsesLisp/buffer-baseRodrigo Locatti2021-01-162-0/+474
|\ | | | | buffer_cache/buffer_base: Add a range tracking buffer container and tests
| * tests: Add unit tests for the GPU range tracking buffer containerReinUsesLisp2021-01-132-0/+474
| | | | | | | | | | | | | | | | | | Due to how error prone the container design is, this commit adds unit tests for it. Some tests taken from here are based on bugs from using this buffer container in games, so if we ever break it in the future in a way that might harm games, the tests should fail.
* | common/bit_util: Replace CLZ/CTZ operations with standardized onesLioncash2021-01-152-24/+0
|/ | | | Makes for less code that we need to maintain.
* tests/ring_buffer: Silence signed/unsigned mismatch warningsReinUsesLisp2021-01-081-15/+15
|
* general: Fix various spelling errorsMorph2021-01-021-2/+2
|
* memory: Remove MemoryHookMerryMage2021-01-013-240/+0
|
* hle: kernel: Separate KScheduler from GlobalSchedulerContext class.bunnei2020-12-062-56/+0
|
* tests: Fix warning about comparison between signed and unsignedcomex2020-11-271-2/+2
|
* tests: Fix data race in fibers testReinUsesLisp2020-10-281-31/+40
| | | | | | | | | | | | | | | | | | | Previous to this commit, the tests were using operator[] from unordered_map to query elements but this silently inserts empty elements when they don't exist. If all threads were executed without concurrency, this wouldn't be an issue, but the same unordered_map could be written from two threads at the same time. This is a data race and makes some previously inserted elements invisible for a short period of time, causing them to insert and return an empty element. This default constructed element (a zero) was used to index an array of fibers that asserted when one of them was nullptr, shutting the test session off. To address this issue, lock on thread id reads and writes. This could be a shared mutex to allow concurrent reads, but the definition of std::this_thread::get_id is fuzzy when using non-standard techniques like fibers. I opted to use a standard mutex. While we are at it, fix the included headers.
* tests/core_timing: Remove pragma optimize(off)Lioncash2020-08-031-9/+5
| | | | | | | | | | | | | I made a review comment about this in the PR that this was introduced in (#3955, commit 4df46e052579925c27e178ef61eadfb5adbffac2), but it seems to have been missed. We shouldn't be using this pragma here because it's MSVC specific. This causes warnings on other compilers. The test it's surrounding is *extremely* dubious, but for the sake of silencing warnings on other compilers, we can mark "placebo" as volatile and be on with it.
* core_timing: Make use of uintptr_t to represent user_dataLioncash2020-07-271-2/+2
| | | | Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
* core_timing: Make TimedCallback take std::chrono::nanosecondsLioncash2020-07-151-6/+8
| | | | Enforces our desired time units directly with a concrete type.
* core_timing: Make use of std::chrono with ScheduleEventLioncash2020-07-151-5/+8
|
* Core/Common: Address Feedback.Fernando Sahmkow2020-06-271-1/+1
|
* Tests/CoreTiming: Correct host timing tests.Fernando Sahmkow2020-06-272-157/+14
|
* CoreTiming: Correct rebase bugs and other miscellaneous things.Fernando Sahmkow2020-06-271-4/+6
|
* General: Cleanup legacy code.Fernando Sahmkow2020-06-271-0/+1
|
* General: Recover Prometheus project from harddrive failure Fernando Sahmkow2020-06-272-100/+85
| | | | | | | This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host Timing, Reworks the Kernel's Scheduler, Introduce Idle State and Suspended State, Recreates the bootmanager, Initializes Multicore system.
* Tests/HostTiming: Correct GCC Compile error.Fernando Sahmkow2020-06-181-15/+14
|
* Common/Fiber: Implement Rewinding.Fernando Sahmkow2020-06-181-0/+46
|
* Common/Tests: Address FeedbackFernando Sahmkow2020-06-182-24/+24
|
* Common/Tests: Clang Format.Fernando Sahmkow2020-06-181-9/+14
|
* Common: Implement WallClock Interface and implement a native clock for x64Fernando Sahmkow2020-06-181-26/+19
|
* Tests: Add base tests to host timingFernando Sahmkow2020-06-182-0/+151
|
* Common: Polish Fiber class, add comments, asserts and more tests.Fernando Sahmkow2020-06-181-1/+94
|
* Tests: Add tests for fibers and refactor/fix Fiber classFernando Sahmkow2020-06-182-0/+215
|
* Merge pull request #3697 from lioncash/declarationsbunnei2020-04-231-8/+10
|\ | | | | CMakeLists: Enable -Wmissing-declarations on Linux builds
| * General: Resolve warnings related to missing declarationsLioncash2020-04-161-8/+10
| |
* | arm_test_common: Updates for new VMM.bunnei2020-04-171-6/+2
|/
* core/memory: Migrate over memory mapping functions to the new Memory classLioncash2019-11-261-7/+8
| | | | | | Migrates all of the direct mapping facilities over to the new memory class. In the process, this also obsoletes the need for memory_setup.h, so we can remove it entirely from the project.
* core_timing: Use better reference tracking for EventType. (#3159)bunnei2019-11-261-66/+18
| | | | | | | * core_timing: Use better reference tracking for EventType. - Moves ownership of the event to the caller, ensuring we don't fire events for destroyed objects. - Removes need for unique names - we won't be using this for save states anyways.
* Core_Timing: Fix tests.Fernando Sahmkow2019-10-121-2/+2
|
* Core Timing: General corrections and added tests.Fernando Sahmkow2019-10-091-3/+153
|
* Tests: Eliminate old Core Timing TestsFernando Sahmkow2019-10-091-193/+0
|
* Merge pull request #2583 from FernandoS27/core-timing-safebunnei2019-06-301-10/+10
|\ | | | | Core_Timing: Make core_timing threadsafe by default.
| * Core_Timing: Make core_timing threadsafe by default.Fernando Sahmkow2019-06-161-10/+10
| | | | | | | | | | | | The old implementation had faulty Threadsafe methods where events could be missing. This implementation unifies unsafe/safe methods and makes core timing thread safe overall.
* | kernel: Differentiate kernel and user processes when picking IDZach Hilman2019-06-101-1/+2
|/ | | | This allows kernel internal type processes to be assigned IDs in the KIP range while userland processes are assigned in the user range.
* kernel: Handle page table switching within MakeCurrentProcess()Lioncash2019-04-071-2/+1
| | | | | Centralizes the page table switching to one spot, rather than making calling code deal with it everywhere.
* Fixes and corrections on formatting.Fernando Sahmkow2019-03-272-30/+11
|
* Add MultiLevelQueue TestsFernando Sahmkow2019-03-272-0/+56
|
* Implement intrinsics CountTrailingZeroes and test it.Fernando Sahmkow2019-03-272-0/+43
|
* Merge pull request #2090 from FearlessTobi/port-4599bunnei2019-03-202-0/+91
|\ | | | | Port citra-emu/citra#4244 and citra-emu/citra#4599: Changes to BitField
| * common/bitfield: make it endianness-awareWeiyi Wang2019-02-062-0/+91
| |
* | core: Move PageTable struct into Common.bunnei2019-03-162-5/+6
| |