Skip to content
Snippets Groups Projects
Verified Commit d6f573ff authored by Timm Fitschen's avatar Timm Fitschen
Browse files

more tests for moving entities

parent 5ccac6d9
No related branches found
No related tags found
1 merge request!27F move entity
......@@ -194,7 +194,8 @@ public:
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()) {
if (this->wrapped->Get(i).SerializeAsString() !=
other.wrapped->Get(i).SerializeAsString()) {
return false;
}
}
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment