diff --git a/unit_tests/helpers/base_object_tests.cpp b/unit_tests/helpers/base_object_tests.cpp index 2b8149808f..d375164749 100644 --- a/unit_tests/helpers/base_object_tests.cpp +++ b/unit_tests/helpers/base_object_tests.cpp @@ -61,64 +61,42 @@ template struct BaseObjectTests : public ::testing::Test { }; +template +class MockObjectBase : public OclObject { + public: + using OclObject::OclObject; + + void setInvalidMagic() { + validMagic = this->magic; + this->magic = 0x0101010101010101LL; + } + void setValidMagic() { + this->magic = validMagic; + } + + bool isObjectValid() const { + return this->isValid(); + } + + cl_ulong validMagic; +}; + template -class MockObject : public BaseType { +class MockObject : public MockObjectBase {}; + +template <> +class MockObject : public MockObjectBase { public: - void setInvalidMagic() { - validMagic = this->magic; - this->magic = 0x0101010101010101LL; - } - void setValidMagic() { - this->magic = validMagic; - } - - bool isObjectValid() const { - return this->isValid(); - } - - cl_ulong validMagic; + void setArgStateful(void *memory, bool forceNonAuxMode) override {} }; template <> -class MockObject : public Buffer { +class MockObject : public MockObjectBase { public: - void setInvalidMagic() { - validMagic = this->magic; - this->magic = 0x0101010101010101LL; - } - void setValidMagic() { - this->magic = validMagic; - } - - bool isObjectValid() const { - return this->isValid(); - } - - void setArgStateful(void *memory, bool forceNonAuxMode) override { - } - - cl_ulong validMagic; -}; - -template <> -class MockObject : public Program { - public: - MockObject() : Program(*new ExecutionEnvironment()), + MockObject() : MockObjectBase(*new ExecutionEnvironment()), executionEnvironment(&this->peekExecutionEnvironment()) {} - void setInvalidMagic() { - validMagic = this->magic; - this->magic = 0x0101010101010101LL; - } - void setValidMagic() { - this->magic = validMagic; - } - - bool isObjectValid() const { - return this->isValid(); - } - - cl_ulong validMagic; + private: std::unique_ptr executionEnvironment; };