Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Unit test improvements #549

Merged
merged 2 commits into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sbe-tool/src/test/cpp/BoundsCheckTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class BoundsCheckTest : public testing::Test
{
public:

virtual std::uint64_t encodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_hdr.wrap(buffer, offset, 0, bufferLength)
.blockLength(Car::sbeBlockLength())
Expand All @@ -55,7 +55,7 @@ class BoundsCheckTest : public testing::Test
return m_hdr.encodedLength();
}

virtual std::uint64_t decodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t decodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_hdrDecoder.wrap(buffer, offset, 0, bufferLength);

Expand All @@ -67,7 +67,7 @@ class BoundsCheckTest : public testing::Test
return m_hdrDecoder.encodedLength();
}

virtual std::uint64_t encodeCarRoot(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeCarRoot(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_car.wrapForEncode(buffer, offset, bufferLength)
.serialNumber(SERIAL_NUMBER)
Expand Down Expand Up @@ -95,7 +95,7 @@ class BoundsCheckTest : public testing::Test
return m_car.encodedLength();
}

virtual std::uint64_t encodeCarFuelFigures()
std::uint64_t encodeCarFuelFigures()
{
Car::FuelFigures& fuelFigures = m_car.fuelFiguresCount(3);

Expand All @@ -114,7 +114,7 @@ class BoundsCheckTest : public testing::Test
return m_car.encodedLength();
}

virtual std::uint64_t encodeCarPerformanceFigures()
std::uint64_t encodeCarPerformanceFigures()
{
Car::PerformanceFigures &perfFigs = m_car.performanceFiguresCount(2);

Expand All @@ -135,7 +135,7 @@ class BoundsCheckTest : public testing::Test
return m_car.encodedLength();
}

virtual std::uint64_t encodeCarManufacturerModelAndActivationCode()
std::uint64_t encodeCarManufacturerModelAndActivationCode()
{
m_car.putManufacturer(MANUFACTURER, static_cast<int>(strlen(MANUFACTURER)));
m_car.putModel(MODEL, static_cast<int>(strlen(MODEL)));
Expand All @@ -144,7 +144,7 @@ class BoundsCheckTest : public testing::Test
return m_car.encodedLength();
}

virtual std::uint64_t decodeCarRoot(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength)
std::uint64_t decodeCarRoot(char *buffer, const std::uint64_t offset, const std::uint64_t bufferLength)
{
m_carDecoder.wrapForDecode(buffer, offset, Car::sbeBlockLength(), Car::sbeSchemaVersion(), bufferLength);
EXPECT_EQ(m_carDecoder.serialNumber(), SERIAL_NUMBER);
Expand Down Expand Up @@ -178,7 +178,7 @@ class BoundsCheckTest : public testing::Test
return m_carDecoder.encodedLength();
}

virtual std::uint64_t decodeCarFuelFigures()
std::uint64_t decodeCarFuelFigures()
{
char tmp[256];
Car::FuelFigures &fuelFigures = m_carDecoder.fuelFigures();
Expand Down Expand Up @@ -208,7 +208,7 @@ class BoundsCheckTest : public testing::Test
return m_carDecoder.encodedLength();
}

virtual std::uint64_t decodeCarPerformanceFigures()
std::uint64_t decodeCarPerformanceFigures()
{
Car::PerformanceFigures &performanceFigures = m_carDecoder.performanceFigures();
EXPECT_EQ(performanceFigures.count(), 2u);
Expand Down Expand Up @@ -258,7 +258,7 @@ class BoundsCheckTest : public testing::Test
return m_carDecoder.encodedLength();
}

virtual std::uint64_t decodeCarManufacturerModelAndActivationCode()
std::uint64_t decodeCarManufacturerModelAndActivationCode()
{
char tmp[256];

Expand Down
4 changes: 2 additions & 2 deletions sbe-tool/src/test/cpp/CodeGenTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@ class CodeGenTest : public testing::Test
return car.encodedLength();
}

virtual std::uint64_t encodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_hdr.wrap(buffer, offset, 0, bufferLength);
return encodeHdr(m_hdr);
}

