summaryrefslogtreecommitdiff
path: root/Source/UnitTests
AgeCommit message (Collapse)Author
2024-08-22Add support for libfmt-11Alfred Wingate
fmt::join was moved into fmt/ranges.h Signed-off-by: Alfred Wingate <parona@protonmail.com>
2024-08-17UnitTests: Remove MSBuild input/output trackingJosJuice
Input/output tracking is intended to speed up incremental builds by skipping a target when it doesn't need to be built. However, this seems to be unreliable for UnitTests' AfterBuild target. Let's remove it. It's still the case that UnitTests' AfterBuild target will be skipped if UnitTests doesn't need to be rebuilt. (Note that UnitTests always needs to be rebuilt if SCMRevGen changed.) I haven't seen these problems with DolphinQt's rather similar input/output tracking. This may be because DolphinQt's one also has the exe file as an input/output.
2024-08-16UnitTests: Delete output Sys folder before copying to itJosJuice
Like the previous commit, but for UnitTests. This time all operating systems were affected. I also made UnitTests.vcxproj use the same way of copying as DolphinQt.vcxproj, just for consistency.
2024-08-16Merge pull request #13015 from tygyh/Use-boolean-literalsTilka
Replace boolean constants with boolean literals
2024-08-15Use 'contains' methodmitaclaw
2024-08-15Replace boolean constants with boolean literalsDr. Dystopia
2024-08-14Remove self-comparisonDr. Dystopia
2024-07-07Add Unit Test for Patch AllowlistLillyJadeKatrin
This unit test compares ApprovedInis.json with the contents of the GameSettings folder to verify that every patch marked allowed for use with RetroAchievements has a hash in ApprovedInis.json. If not, that hash is reported in the test logs so that the hash may be updated more easily.
2024-06-15Merge pull request #12815 from ↵Admiral H. Curtiss
Dentomologist/enable_hotkeys_and_controllers_for_focused_tas_input TAS Input: Enable emulator hotkeys and controller input when TAS Input window has focus
2024-06-10Merge pull request #12837 from JosJuice/cmake-one-tests-binaryAdmiral H. Curtiss
CMake: Put all unit tests in one binary
2024-06-09Add some unit tests for the `Rectangle` classNiel Lebeck
2024-06-06CMake: Put all unit tests in one binaryJosJuice
We currently have 32 different binaries containing unit tests. At least when I build for Android, each one takes up over 200 MiB, and linking them all increases my incremental build times by over a minute. I'd like to change this for the sake of my productivity and disk space. For reference, MSBuild is already putting all tests in a single binary.
2024-05-31TAS Input: Enable hotkeys and controller input when Input has focusDentomologist
Enable emulator hotkeys and controller input (when that option is enabled) when a TAS Input window has focus, as if it was the render window instead. This allows TASers to use frame advance and the like without having to switch the focused window or disabling Hotkeys Require Window Focus which also picks up keypresses while other apps are active. Cursor updates are disabled when the TAS Input window has focus, as otherwise the Wii IR widget (and anything else controlled by the mouse) becomes unusable. The cursor continues to work normally when the render window has focus.
2024-05-05Merge pull request #12737 from nlebeck/settingshandler-splitJosJuice
Eliminate SettingsHandler's `SetBytes` and `Reset` methods
2024-05-03Replace Common::BitCast with std::bit_castPokechu22
2024-04-23Eliminate SettingsHandler's `SetBytes` and `Reset` methodsNiel Lebeck
Also make the `Decrypt` method private. As far as I can tell, the only motivation for exposing the `SetBytes` and `Reset` methods is to allow `CBoot::SetupWiiMemory` to use the same `SettingsHandler` instance to read settings data and then write it back. It seems cleaner to just use two separate instances, and require a given `SettingsHandler` instance to be used for either writing data to a buffer or reading data from a buffer, but not both. A natural next step is to split the `SettingsHandler` class into two classes, one for writing data and one for reading data. I've deferred that change for a future PR.
2024-04-22port to OpenBSDGuilherme Janczak
2024-04-12Pass SettingsHandler buffers by const ref instead of rvalue refNiel Lebeck
2024-04-12Merge pull request #12614 from nlebeck/settingshandler-edgecaseTilka
Add SettingsHandler unit tests exercising the edge case fixed in PR #8704
2024-04-04Fix out of bounds accesses for invalid vertex component formatsPokechu22
On all platforms, this would result in out of bounds accesses when getting the component sizes (which uses stuff from VertexLoader_Position.h/VertexLoader_TextCoord.h/VertexLoader_Normal.h). On platforms other than x64 and ARM64, this would also be out of bounds accesses when getting function pointers for the non-JIT vertex loader (in VertexLoader_Position.cpp etc.). Usually both of these would get data from other entries in the same multi-dimensional array, but the last few entries would be truly out of bounds. This does mean that an out of bounds function pointer can be called on platforms that don't have a JIT vertex loader, but it is limited to invalid component formats with values 5/6/7 due to the size of the bitfield the formats come from, so it seems unlikely that this could be exploited in practice. This issue affects a few games; Def Jam: Fight for New York (https://bugs.dolphin-emu.org/issues/12719) and Fifa Street are known to be affected. I have not done any hardware testing for this PR specifically, though I *think* I previously determined that at least a value of 5 behaves the same as float (4). That's what I implemented in any case. I did previously determine that both Def Jam: Fight for New York and Fifa Street use an invalid normal format, but don't actually have lighting enabled when that normal vector is used, so it doesn't change rendering in practice. The color component format also has two invalid values, but VertexLoader_Color.h/.cpp do check for those invalid ones and return a default value instead of doing an out of bounds access.
2024-03-31Merge pull request #12645 from mitaclaw/ppc-symbols-signalAdmiral H. Curtiss
DolphinQt: A Ubiquitous Signal For When Symbols Change
2024-03-28DolphinQt: A Ubiquitous Signal For When Symbols Changemitaclaw
There were three distinct mechanisms for signaling symbol changes in DolphinQt: `Host::NotifyMapLoaded`, `MenuBar::NotifySymbolsUpdated`, and `CodeViewWidget::SymbolsChanged`. The behavior of these signals has been consolidated into the new `Host::PPCSymbolsUpdated` signal, which can be emitted from anywhere in DolphinQt to properly update symbols everywhere in DolphinQt.
2024-03-23DivUtils: Add unsigned division magic functionBram Speeckaert
Takes the logic from Jit64 and moves it into DivUtils, so it can be reused by other backends as well.
2024-03-06Add SettingsHandler unit tests exercising the edge case in PR #8704Niel Lebeck
2024-03-01Add simple unit tests for SettingsHandlerNiel Lebeck
2024-01-31Migrate SConfig::bWii to System.Admiral H. Curtiss
2024-01-12Core/HW/MMIO: Pass System through Read() and Write().Admiral H. Curtiss
2024-01-01BitSet64: Fix iterator incrementationDentomologist
Use 1 of the same type as the stored value when shifting left. This prevents undefined behavior caused by shifting an int more than 31 bits. Previously iterator incrementation could either hang or prematurely report it had reached the end of the bitset.
2023-12-31UnitTests: Refactor BitSetTestDentomologist
Group numbers and their bitcounts together in pairs, which allows for range-based loop iteration.
2023-12-16Merge pull request #11497 from vyuuui/debugger_assembler_uiTilka
Built-in assembler for debugger interface
2023-12-16Merge pull request #12427 from JosJuice/jitarm64-msr-updated-logical-immAdmiral H. Curtiss
JitArm64: Fix MSRUpdated(ARM64Reg) with FEATURE_FLAG_PERFMON set
2023-12-16JitArm64: Use enum class for LogicalImm size parameterJosJuice
This should prevent issues like the one fixed in the previous commit from happening again.
2023-12-13Added testsvyuuui
2023-12-12Merge pull request #12395 from lioncash/testTilka
VertexLoaderTest: Resolve -Wdangling-else warnings
2023-12-11VertexLoaderTest: Resolve -Wdangling-else warningsLioncash
The ways the assertion macros expand end up generating -Wdangling-else warnings. Trivial enough to fix by just bracing the if statements.
2023-12-11FloatUtilsTest: Resolve -Wsign-compare warningLioncash
2023-12-02VertexLoaderTest: Add test for skipped texture coordinatesPokechu22
Jimmie Johnson's Anything with an Engine is known to use texture coordinate 7 (and only texture coordinate 7) in some cases. There are a lot of possible edge-cases, so this test brute-forces all combinations with coordinates 0, 1, and 2.
2023-12-02VertexLoaderTest: Add test for skipped colorsPokechu22
This test fails with the non-JIT vertex loader due to an issue fixed in a later commit in this PR. (Note that the non-JIT vertex loader is only used on machines where no JIT is available or if COMPARE_VERTEXLOADERS is enabled in VertexLoaderBase.cpp.)
2023-11-28JitArm64: Use LSL+CLS for classifying floatsJosJuice
This is a little trick I came up with that lets us restructure our float classification code so we can exit earlier when the float is normal, which is the case more often than not. First we shift left by 1 to get rid of the sign bit, and then we count the number of leading sign bits. If the result is less than 10 (for doubles) or 7 (for floats), the float is normal. This is because, if the float isn't normal, the exponent is either all zeroes or all ones.
2023-11-28Remove _M_X86 in favour of _M_X86_64Zopolis4
2023-11-25Merge pull request #11881 from JosJuice/aarch64-function-callAdmiral H. Curtiss
JitArm64: Add utility for calling a function with arguments
2023-11-05Merge pull request #12133 from mandar1jn/skylanders-improved-generationAdmiral H. Curtiss
Skylanders: Improve figure data view and generation
2023-11-05Skylanders: Improve figure data view and generationMandar1jn
Co-authored-by: deReeperJosh <joshua@dereeper.co.nz>
2023-11-01JitArm64: Add utility for calling a function with argumentsJosJuice
With this, situations where multiple arguments need to be moved from multiple registers become easy to handle, and we also get compile-time checking that the number of arguments is correct.
2023-10-30UnitTests: Test ApproximateReciprocalSquareRootSintendo
2023-08-29PageFaultTest: Use GTEST_SKIP instead of early returnDentomologist
Using GTEST_SKIP instead of just returning from the function shows that a test was skipped in the test summary. If GTEST_SKIP is called the rest of the function won't be run, just like with the return. GTEST_SKIP wasn't available until gtest 1.10, and we updated to 1.12 in 597f8f1b874bf93854ae178795c55117f680e457.
2023-08-26Merge pull request #12117 from JosJuice/config-callback-cpuAdmiral H. Curtiss
Don't call RunAsCPUThread in config callbacks
2023-08-17UnitTests: Declare as CPU thread when using CPUThreadConfigCallbackJosJuice
This fixes a bunch of DEBUG_ASSERTs in the unit tests.
2023-08-05X64EmitterTest: Check bytes instead of disassembly in JMP testDentomologist
Check bytes directly to avoid ambiguity in the disassembly between short and near jumps, which could hypothetically cause the test to pass when it shouldn't.
2023-08-05x64EmitterTest: add J/J_CC/CALL unit testsDentomologist