summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2020-10-28tests: Fix data race in fibers testReinUsesLisp
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.
2020-08-03tests/core_timing: Remove pragma optimize(off)Lioncash
I made a review comment about this in the PR that this was introduced in (#3955, commit 71c4779211dc081a3b2dd4af52edad5748e7a7f5), 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.
2020-07-27core_timing: Make use of uintptr_t to represent user_dataLioncash
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.
2020-07-15core_timing: Make TimedCallback take std::chrono::nanosecondsLioncash
Enforces our desired time units directly with a concrete type.
2020-07-15core_timing: Make use of std::chrono with ScheduleEventLioncash
2020-06-27Core/Common: Address Feedback.Fernando Sahmkow
2020-06-27Tests/CoreTiming: Correct host timing tests.Fernando Sahmkow
2020-06-27CoreTiming: Correct rebase bugs and other miscellaneous things.Fernando Sahmkow
2020-06-27General: Cleanup legacy code.Fernando Sahmkow
2020-06-27General: Recover Prometheus project from harddrive failure Fernando Sahmkow
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.
2020-06-18Tests/HostTiming: Correct GCC Compile error.Fernando Sahmkow
2020-06-18Common/Fiber: Implement Rewinding.Fernando Sahmkow
2020-06-18Common/Tests: Address FeedbackFernando Sahmkow
2020-06-18Common/Tests: Clang Format.Fernando Sahmkow
2020-06-18Common: Implement WallClock Interface and implement a native clock for x64Fernando Sahmkow
2020-06-18Tests: Add base tests to host timingFernando Sahmkow
2020-06-18Common: Polish Fiber class, add comments, asserts and more tests.Fernando Sahmkow
2020-06-18Tests: Add tests for fibers and refactor/fix Fiber classFernando Sahmkow
2020-04-23Merge pull request #3697 from lioncash/declarationsbunnei
CMakeLists: Enable -Wmissing-declarations on Linux builds
2020-04-17arm_test_common: Updates for new VMM.bunnei
2020-04-16General: Resolve warnings related to missing declarationsLioncash
2019-11-26core/memory: Migrate over memory mapping functions to the new Memory classLioncash
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.
2019-11-26core_timing: Use better reference tracking for EventType. (#3159)bunnei
* 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.
2019-10-12Core_Timing: Fix tests.Fernando Sahmkow
2019-10-09Core Timing: General corrections and added tests.Fernando Sahmkow
2019-10-09Tests: Eliminate old Core Timing TestsFernando Sahmkow
2019-06-30Merge pull request #2583 from FernandoS27/core-timing-safebunnei
Core_Timing: Make core_timing threadsafe by default.
2019-06-16Core_Timing: Make core_timing threadsafe by default.Fernando Sahmkow
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.
2019-06-10kernel: Differentiate kernel and user processes when picking IDZach Hilman
This allows kernel internal type processes to be assigned IDs in the KIP range while userland processes are assigned in the user range.
2019-04-07kernel: Handle page table switching within MakeCurrentProcess()Lioncash
Centralizes the page table switching to one spot, rather than making calling code deal with it everywhere.
2019-03-27Fixes and corrections on formatting.Fernando Sahmkow
2019-03-27Add MultiLevelQueue TestsFernando Sahmkow
2019-03-27Implement intrinsics CountTrailingZeroes and test it.Fernando Sahmkow
2019-03-20Merge pull request #2090 from FearlessTobi/port-4599bunnei
Port citra-emu/citra#4244 and citra-emu/citra#4599: Changes to BitField
2019-03-16core: Move PageTable struct into Common.bunnei
2019-03-07kernel: Make the address arbiter instance per-processLioncash
Now that we have the address arbiter extracted to its own class, we can fix an innaccuracy with the kernel. Said inaccuracy being that there isn't only one address arbiter. Each process instance contains its own AddressArbiter instance in the actual kernel. This fixes that and gets rid of another long-standing issue that could arise when attempting to create more than one process.
2019-03-05kernel/address_arbiter: Pass in system instance to constructorLioncash
Allows getting rid of reliance on the global accessor functions and instead operating on the provided system instance.
2019-02-15core_timing: Convert core timing into a classLioncash
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2019-02-12core_timing: Rename CoreTiming namespace to Core::TimingLioncash
Places all of the timing-related functionality under the existing Core namespace to keep things consistent, rather than having the timing utilities sitting in its own completely separate namespace.
2019-02-06common/bitfield: make it endianness-awareWeiyi Wang
2018-10-30global: Use std::optional instead of boost::optional (#1578)Frederic L
* get rid of boost::optional * Remove optional references * Use std::reference_wrapper for optional references * Fix clang format * Fix clang format part 2 * Adressed feedback * Fix clang format and MacOS build
2018-10-10kernel/thread: Use a regular pointer for the owner/current processLioncash
There's no real need to use a shared pointer in these cases, and only makes object management more fragile in terms of how easy it would be to introduce cycles. Instead, just do the simple thing of using a regular pointer. Much of this is just a hold-over from citra anyways. It also doesn't make sense from a behavioral point of view for a process' thread to prolong the lifetime of the process itself (the process is supposed to own the thread, not the other way around).
2018-09-30kernel/process: Make data member variables privateLioncash
Makes the public interface consistent in terms of how accesses are done on a process object. It also makes it slightly nicer to reason about the logic of the process class, as we don't want to expose everything to external code.
2018-09-24memory: Dehardcode the use of a 36-bit address spaceLioncash
Given games can also request a 32-bit or 39-bit address space, we shouldn't be hardcoding the address space range as 36-bit.
2018-09-17Merge pull request #1327 from FearlessTobi/port-4171bunnei
Port #4171 from Citra: "Tests: Remove glad test OS X work-around"
2018-09-15Tests: Remove glad test OS X work-aroundYuri Kunde Schlesner
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi
2018-09-08common: Implement a ring bufferMerryMage
2018-08-28kernel: Eliminate kernel global stateLioncash
As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
2018-08-07externals: Update catch to 2.3.0Lioncash
Updates the library from 2.2.3 to 2.3.0