Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhihao-723 committed Oct 18, 2024
1 parent ae86bfe commit eb5e9ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions components/core/src/clp/ffi/ir_stream/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ template <IntegerType T>
* @param node_id
* @param output_buf
*/
template <bool is_auto_generated_node, int8_t length_indicator_tag, SignedIntegerType encoded_node_id_t>
template <
bool is_auto_generated_node,
int8_t length_indicator_tag,
SignedIntegerType encoded_node_id_t>
auto size_dependent_encode_and_serialize_schema_tree_node_id(
SchemaTree::Node::id_t node_id,
std::vector<int8_t>& output_buf
Expand Down Expand Up @@ -229,7 +232,10 @@ auto get_ones_complement(T int_val) -> T {
return static_cast<T>(~int_val);
}

template <bool is_auto_generated_node, int8_t length_indicator_tag, SignedIntegerType encoded_node_id_t>
template <
bool is_auto_generated_node,
int8_t length_indicator_tag,
SignedIntegerType encoded_node_id_t>
auto size_dependent_encode_and_serialize_schema_tree_node_id(
SchemaTree::Node::id_t node_id,
std::vector<int8_t>& output_buf
Expand Down
6 changes: 3 additions & 3 deletions components/core/tests/test-ir_encoding_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ TEMPLATE_TEST_CASE(
std::true_type,
std::false_type
) {
constexpr bool cIsAutoGeneratedKeys{TestType{}};
constexpr bool cIsAutoGeneratedNode{TestType{}};
constexpr int8_t cOneByteLengthIndicatorTag{
clp::ffi::ir_stream::cProtocol::Payload::EncodedSchemaTreeNodeIdByte
};
Expand All @@ -1233,7 +1233,7 @@ TEMPLATE_TEST_CASE(

constexpr auto cSerializationMethodToTest
= clp::ffi::ir_stream::encode_and_serialize_schema_tree_node_id<
cIsAutoGeneratedKeys,
cIsAutoGeneratedNode,
cOneByteLengthIndicatorTag,
cTwoByteLengthIndicatorTag,
cFourByteLengthIndicatorTag>;
Expand Down Expand Up @@ -1274,7 +1274,7 @@ TEMPLATE_TEST_CASE(
auto const result{cDeserializationMethodToTest(tag, reader)};
REQUIRE_FALSE(result.has_error());
auto const [is_auto_generated, deserialized_node_id]{result.value()};
REQUIRE((cIsAutoGeneratedKeys == is_auto_generated));
REQUIRE((cIsAutoGeneratedNode == is_auto_generated));
REQUIRE((deserialized_node_id == node_id));
}

Expand Down

0 comments on commit eb5e9ea

Please sign in to comment.