Commit Graph

236 Commits

Author SHA1 Message Date
Michael Maltese 8e849b1595 Remove OpenAL DLL from Externals 2017-06-27 00:06:14 -07:00
Léo Lam 60c6fbe9cc Add CommonTitles.h for common Wii title IDs 2017-06-26 15:17:55 +02:00
Niels Boehm df82adca43 Add function testing whether a bitmask is valid.
This one verifies bitmasks where low bits are set to 1 (hence the name).
Any stray 0 among the lower ones or any stray 1 among the higher zeros
renders the mask invalid.

The edge cases of all zeros and all ones are considered valid masks.

It uses an efficient implementation. It's the counterpart of
https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2
2017-06-22 20:22:53 +02:00
Léo Lam 5243eae4e9 UnitTests: Use a temporary profile directory
This prevents Dolphin from modifying any file in the user directory.
2017-06-18 16:23:09 +02:00
Léo Lam 6c3069be97 IOS/ESFormats: Use SignedBlobReader for TMDs and tickets 2017-06-14 22:45:29 +02:00
shuffle2 ffd8309aca Merge branch 'master' into fix-unittests 2017-06-07 21:20:06 -07:00
Shawn Hoffman 1bb26dddb1 msbuild: only set /NODEFAULTLIB in one place 2017-06-07 17:30:05 -07:00
Shawn Hoffman a2358786dc unittests: set user directory so SYSCONF does not get created at the drive root 2017-06-06 04:07:13 -07:00
Sepalani 5fb26abb17 StringUtil: Add StringPopBackIf UnitTests 2017-06-06 05:50:45 +01:00
shuffle2 c8166951a0 Merge pull request #5418 from MerryMage/config-again-and-again
VideoConfig: Port to layered configuration system
2017-06-05 21:11:04 -07:00
Michael Maltese 80710984dc DSPTool: extract tests into a DSPAssemblyTest
- Moves all test code from DSPTool into UnitTests/Core/DSPAssemblyTest.
- Converts test files (which could only be loaded if they were in the
  shell's working directory, so basically never) into C++ values.
- Enables most of the commented-out tests.
- Removes non-deterministic random code test.
2017-06-05 19:28:40 -07:00
Léo Lam d9fd056803 Fix minor formatting issues
These were not caught by the lint script while it was broken.
2017-06-05 02:32:19 +02:00
Shawn Hoffman 09367c8c10 msbuild: remove more duplicate code 2017-06-03 18:20:41 -07:00
Shawn Hoffman ddae5058e9 msbuild: increment other version numbers to vs2017 equivalents 2017-06-03 18:20:39 -07:00
MerryMage 41afe78a44 Config: Integrate 2017-06-03 18:11:57 +01:00
shuffle2 3443454ba2 Merge pull request #5271 from JosJuice/allow-aslr
Allow (but don't force) ASLR
2017-06-02 21:53:02 -07:00
BhaaL 072c161445 upgrade to Windows SDK 10.0.15063.0
this is required for /permissive- to work, because some headers in the
Windows SDK use Microsoft extensions that are not allowed in standards mode
2017-05-28 13:37:31 +02:00
Michael Maltese f6e1da0dc0 AudioCommon: add Cubeb backend 2017-05-27 18:28:56 -07:00
Pierre Bourdon d592bdd4d4 Migrate to Visual Studio 2017.
Auto-generated by the IDE, I'll trust it knows what it's doing.
2017-05-25 15:58:59 -07:00
Michael Maltese 974ada25e4 CMake: use RUNTIME_OUTPUT_DIRECTORY rather than setting OUTPUT_NAME each time 2017-05-22 00:19:14 -07:00
Michael Maltese 6d403d9ad4 CMake: specify unittests libs directly in target_link_libraries 2017-05-22 00:19:14 -07:00
Michael Maltese 8e57a0ff14 CMake: remove explicit platform libraries from UnitTests
They're not used directly, and any libraries that need them will pull
them in transitively.
2017-05-22 00:19:14 -07:00
Michael Maltese be2f4466e3 CMake: move unittests target to UnitTests 2017-05-22 00:19:14 -07:00
Michael Maltese ea35549e00 CMake: don't explictly create Tests/ directory 2017-05-22 00:19:13 -07:00
Michael Maltese 41fb6db6e3 CMake: remove extraneous TestUtils directory 2017-05-22 00:19:13 -07:00
Michael Maltese 87d64afe19 CMake: pass all srcs to add_test in ARGN 2017-05-22 00:19:13 -07:00
Michael Maltese 9d130b52f7 CMake: use unittests_stubhost object library 2017-05-22 00:19:13 -07:00
Michael Maltese a78ca46d9e CMake: use implicit target location in add_test 2017-05-22 00:19:13 -07:00
Michael Maltese 942cbd3c8d CMake: don't prefix test targets with Test_
The current prefixing makes it harder to build test executables directly
from the command line, since the target name breaks CMake convention and
doesn't match the name passed to `add_dolphin_test`. They all have "Test"
somewhere in the name anyways.
2017-05-22 00:19:13 -07:00
JosJuice e019872d62 Remove no-pie build flags 2017-05-20 09:35:53 +02:00
Helios747 a465c483f3 Remove D3D12 2017-05-18 17:01:12 -07:00
spycrab e66ad018f4 Convert VolumeDirectory names back to SHIFT-JIS (issue #9988) 2017-05-01 14:08:47 +02:00
Markus Wick 34ac749b8b Merge pull request #5144 from MerryMage/mfspr
Jit_SystemRegisters: Make mfspr PIE-compliant
2017-04-10 22:30:56 +02:00
Léo Lam 47a09de019 Add unit tests for IOS/ESFormats
This adds unit tests for IOS/ESFormats, and in particular, for the
TMDReader. It is tested using invalid TMDs (to check IsValid()) and
two valid, properly signed TMDs.

Things which are now tested:

* Title type helper functions.
* TMDReader: Validity check.
* TMDReader: General information returned by the Get*() methods.
* TMDReader: Raw TMD and generated TMD view, compared against IOS.
* TMDReader: Game ID generation code (which is Dolphin specific).
* TMDReader: Content information: getting by ID/index, order, metadata.
2017-04-05 20:54:11 +02:00
MerryMage 38917a151d CoreTiming: Pull globals into a single struct 2017-04-05 10:22:48 +01:00
Michael Maltese b305a6c575 VertexLoaderTest: fix maybe-uninitialized warning
Fixes warning:

```
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:222:15: error: variable 'f' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
    ExpectOut(f * scale);
              ^
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:198:12: note: initialize the variable 'f' to silence this warning
    float f, g;
           ^
            = 0.0
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:223:15: error: variable 'g' may be uninitialized when used here [-Werror,-Wconditional-uninitialized]
    ExpectOut(g * scale);
              ^
../Source/UnitTests/VideoCommon/VertexLoaderTest.cpp:198:15: note: initialize the variable 'g' to silence this warning
    float f, g;
              ^
               = 0.0
```
2017-03-31 13:51:20 -07:00
Mat M 6a595aabe9 Merge pull request #5153 from ligfx/stubhostnorequestfullscreen
StubHost: remove unused Host_RequestFullscreen()
2017-03-31 00:21:04 -04:00
Mat M 774d2420e3 Merge pull request #5158 from ligfx/coretimingstatic
CoreTimingTest: make AdvanceAndCheck() static (fix warning)
2017-03-31 00:09:20 -04:00
Matthew Parlane e05b6cf3f4 Merge pull request #5155 from ligfx/expecttruefalse
UnitTests: use EXPECT_TRUE/EXPECT_FALSE (fixes warnings)
2017-03-26 14:53:17 +13:00
Michael Maltese 0c28ff2acc CoreTimingTest: make AdvanceAndCheck() static (fix warning)
Fixes warning:

```
../Source/UnitTests/Core/CoreTimingTest.cpp: In function 'void AdvanceAndCheck(u32, int, int, int)':
../Source/UnitTests/Core/CoreTimingTest.cpp:52:6: error: no previous declaration for 'void AdvanceAndCheck(u32, int, int, int)' [-Werror=missing-declarations]
 void AdvanceAndCheck(u32 idx, int downcount, int expected_lateness = 0, int cpu_downcount = 0)
      ^
```
2017-03-24 21:37:34 -07:00
Michael Maltese 04db3d5a50 UnitTests: use EXPECT_TRUE/EXPECT_FALSE (fixes warnings)
Using `EXPECT_EQ` with boolean literals can cause a warning in certain
versions of GCC. See https://github.com/google/googletest/issues/322

Fixes warnings:

```
../Source/UnitTests/Common/BitSetTest.cpp: In member function 'virtual void BitSet_Basics_Test::TestBody()':
../Source/UnitTests/Common/BitSetTest.cpp:15:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/BitSetTest.cpp: In member function 'virtual void BitSet_BitGetSet_Test::TestBody()':
../Source/UnitTests/Common/BitSetTest.cpp:27:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp: In member function 'virtual void StringUtil_StringBeginsWith_Test::TestBody()':
../Source/UnitTests/Common/StringUtilTest.cpp:23:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:25:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:26:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:27:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp: In member function 'virtual void StringUtil_StringEndsWith_Test::TestBody()':
../Source/UnitTests/Common/StringUtilTest.cpp:35:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:37:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:38:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
../Source/UnitTests/Common/StringUtilTest.cpp:39:165: error: converting 'false' to pointer type for argument 1 of 'char testing::internal::IsNullLiteralHelper(testing::internal::Secret*)' [-Werror=conversion-null]
c
```
2017-03-24 17:26:27 -07:00
Michael Maltese 9234ed82da BitUtilsTest: compare ints of the same signedness (fixes warnings)
Fixes warnings like:

```
dolphin/Source/UnitTests/Common/BitUtilsTest.cpp:5:
../Externals/gtest/googletest/include/gtest/gtest.h:1392:11: warning: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Wsign-compare]
  if (lhs == rhs) {
      ~~~ ^  ~~~
../Externals/gtest/googletest/include/gtest/gtest.h:1421:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<unsigned long, int>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
dolphin/Source/UnitTests/Common/BitUtilsTest.cpp:12:3: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<unsigned long, int>' requested here
  EXPECT_EQ(Common::BitSize<s8>(),  8);
  ^
../Externals/gtest/googletest/include/gtest/gtest.h:1924:63: note: expanded from macro 'EXPECT_EQ'
                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
```
2017-03-24 17:15:37 -07:00
Michael Maltese 5d69e99943 StubHost: remove unused Host_RequestFullscreen()
Fixes warning:

```
../Source/UnitTests/TestUtils/StubHost.cpp: In function 'void Host_RequestFullscreen(bool)':
../Source/UnitTests/TestUtils/StubHost.cpp:39:6: error: no previous declaration for 'void Host_RequestFullscreen(bool)' [-Werror=missing-declarations]
 void Host_RequestFullscreen(bool)
      ^
```
2017-03-24 16:41:12 -07:00
Lioncash 552c0d8404 Common: Move byte swapping utilities into their own header
This moves all the byte swapping utilities into a header named Swap.h.

A dedicated header is much more preferable here due to the size of the
code itself. In general usage throughout the codebase, CommonFuncs.h was
generally only included for these functions anyway. These being in their
own header avoids dumping the lesser used utilities into scope. As well
as providing a localized area for more utilities related to byte
swapping in the future (should they be needed). This also makes it nicer
to identify which files depend on the byte swapping utilities in
particular.

Since this is a completely new header, moving the code uncovered a few
indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 17:18:18 -05:00
Lioncash ee61bd6f2e CMakeLists: Normalize whitespace
Normalizes tabs to spaces to follow our codebase's indentation style.
2017-03-01 14:53:23 -05:00
Mat M a3ba169e7d Merge pull request #4809 from Orphis/cmake_windows
CMake for Windows: getting a working binary!
2017-02-03 08:33:13 -05:00
Florent Castelli 3842a9b71c OpenAL: Move Windows binaries to lib folder and fix CMake detection
The module FindOpenAL is looking for the dll in a folder called lib, not x64.
This is only used on Windows x64, it's fine to remove the platform name.
2017-02-03 04:54:54 +01:00
Florent Castelli 9180c87197 cmake: Put test targets in folders 2017-02-03 04:23:24 +01:00
Florent Castelli e5f576f862 gtest: Update to latest version from git 2017-01-26 03:14:08 +01:00
Florent Castelli 223e213bcf cmake: Change endmacro(.*) to endmacro() 2017-01-25 15:07:32 +01:00