SPIGtestMain.cpp
#include "gtest/gtest.h"
#include "gmock/gmock.h"
TEST_F(GivenANewSPI,WhenDemoIsCalled_TheComponentGetsVal)
{
unsigned char const *Ptr;
unsigned char const *BufLim;
const unsigned char *DataSample;
const unsigned char *EndOfSample;
extren MockClass MockObj;
EXPECT_CALL(MockObj, PSDemo(Ptr,BufLim)).WillOnce(Return(25));
EXPECT_EQ(Val,Demo(DataSample,EndOfSample);
}
MockSPI.h
#include <gmock/gmock.h>
class MockClass : public GivenANewSPI
{
public:
MockClass();
~MockClass();
MOCK_METHOD2 (PSDemo,signed char(unsigned char const*,unsigned char const*));
};
SPI.h
#include "gtest/gtest_prod.h"
class SPI : public SPIProxy
{
private:
virtual signed char PSDemo(unsigned char const *Ptr,unsigned char const *BufLim) const;
virtual signed char Demo(const unsigned char* DataSample, const unsigned char* EndOfSample) override;
};
I'm getting following errors,
- MockSPI.h: expected class name before '{' token
- SPIGtestMain.cpp: 'MockClass' does not name a type
- SPIGtestMain.cpp: 'MockObj' was not declared in this scope
- SPIGtestMain.cpp: 'Return' was not declared in this scope
Aucun commentaire:
Enregistrer un commentaire