From 11ba13a1c5a0aa52f6b23afe8119e6b03297c6a1 Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 3 Aug 2021 21:29:17 +0200 Subject: [PATCH] WIP: update --- src/caosdb/transaction.cpp | 5 +++-- test/test_entity.cpp | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/caosdb/transaction.cpp b/src/caosdb/transaction.cpp index 3dd8056..ae9ddd2 100644 --- a/src/caosdb/transaction.cpp +++ b/src/caosdb/transaction.cpp @@ -165,8 +165,9 @@ auto Transaction::UpdateEntity(Entity *entity) noexcept -> StatusCode { auto Transaction::Execute() -> TransactionStatus { ExecuteAsynchronously(); - this->status.ThrowExceptionIfError(); - return this->status; + auto status = WaitForIt(); + status.ThrowExceptionIfError(); + return status; } auto Transaction::ExecuteAsynchronously() noexcept -> StatusCode { diff --git a/test/test_entity.cpp b/test/test_entity.cpp index 8d2ce29..56d3c2a 100644 --- a/test/test_entity.cpp +++ b/test/test_entity.cpp @@ -106,7 +106,7 @@ TEST(test_entity, test_append_property) { // NOLINT TEST(test_entity, test_copy_to) { auto entity = Entity(); - entity.SetId("original_id"); + entity.SetRole("original_role"); entity.SetName("orignial_name"); auto parent = Parent(); @@ -126,7 +126,7 @@ TEST(test_entity, test_copy_to) { entity.CopyTo(proto_copy); auto copied = Entity(proto_copy); - EXPECT_EQ(entity.GetId(), copied.GetId()); + EXPECT_EQ(entity.GetRole(), copied.GetRole()); EXPECT_EQ(entity.GetName(), copied.GetName()); EXPECT_EQ(copied.GetParents().At(0).GetId(), parent.GetId()); EXPECT_EQ(copied.GetParents().At(0).GetName(), parent.GetName()); @@ -177,7 +177,7 @@ TEST(test_entity, test_insert_with_parent) { std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr)); auto entity = Entity(); - entity.SetId("entity_id"); + entity.SetName("entity_name"); auto parent = Parent(); parent.SetId("parent_id"); @@ -190,7 +190,7 @@ TEST(test_entity, test_insert_with_parent) { transaction.InsertEntity(&entity); std::cout << entity.ToString() << std::endl; - EXPECT_EQ(entity.GetId(), "entity_id"); + EXPECT_EQ(entity.GetName(), "entity_name"); EXPECT_EQ(entity.GetParents().Size(), 1); auto inserted_parent = entity.GetParents().At(0); EXPECT_EQ(inserted_parent.GetId(), parent.GetId()); @@ -203,7 +203,7 @@ TEST(test_entity, test_insert_with_property) { // NOLINT std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr)); auto entity = Entity(); - entity.SetId("entity_id"); + entity.SetName("entity_name"); auto prop = Property(); prop.SetName("prop_name"); -- GitLab