diff --git a/cpp/celeborn/network/MessageDecoder.h b/cpp/celeborn/network/FrameDecoder.h similarity index 96% rename from cpp/celeborn/network/MessageDecoder.h rename to cpp/celeborn/network/FrameDecoder.h index 828ac91ff6d..e6e3716190a 100644 --- a/cpp/celeborn/network/MessageDecoder.h +++ b/cpp/celeborn/network/FrameDecoder.h @@ -36,9 +36,9 @@ namespace network { * #frameLength = #headerLength + #encodedLength + #bodyLength. */ -class MessageDecoder : public wangle::ByteToByteDecoder { +class FrameDecoder : public wangle::ByteToByteDecoder { public: - MessageDecoder(bool networkByteOrder = true) + FrameDecoder(bool networkByteOrder = true) : networkByteOrder_(networkByteOrder) {} bool decode( diff --git a/cpp/celeborn/network/tests/CMakeLists.txt b/cpp/celeborn/network/tests/CMakeLists.txt index 2b987ed6799..46a3fcf56d8 100644 --- a/cpp/celeborn/network/tests/CMakeLists.txt +++ b/cpp/celeborn/network/tests/CMakeLists.txt @@ -15,12 +15,10 @@ add_executable( celeborn_network_test - MessageDecoderTest.cpp) + FrameDecoderTest.cpp) add_test(NAME celeborn_network_test COMMAND celeborn_network_test) -#target_include_directories(network PUBLIC ${CMAKE_BINARY_DIR}) - target_link_libraries( celeborn_network_test PRIVATE diff --git a/cpp/celeborn/network/tests/MessageDecoderTest.cpp b/cpp/celeborn/network/tests/FrameDecoderTest.cpp similarity index 95% rename from cpp/celeborn/network/tests/MessageDecoderTest.cpp rename to cpp/celeborn/network/tests/FrameDecoderTest.cpp index 5fbd3184744..63c776f3325 100644 --- a/cpp/celeborn/network/tests/MessageDecoderTest.cpp +++ b/cpp/celeborn/network/tests/FrameDecoderTest.cpp @@ -17,7 +17,7 @@ #include -#include "celeborn/network/MessageDecoder.h" +#include "celeborn/network/FrameDecoder.h" using namespace celeborn::network; @@ -73,7 +73,7 @@ void testDecodeWithEndian(bool isBigEndian) { } size_t dummy; - MessageDecoder decoder(isBigEndian); + FrameDecoder decoder(isBigEndian); folly::IOBufQueue::Options option; option.cacheChainLength = true; folly::IOBufQueue queue(option); @@ -114,10 +114,10 @@ void testDecodeWithEndian(bool isBigEndian) { EXPECT_EQ(cursor->readFixedString(bodyLength), bodyContent); } -TEST(MessageDecoderTest, decodeBigEndian) { +TEST(FrameDecoderTest, decodeBigEndian) { testDecodeWithEndian(true); } -TEST(MessageDecoderTest, decodeLittleEndian) { +TEST(FrameDecoderTest, decodeLittleEndian) { testDecodeWithEndian(false); }