summaryrefslogtreecommitdiff
path: root/src/tests
AgeCommit message (Collapse)Author
2022-04-28chore: add missing SPDX tagsAndrea Pappacoda
Follow-up to 99ceb03a1cfcf35968cab589ea188a8c406cda52
2022-04-23general: Convert source file copyright comments over to SPDXMorph
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-01-12cmake: make tests optionalAlexandre Bouvier
2021-11-29[input_common] Add completion test for CalibrationConfigurationJobvperus
2021-08-13logging: Simplify and make thread-safeyzct12345
This simplifies the logging system. This also fixes some lost messages on startup. The simplification is simple. I removed unused functions and moved most things in the .h to the .cpp. I replaced the unnecessary linked list with its contents laid out as three member variables. Anything that went through the linked list now directly accesses the backends. Generic functions are replaced with those for each specific use case and there aren't many. This change increases coupling but we gain back more KISS and encapsulation. With those changes it was easy to make it thread-safe. I just removed the mutex and turned a boolean atomic. I was planning to use this thread-safety in my next PR about stacktraces. It was actually async-signal-safety at first but I ended up using a different approach. Anyway getting rid of the linked list is important for that because have the list of backends constantly changing complicates things.
2021-07-22shader_recompiler,video_core: Cleanup some GCC and Clang errorslat9nq
Mostly fixing unused *, implicit conversion, braced scalar init, fpermissive, and some others. Some Clang errors likely remain in video_core, and std::ranges is still a pertinent issue in shader_recompiler shader_recompiler: cmake: Force bracket depth to 1024 on Clang Increases the maximum fold expression depth thread_worker: Include condition_variable Don't use list initializers in control flow Co-authored-by: ReinUsesLisp <reinuseslisp@airmail.cc>
2021-07-10Buffer Cache: Address Feedback.Fernando Sahmkow
2021-07-09Buffer Cache: Fix High Downloads and don't predownload on Extreme.Fernando Sahmkow
2021-07-08common: Add unique functionReinUsesLisp
2021-06-24common: Replace common_sizes into user-literalsWunkolo
Removes common_sizes.h in favor of having `_KiB`, `_MiB`, `_GiB`, etc user-literals within literals.h. To keep the global namespace clean, users will have to use: ``` using namespace Common::Literals; ``` to access these literals.
2021-06-11tests: Add tests for host memoryReinUsesLisp
2021-05-25common: fs: Rework the Common Filesystem interface to make use of ↵Morph
std::filesystem (#6270) * common: fs: fs_types: Create filesystem types Contains various filesystem types used by the Common::FS library * common: fs: fs_util: Add std::string to std::u8string conversion utility * common: fs: path_util: Add utlity functions for paths Contains various utility functions for getting or manipulating filesystem paths used by the Common::FS library * common: fs: file: Rewrite the IOFile implementation * common: fs: Reimplement Common::FS library using std::filesystem * common: fs: fs_paths: Add fs_paths to replace common_paths * common: fs: path_util: Add the rest of the path functions * common: Remove the previous Common::FS implementation * general: Remove unused fs includes * string_util: Remove unused function and include * nvidia_flags: Migrate to the new Common::FS library * settings: Migrate to the new Common::FS library * logging: backend: Migrate to the new Common::FS library * core: Migrate to the new Common::FS library * perf_stats: Migrate to the new Common::FS library * reporter: Migrate to the new Common::FS library * telemetry_session: Migrate to the new Common::FS library * key_manager: Migrate to the new Common::FS library * bis_factory: Migrate to the new Common::FS library * registered_cache: Migrate to the new Common::FS library * xts_archive: Migrate to the new Common::FS library * service: acc: Migrate to the new Common::FS library * applets/profile: Migrate to the new Common::FS library * applets/web: Migrate to the new Common::FS library * service: filesystem: Migrate to the new Common::FS library * loader: Migrate to the new Common::FS library * gl_shader_disk_cache: Migrate to the new Common::FS library * nsight_aftermath_tracker: Migrate to the new Common::FS library * vulkan_library: Migrate to the new Common::FS library * configure_debug: Migrate to the new Common::FS library * game_list_worker: Migrate to the new Common::FS library * config: Migrate to the new Common::FS library * configure_filesystem: Migrate to the new Common::FS library * configure_per_game_addons: Migrate to the new Common::FS library * configure_profile_manager: Migrate to the new Common::FS library * configure_ui: Migrate to the new Common::FS library * input_profiles: Migrate to the new Common::FS library * yuzu_cmd: config: Migrate to the new Common::FS library * yuzu_cmd: Migrate to the new Common::FS library * vfs_real: Migrate to the new Common::FS library * vfs: Migrate to the new Common::FS library * vfs_libzip: Migrate to the new Common::FS library * service: bcat: Migrate to the new Common::FS library * yuzu: main: Migrate to the new Common::FS library * vfs_real: Delete the contents of an existing file in CreateFile Current usages of CreateFile expect to delete the contents of an existing file, retain this behavior for now. * input_profiles: Don't iterate the input profile dir if it does not exist Silences an error produced in the log if the directory does not exist. * game_list_worker: Skip parsing file if the returned VfsFile is nullptr Prevents crashes in GetLoader when the virtual file is nullptr * common: fs: Validate paths for path length * service: filesystem: Open the mod load directory as read only
2021-03-07common: Fiber: use a reference for YieldTo.bunnei
- Fixes another small leak.
2021-03-05Revert "core: Switch to unique_ptr for usage of Common::Fiber."bunnei
2021-03-04Merge pull request #6006 from bunnei/fiber-unique-ptrbunnei
core: Switch to unique_ptr for usage of Common::Fiber.
2021-02-28[network] Error handling reformcomex
`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.
2021-02-27core: Switch to unique_ptr for usage of Common::Fiber.bunnei
- 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.
2021-02-18common/cityhash: Use common typesReinUsesLisp
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.
2021-02-18tests: Add tests for CityHashReinUsesLisp
2021-02-13tests/buffer_base: Add cached CPU writes testsReinUsesLisp
Ensure the behavior of the previous commit in tests.
2021-02-06ring_buffer: Remove granularity template argumentMerryMage
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
2021-01-16Merge pull request #5262 from ReinUsesLisp/buffer-baseRodrigo Locatti
buffer_cache/buffer_base: Add a range tracking buffer container and tests
2021-01-15common/bit_util: Replace CLZ/CTZ operations with standardized onesLioncash
Makes for less code that we need to maintain.
2021-01-13tests: Add unit tests for the GPU range tracking buffer containerReinUsesLisp
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.
2021-01-08tests/ring_buffer: Silence signed/unsigned mismatch warningsReinUsesLisp
2021-01-02general: Fix various spelling errorsMorph
2021-01-01memory: Remove MemoryHookMerryMage
2020-12-06hle: kernel: Separate KScheduler from GlobalSchedulerContext class.bunnei
2020-11-27tests: Fix warning about comparison between signed and unsignedcomex
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