Skip to content

Commit

Permalink
rename messageDecoder to frameDecoder
Browse files Browse the repository at this point in the history
  • Loading branch information
HolyLow committed Jan 10, 2025
1 parent f46ded1 commit a9a1f7e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 1 addition & 3 deletions cpp/celeborn/network/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include <gtest/gtest.h>

#include "celeborn/network/MessageDecoder.h"
#include "celeborn/network/FrameDecoder.h"

using namespace celeborn::network;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

0 comments on commit a9a1f7e

Please sign in to comment.