Commit graph

454 commits

Author SHA1 Message Date
Niel Lebeck
0344ec6d79 Add simple unit tests for SettingsHandler 2024-03-01 20:52:45 -08:00
Admiral H. Curtiss
9a3e770c23
Migrate SConfig::bWii to System. 2024-01-31 12:54:07 +01:00
Admiral H. Curtiss
42d61cfc4c
Core/HW/MMIO: Pass System through Read() and Write(). 2024-01-12 08:28:01 +01:00
Dentomologist
7dbf463ddf BitSet64: Fix iterator incrementation
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.
2024-01-01 00:41:48 -08:00
Dentomologist
58c5ae3de9 UnitTests: Refactor BitSetTest
Group numbers and their bitcounts together in pairs, which allows for
range-based loop iteration.
2023-12-31 12:10:50 -08:00
Tilka
773ffd04b8
Merge pull request #11497 from vyuuui/debugger_assembler_ui
Built-in assembler for debugger interface
2023-12-16 21:15:31 +00:00
Admiral H. Curtiss
190c4e8cda
Merge pull request #12427 from JosJuice/jitarm64-msr-updated-logical-imm
JitArm64: Fix MSRUpdated(ARM64Reg) with FEATURE_FLAG_PERFMON set
2023-12-16 17:22:23 +01:00
JosJuice
e0eb4ef5bc JitArm64: Use enum class for LogicalImm size parameter
This should prevent issues like the one fixed in the previous commit
from happening again.
2023-12-16 16:48:26 +01:00
vyuuui
00e94d3630 Added tests 2023-12-13 05:32:47 -08:00
Tilka
7588f5e2da
Merge pull request #12395 from lioncash/test
VertexLoaderTest: Resolve -Wdangling-else warnings
2023-12-12 20:40:49 +00:00
Lioncash
4229d76ad6 VertexLoaderTest: Resolve -Wdangling-else warnings
The ways the assertion macros expand end up generating -Wdangling-else
warnings. Trivial enough to fix by just bracing the if statements.
2023-12-11 18:45:25 -05:00
Lioncash
017b9a0af7 FloatUtilsTest: Resolve -Wsign-compare warning 2023-12-11 18:08:52 -05:00
Pokechu22
1ee6824324 VertexLoaderTest: Add test for skipped texture coordinates
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-02 15:54:52 -08:00
Pokechu22
530590d162 VertexLoaderTest: Add test for skipped colors
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-12-02 15:53:59 -08:00
JosJuice
255ee3fdce JitArm64: Use LSL+CLS for classifying floats
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-28 18:30:45 +01:00
Zopolis4
f0d2ce4683
Remove _M_X86 in favour of _M_X86_64 2023-11-28 23:03:20 +11:00
Admiral H. Curtiss
76d605639b
Merge pull request #11881 from JosJuice/aarch64-function-call
JitArm64: Add utility for calling a function with arguments
2023-11-25 17:30:42 +01:00
Admiral H. Curtiss
ec69ed2173
Merge pull request #12133 from mandar1jn/skylanders-improved-generation
Skylanders: Improve figure data view and generation
2023-11-05 18:29:19 +01:00
Mandar1jn
afdf6de041
Skylanders: Improve figure data view and generation
Co-authored-by: deReeperJosh <joshua@dereeper.co.nz>
2023-11-05 18:06:10 +01:00
JosJuice
c248a69268 JitArm64: Add utility for calling a function with arguments
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-11-01 19:01:58 +01:00
Sintendo
ef7f3b5bac UnitTests: Test ApproximateReciprocalSquareRoot 2023-10-30 22:39:12 +01:00
Dentomologist
75a62e116c PageFaultTest: Use GTEST_SKIP instead of early return
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
597f8f1b87.
2023-08-29 12:24:11 -07:00
Admiral H. Curtiss
2502e412b3
Merge pull request #12117 from JosJuice/config-callback-cpu
Don't call RunAsCPUThread in config callbacks
2023-08-26 16:34:46 +02:00
JosJuice
1104b93ee4 UnitTests: Declare as CPU thread when using CPUThreadConfigCallback
This fixes a bunch of DEBUG_ASSERTs in the unit tests.
2023-08-17 19:19:25 +02:00
Dentomologist
4ccac53e9f X64EmitterTest: Check bytes instead of disassembly in JMP test
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-05 13:51:42 -07:00
Dentomologist
dcd5ba6587 x64EmitterTest: add J/J_CC/CALL unit tests 2023-08-05 13:51:42 -07:00
Admiral H. Curtiss
17f2072e1c
UnitTests: Enable cluster check in FileSystemTest.GetDirectoryStats. 2023-07-14 04:20:57 +02:00
Dentomologist
04fcf68176 xEmitter: Convert PrefetchLevel to enum class 2023-06-17 16:41:32 -07:00
Dentomologist
4c2759f541 XEmitter: Add enum class Jump
Replace the bool parameter force5bytes in J, JMP, and J_CC with an enum
class Jump::Short/Near. Many callers set that parameter to the literal
'true', which was unclear if you didn't already know what it did.
2023-06-12 13:04:18 -07:00
Admiral H. Curtiss
b3c9f49cbe
Core: Assert that only the Host thread may call PauseAndLock(). 2023-06-02 18:51:43 +02:00
Lioncash
d368c989e7 StringUtil: Move GetEscapedHtml() into Common namespace 2023-05-16 14:21:19 -04:00
Admiral H. Curtiss
df458aed89
CMake: Set --output-on-failure flag for unittests target. 2023-05-14 04:52:50 +02:00
Lioncash
784a216927 Common/MathUtil: Move IntLog2 into MathUtil namespace
Gets this out of the global namespace.
2023-04-15 03:35:05 -04:00
Admiral H. Curtiss
23843583bf
PowerPC: Refactor to class, move to System. 2023-04-09 21:48:37 +02:00
Admiral H. Curtiss
62de9c593b
UnitTests: Avoid ppcState global. 2023-04-05 20:09:32 +02:00
Admiral H. Curtiss
7f50c070b2
JitInterface: Convert m_jit to unique_ptr. 2023-03-26 14:38:07 +02:00
Admiral H. Curtiss
9217a9eba4
JitInterface: Refactor to class, move to System. 2023-03-26 14:38:07 +02:00
Admiral H. Curtiss
9c0226b7e3
JitBase: Avoid System::GetInstance() and ppcState. 2023-03-25 02:37:00 +01:00
Lioncash
0f326c6067 Common: Move FixedSizeQueue into Common namespace
Gets this out of the global namespace.
2023-03-22 01:23:15 -04:00
Lioncash
0888c93d48 Common: Move FPU-related helpers into Common namespace
Makes these utilities' namespace consistent with the majority of the
Common library.
2023-03-21 10:58:13 -04:00
Shawn Hoffman
2c2fb869a2 use std-provided randomness for JitArm64 unittests
decreases runtime significantly and lessens dependency on mbedtls
2023-02-22 12:55:12 -08:00
Admiral H. Curtiss
c36994a90d
Add unit test for File::CreateFullPath(). 2023-02-15 02:56:10 +01:00
TellowKrinkle
07e98c7790 CMake: Use imported target for fmt in tests
This properly adds the header include paths when using system fmt
2023-01-29 14:37:54 -06:00
Admiral H. Curtiss
61ba516570
PowerPC: Move a few functions to PowerPCState. 2023-01-27 15:22:44 +01:00
Lioncash
e5b91f00b0 Common: Replace StringBeginsWith/StringEndsWith with std equivalents
Obsoletes these functions in favor of the standard member functions
added in C++20.
2023-01-24 14:58:20 -05:00
Pokechu22
597f8f1b87 Externals: Convert gtest to a submodule and update to v1.12.1 2023-01-20 11:43:34 -08:00
Pokechu22
92b6446da1 UnitTests: Add custom main that calls RegisterMsgAlertHandler
This prevents a failed assertion from hanging on the MSVC buildbots.
2023-01-13 15:38:00 -08:00
JosJuice
454537d53e Replace BitUtils with C++20: RotateLeft/RotateRight
Now that we've flipped the C++20 switch, let's start making use of
the nice new <bit> header.

I'm planning on handling this move away from BitUtils.h incrementally
in a series of PRs. There may be a few functions remaining in
BitUtils.h by the end that C++20 doesn't have any equivalents for.
2022-12-11 08:59:18 +01:00
Admiral H. Curtiss
daa70533cd
CoreTiming: Store Globals in CoreTimingManager. 2022-11-27 03:47:12 +01:00
Admiral H. Curtiss
c9558ecb4c
CoreTiming: Refactor to class. 2022-11-27 03:47:12 +01:00