diff --git a/test/test_issues.cpp b/test/test_issues.cpp index 80dc4f9ae7b5efe2406c36c862fa15b168e92d2e..d8a39fdebf4fcc30ab9010936cc20e1a737283fd 100644 --- a/test/test_issues.cpp +++ b/test/test_issues.cpp @@ -196,4 +196,32 @@ TEST_F(test_issues, server_issue_171) { std::cout << inserted_rec.ToString() << std::endl; } +/* + * Inserting a non-file property with an empty file path should work. + * + * The file attributes should be ignored by the server. + */ +TEST_F(test_issues, server_issue_174) { + const auto &connection = + caosdb::connection::ConnectionManager::GetDefaultConnection(); + + auto insert_transaction(connection->CreateTransaction()); + + // Create and insert RT + Entity rt; + rt.SetRole(Role::RECORD_TYPE); + rt.SetName("Not a FILE"); + rt.SetFilePath(""); + insert_transaction->InsertEntity(&rt); + insert_transaction->ExecuteAsynchronously(); + + auto insert_status = insert_transaction->WaitForIt(); + ASSERT_TRUE(insert_status.IsTerminated()); + // TODO(tf) Remove the EXPECT_NONFATAL_FAILURE after fixing #174. + EXPECT_NONFATAL_FAILURE( + EXPECT_FALSE(insert_status.IsError()) + , ""); + +} + } // namespace caosdb::transaction