diff --git a/include/caosdb/data_type.h b/include/caosdb/data_type.h index 45d82f01ba952f1c56e8e02178d6721795fbc288..c084a338272532db652b4d7df85cfa42940c6bb1 100644 --- a/include/caosdb/data_type.h +++ b/include/caosdb/data_type.h @@ -246,10 +246,10 @@ public: * Copy assignment operator. */ inline auto operator=(const DataType &other) -> DataType & { - if(this != &other) { + if (this != &other) { this->reference_data_type.reset(); this->list_data_type.reset(); - if(other.wrapped != nullptr) { + if (other.wrapped != nullptr) { this->wrapped = ProtoMessageWrapper<ProtoDataType>::CopyProtoMessage(other.wrapped); } else { this->wrapped = nullptr; @@ -262,7 +262,7 @@ public: * Move assignment operator. */ inline auto operator=(DataType &&other) -> DataType & { - if(this != &other) { + if (this != &other) { this->wrapped = other.wrapped; other.wrapped = nullptr; other.reference_data_type.reset(); diff --git a/include/caosdb/entity.h b/include/caosdb/entity.h index c261c1c5af1df71fcf19de377c617092b10deeb0..2f6e4ed96670f3c3e16749f3a2a590d491b29abe 100644 --- a/include/caosdb/entity.h +++ b/include/caosdb/entity.h @@ -191,10 +191,11 @@ public: * Return true if the underlying Protobuf messages have the same * serialization. */ - inline auto operator==(const RepeatedPtrFieldWrapper<T,P> &other) const noexcept -> bool { + inline auto operator==(const RepeatedPtrFieldWrapper<T, P> &other) const noexcept -> bool { if (this->wrapped != nullptr && other.wrapped != nullptr && this->size() == other.size()) { - for(int i = 0; i < this->size(); i++) { - if(this->wrapped->Get(i).SerializeAsString() != other.wrapped->Get(i).SerializeAsString()) { + for (int i = 0; i < this->size(); i++) { + if (this->wrapped->Get(i).SerializeAsString() != + other.wrapped->Get(i).SerializeAsString()) { return false; } } @@ -208,7 +209,7 @@ public: * Return true if the underlying Protobuf messages have a different * serialization. */ - inline auto operator!=(const RepeatedPtrFieldWrapper<T,P> &other) const noexcept -> bool { + inline auto operator!=(const RepeatedPtrFieldWrapper<T, P> &other) const noexcept -> bool { return !(*this == other); } diff --git a/test/test_entity.cpp b/test/test_entity.cpp index f800d5a85a878728d73d9bbd23e1d92af99f226f..2b9a8d900864617abc23bdd1d05782a1eb65c60b 100644 --- a/test/test_entity.cpp +++ b/test/test_entity.cpp @@ -152,16 +152,19 @@ TEST(test_entity, test_copy_constructor) { property.set_description("the prop-desc"); property.set_name("the-prop-name"); property.mutable_value()->mutable_list_values()->mutable_values()->Add()->set_double_value(25.5); - property.mutable_data_type()->mutable_list_data_type()->set_atomic_data_type(ProtoAtomicDataType::ATOMIC_DATA_TYPE_DOUBLE); + property.mutable_data_type()->mutable_list_data_type()->set_atomic_data_type( + ProtoAtomicDataType::ATOMIC_DATA_TYPE_DOUBLE); EntityResponse entity_response; entity_response.mutable_entity()->set_id("the-id"); entity_response.mutable_entity()->set_name("the-name"); entity_response.mutable_entity()->set_role(ProtoEntityRole::ENTITY_ROLE_RECORD); entity_response.mutable_entity()->set_description("the description"); entity_response.mutable_entity()->set_unit("the-unit"); - entity_response.mutable_entity()->mutable_value()->mutable_scalar_value()->set_string_value("the-value"); + entity_response.mutable_entity()->mutable_value()->mutable_scalar_value()->set_string_value( + "the-value"); entity_response.mutable_entity()->mutable_version()->set_id("version-id"); - entity_response.mutable_entity()->mutable_data_type()->mutable_reference_data_type()->set_name("refname"); + entity_response.mutable_entity()->mutable_data_type()->mutable_reference_data_type()->set_name( + "refname"); entity_response.mutable_entity()->mutable_file_descriptor(); entity_response.mutable_entity()->mutable_properties()->Add()->CopyFrom(property); entity_response.mutable_entity()->mutable_parents()->Add()->CopyFrom(parent); @@ -204,7 +207,8 @@ TEST(test_entity, test_move_constructor) { property.set_description("the prop-desc"); property.set_name("the-prop-name"); property.mutable_value()->mutable_list_values()->mutable_values()->Add()->set_double_value(25.5); - property.mutable_data_type()->mutable_list_data_type()->set_atomic_data_type(ProtoAtomicDataType::ATOMIC_DATA_TYPE_DOUBLE); + property.mutable_data_type()->mutable_list_data_type()->set_atomic_data_type( + ProtoAtomicDataType::ATOMIC_DATA_TYPE_DOUBLE); EntityResponse entity_response; entity_response.mutable_errors()->Add()->set_code(25); entity_response.mutable_errors()->Mutable(0)->set_description("asdf"); @@ -217,9 +221,11 @@ TEST(test_entity, test_move_constructor) { entity_response.mutable_entity()->set_role(ProtoEntityRole::ENTITY_ROLE_RECORD); entity_response.mutable_entity()->set_description("the description"); entity_response.mutable_entity()->set_unit("the-unit"); - entity_response.mutable_entity()->mutable_value()->mutable_scalar_value()->set_string_value("the-value"); + entity_response.mutable_entity()->mutable_value()->mutable_scalar_value()->set_string_value( + "the-value"); entity_response.mutable_entity()->mutable_version()->set_id("version-id"); - entity_response.mutable_entity()->mutable_data_type()->mutable_reference_data_type()->set_name("refname"); + entity_response.mutable_entity()->mutable_data_type()->mutable_reference_data_type()->set_name( + "refname"); entity_response.mutable_entity()->mutable_file_descriptor(); entity_response.mutable_entity()->mutable_properties()->Add()->CopyFrom(property); entity_response.mutable_entity()->mutable_parents()->Add()->CopyFrom(parent);