virtual std::uint64_t encodeCar(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeCar(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_car.wrapForEncode(buffer, offset, bufferLength);
return encodeCar(m_car);
Expand Down
12 changes: 6 additions & 6 deletions sbe-tool/src/test/cpp/CompositeElementsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class CompositeElementsTest : public testing::Test, public OtfMessageDecoder::Ba
m_eventNumber = 0;
}

virtual std::uint64_t encodeHdrAndMsg()
std::uint64_t encodeHdrAndMsg()
{
MessageHeader hdr;
Msg msg;
Expand All @@ -75,7 +75,7 @@ class CompositeElementsTest : public testing::Test, public OtfMessageDecoder::Ba
return hdr.encodedLength() + msg.encodedLength();
}

virtual void onBeginComposite(
void onBeginComposite(
Token &fieldToken,
std::vector<Token> &tokens,
std::size_t fromIndex,
Expand All @@ -94,7 +94,7 @@ class CompositeElementsTest : public testing::Test, public OtfMessageDecoder::Ba
}
}

virtual void onEndComposite(
void onEndComposite(
Token &fieldToken,
std::vector<Token> &tokens,
std::size_t fromIndex,
Expand All @@ -113,7 +113,7 @@ class CompositeElementsTest : public testing::Test, public OtfMessageDecoder::Ba
}
}

virtual void onEncoding(
void onEncoding(
Token& fieldToken,
const char *buffer,
Token& typeToken,
Expand Down Expand Up @@ -145,7 +145,7 @@ class CompositeElementsTest : public testing::Test, public OtfMessageDecoder::Ba

}

virtual void onBitSet(
void onBitSet(
Token& fieldToken,
const char *buffer,
std::vector<Token>& tokens,
Expand Down Expand Up @@ -174,7 +174,7 @@ class CompositeElementsTest : public testing::Test, public OtfMessageDecoder::Ba
}
}

virtual void onEnum(
void onEnum(
Token &fieldToken,
const char *buffer,
std::vector<Token> &tokens,
Expand Down
4 changes: 2 additions & 2 deletions sbe-tool/src/test/cpp/CompositeOffsetsCodeGenTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CompositeOffsetsCodeGenTest : public testing::Test
{
public:

virtual std::uint64_t encodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeHdr(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_hdr.wrap(buffer, offset, 0, bufferLength)
.blockLength(TestMessage1::sbeBlockLength())
Expand All @@ -36,7 +36,7 @@ class CompositeOffsetsCodeGenTest : public testing::Test
return m_hdr.encodedLength();
}

virtual std::uint64_t encodeMsg(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeMsg(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_msg.wrapForEncode(buffer, offset, bufferLength);

Expand Down
6 changes: 3 additions & 3 deletions sbe-tool/src/test/cpp/CompositeOffsetsIrTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class CompositeOffsetsIrTest : public testing::Test, public OtfMessageDecoder::B
m_eventNumber = 0;
}

virtual std::uint64_t encodeHdrAndMsg()
std::uint64_t encodeHdrAndMsg()
{
MessageHeader hdr;
TestMessage1 msg;
Expand All @@ -64,7 +64,7 @@ class CompositeOffsetsIrTest : public testing::Test, public OtfMessageDecoder::B
return hdr.encodedLength() + msg.encodedLength();
}

virtual void onEncoding(
void onEncoding(
Token& fieldToken,
const char *buffer,
Token& typeToken,
Expand Down Expand Up @@ -102,7 +102,7 @@ class CompositeOffsetsIrTest : public testing::Test, public OtfMessageDecoder::B

}

virtual void onGroupHeader(
void onGroupHeader(
Token& token,
std::uint64_t numInGroup)
{
Expand Down
8 changes: 4 additions & 4 deletions sbe-tool/src/test/cpp/GroupWithDataTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GroupWithDataTest : public testing::Test
{
public:

virtual std::uint64_t encodeTestMessage1(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeTestMessage1(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_msg1.wrapForEncode(buffer, offset, bufferLength);

Expand All @@ -103,7 +103,7 @@ class GroupWithDataTest : public testing::Test
return m_msg1.encodedLength();
}

virtual std::uint64_t encodeTestMessage2(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeTestMessage2(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_msg2.wrapForEncode(buffer, offset, bufferLength);

Expand All @@ -128,7 +128,7 @@ class GroupWithDataTest : public testing::Test
return m_msg2.encodedLength();
}

virtual std::uint64_t encodeTestMessage3(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeTestMessage3(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_msg3.wrapForEncode(buffer, offset, bufferLength);

Expand Down Expand Up @@ -183,7 +183,7 @@ class GroupWithDataTest : public testing::Test
return m_msg3.encodedLength();
}

virtual std::uint64_t encodeTestMessage4(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
std::uint64_t encodeTestMessage4(char *buffer, std::uint64_t offset, std::uint64_t bufferLength)
{
m_msg4.wrapForEncode(buffer, offset, bufferLength);

Expand Down
8 changes: 4 additions & 4 deletions sbe-tool/src/test/cpp/MessageBlockLengthTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MessageBlockLengthIrTest : public testing::Test, public OtfMessageDecoder:
m_eventNumber = 0;
}

virtual std::uint64_t encodeHdrAndMsg()
std::uint64_t encodeHdrAndMsg()
{
MessageHeader hdr;
MsgName msg;
Expand Down Expand Up @@ -66,7 +66,7 @@ class MessageBlockLengthIrTest : public testing::Test, public OtfMessageDecoder:
return hdr.encodedLength() + msg.encodedLength();
}

virtual void onEncoding(
void onEncoding(
Token& fieldToken,
const char *buffer,
Token& typeToken,
Expand Down Expand Up @@ -110,7 +110,7 @@ class MessageBlockLengthIrTest : public testing::Test, public OtfMessageDecoder:

}

virtual void onBitSet(
void onBitSet(
Token& fieldToken,
const char *buffer,
std::vector<Token>& tokens,
Expand All @@ -134,7 +134,7 @@ class MessageBlockLengthIrTest : public testing::Test, public OtfMessageDecoder:
}
}

virtual void onGroupHeader(
void onGroupHeader(
Token& token,
std::uint64_t numInGroup)
{
Expand Down
Loading