Skip to content

Commit 67e284e

Browse files
committed
Tests compiled on windows when multiple inheritance test disabled, so adding if instead to keep it for linux
1 parent 67c179e commit 67e284e

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include_directories(${PROJECT_SOURCE_DIR}/src)
22
include_directories(include)
33

4-
add_executable(8bit-tests test_main.cpp core/BusTest.cpp core/FlagsRegisterTest.cpp core/StepCounterTest.cpp core/ProgramCounterTest.cpp core/ArithmeticLogicUnitTest.cpp core/EmulatorIntegrationTest.cpp core/AssemblerTest.cpp core/UtilsTest.cpp core/RandomAccessMemoryTest.cpp core/MemoryAddressRegisterTest.cpp core/TimeSourceTest.cpp core/ClockTest.cpp core/OutputRegisterTest.cpp core/InstructionRegisterTest.cpp core/GenericRegisterTest.cpp)
4+
add_executable(8bit-tests test_main.cpp core/BusTest.cpp core/FlagsRegisterTest.cpp core/StepCounterTest.cpp core/ProgramCounterTest.cpp core/ArithmeticLogicUnitTest.cpp core/EmulatorIntegrationTest.cpp core/AssemblerTest.cpp core/UtilsTest.cpp core/InstructionDecoderTest.cpp core/RandomAccessMemoryTest.cpp core/MemoryAddressRegisterTest.cpp core/TimeSourceTest.cpp core/ClockTest.cpp core/OutputRegisterTest.cpp core/InstructionRegisterTest.cpp core/GenericRegisterTest.cpp)
55
target_link_libraries(8bit-tests 8bit-core)
66

77
enable_testing()
@@ -13,7 +13,7 @@ add_test(ClockTest 8bit-tests --source-file=*ClockTest.cpp)
1313
add_test(EmulatorIntegrationTest 8bit-tests --source-file=*EmulatorIntegrationTest.cpp)
1414
add_test(FlagsRegisterTest 8bit-tests --source-file=*FlagsRegisterTest.cpp)
1515
add_test(GenericRegisterTest 8bit-tests --source-file=*GenericRegisterTest.cpp)
16-
#add_test(InstructionDecoderTest 8bit-tests --source-file=*InstructionDecoderTest.cpp)
16+
add_test(InstructionDecoderTest 8bit-tests --source-file=*InstructionDecoderTest.cpp)
1717
add_test(InstructionRegisterTest 8bit-tests --source-file=*InstructionRegisterTest.cpp)
1818
add_test(MemoryAddressRegisterTest 8bit-tests --source-file=*MemoryAddressRegisterTest.cpp)
1919
add_test(OutputRegisterTest 8bit-tests --source-file=*OutputRegisterTest.cpp)

test/core/InstructionDecoderTest.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ std::shared_ptr<T> ptr(fakeit::Mock<T> &mock) {
1616
*/
1717

1818
TEST_SUITE("InstructionDecoderTest") {
19+
20+
#ifndef _WIN32
1921
TEST_CASE("should call the correct control lines for the different instruction steps") {
2022
fakeit::Mock<MemoryAddressRegister> marMock;
2123
fakeit::Mock<ProgramCounter> pcMock;
@@ -466,4 +468,10 @@ TEST_SUITE("InstructionDecoderTest") {
466468
"InstructionDecoder step is unknown: 5");
467469
}
468470
}
471+
472+
#else
473+
TEST_CASE("windows no op") {
474+
// This test does not work on Windows due to multiple inheritance issues
475+
}
476+
#endif
469477
}

test/include/fakeit.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5604,9 +5604,8 @@ namespace fakeit {
56045604
class SimpleType {
56055605
};
56065606

5607-
// TODO disabled by blurpy
5608-
// static_assert(sizeof(unsigned int (SimpleType::*)()) == sizeof(unsigned int (C::*)()),
5609-
// "Can't mock a type with multiple inheritance or with non-polymorphic base class");
5607+
static_assert(sizeof(unsigned int (SimpleType::*)()) == sizeof(unsigned int (C::*)()),
5608+
"Can't mock a type with multiple inheritance or with non-polymorphic base class");
56105609
static const unsigned int numOfCookies = 3;
56115610

56125611
static void **buildVTArray() {

0 commit comments

Comments
 (0)