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

Merge branch 'f-update' into f-files

parents 118e6b47 a572d9d7
Branches
Tags
1 merge request!11F files
...@@ -9,8 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -9,8 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
* Initial release.
### Changed ### Changed
### Deprecated ### Deprecated
......
...@@ -451,7 +451,6 @@ public: ...@@ -451,7 +451,6 @@ public:
auto AppendProperty(const Property &property) -> void; auto AppendProperty(const Property &property) -> void;
auto AppendParent(const Parent &parent) -> void; auto AppendParent(const Parent &parent) -> void;
auto Switch(ProtoEntity *entity) -> void;
/** /**
* Copy all of this entity's features to the target ProtoEntity. * Copy all of this entity's features to the target ProtoEntity.
*/ */
......
...@@ -177,13 +177,6 @@ auto Entity::SetVersionId(const std::string &id) -> void { ...@@ -177,13 +177,6 @@ auto Entity::SetVersionId(const std::string &id) -> void {
this->wrapped->mutable_version()->set_id(id); this->wrapped->mutable_version()->set_id(id);
} }
// TODO(tf) Re-implement s.th. properties and parents are kept.
auto Entity::Switch(ProtoEntity *entity) -> void {
this->wrapped->Swap(entity);
this->wrapped->Clear();
this->wrapped = entity;
}
auto Entity::CopyTo(ProtoEntity *target) -> void { auto Entity::CopyTo(ProtoEntity *target) -> void {
target->CopyFrom(*(this->wrapped)); target->CopyFrom(*(this->wrapped));
} }
......
...@@ -36,7 +36,7 @@ set(test_cases ...@@ -36,7 +36,7 @@ set(test_cases
# special linting for tests # special linting for tests
set(_CMAKE_CXX_CLANG_TIDY_TEST_CHECKS set(_CMAKE_CXX_CLANG_TIDY_TEST_CHECKS
"${_CMAKE_CXX_CLANG_TIDY_CHECKS},-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-avoid-goto,-hicpp-avoid-goto" "${_CMAKE_CXX_CLANG_TIDY_CHECKS},-cert-err58-cpp,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-owning-memory,-modernize-use-trailing-return-type,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-avoid-goto,-hicpp-avoid-goto,-readability-function-cognitive-complexity"
) )
# add special cmake functions for gtest # add special cmake functions for gtest
......
...@@ -38,8 +38,7 @@ protected: ...@@ -38,8 +38,7 @@ protected:
void TearDown() override { ConfigurationManager::Clear(); } void TearDown() override { ConfigurationManager::Clear(); }
}; };
// TODO(tf) cogintive complexity > 25 (threshold) TEST_F(test_configuration, load_json) {
TEST_F(test_configuration, load_json) { // NOLINT
ConfigurationManager::LoadSingleJSONConfiguration(TEST_DATA_DIR + ConfigurationManager::LoadSingleJSONConfiguration(TEST_DATA_DIR +
"/test_caosdb_client.json"); "/test_caosdb_client.json");
EXPECT_THROW_MESSAGE( EXPECT_THROW_MESSAGE(
...@@ -53,9 +52,7 @@ TEST_F(test_configuration, load_json) { // NOLINT ...@@ -53,9 +52,7 @@ TEST_F(test_configuration, load_json) { // NOLINT
ConfigurationManager::Clear(); ConfigurationManager::Clear();
} }
// TODO(tf) cognitive complexity again TEST_F(test_configuration, get_default_connection_configuration_error) {
TEST_F(test_configuration, // NOLINT
get_default_connection_configuration_error) { // NOLINT
EXPECT_THROW_MESSAGE(ConfigurationManager::GetDefaultConnectionName(), EXPECT_THROW_MESSAGE(ConfigurationManager::GetDefaultConnectionName(),
ConfigurationError, ConfigurationError,
"This CaosDB client has not been configured."); "This CaosDB client has not been configured.");
......
...@@ -65,8 +65,7 @@ TEST_F(test_connection, configure_ssl_localhost_8080) { ...@@ -65,8 +65,7 @@ TEST_F(test_connection, configure_ssl_localhost_8080) {
EXPECT_TRUE(sslcc != nullptr); EXPECT_TRUE(sslcc != nullptr);
} }
// TODO(tf) cognitive complexity > 25 (threshold) TEST_F(test_connection, connection_manager_unknown_connection) {
TEST_F(test_connection, connection_manager_unknown_connection) { // NOLINT
EXPECT_THROW_MESSAGE(ConnectionManager::GetConnection("test"), EXPECT_THROW_MESSAGE(ConnectionManager::GetConnection("test"),
caosdb::exceptions::UnknownConnectionError, caosdb::exceptions::UnknownConnectionError,
"No connection named 'test' present."); "No connection named 'test' present.");
......
...@@ -78,8 +78,7 @@ TEST(test_entity, test_property_setters) { ...@@ -78,8 +78,7 @@ TEST(test_entity, test_property_setters) {
EXPECT_EQ(prop.GetDatatype(), "prop_dtype"); EXPECT_EQ(prop.GetDatatype(), "prop_dtype");
} }
// TODO(fspreck) cognitive complexity > 25 (threshold) TEST(test_entity, test_append_property) {
TEST(test_entity, test_append_property) { // NOLINT
auto entity = Entity(); auto entity = Entity();
auto prop = Property(); auto prop = Property();
...@@ -152,8 +151,7 @@ TEST(test_entity, test_insert_entity) { ...@@ -152,8 +151,7 @@ TEST(test_entity, test_insert_entity) {
EXPECT_EQ(entity.GetName(), "entity_name"); EXPECT_EQ(entity.GetName(), "entity_name");
} }
// TODO(fspreck) cognitive complexity > 25 (threshold) TEST(test_entity, test_insert_with_role) {
TEST(test_entity, test_insert_with_role) { // NOLINT
auto transaction = caosdb::transaction::Transaction( auto transaction = caosdb::transaction::Transaction(
std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr), std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr),
std::shared_ptr<transaction::FileTransmissionService::Stub>(nullptr)); std::shared_ptr<transaction::FileTransmissionService::Stub>(nullptr));
...@@ -200,8 +198,7 @@ TEST(test_entity, test_insert_with_parent) { ...@@ -200,8 +198,7 @@ TEST(test_entity, test_insert_with_parent) {
EXPECT_EQ(inserted_parent.GetName(), parent.GetName()); EXPECT_EQ(inserted_parent.GetName(), parent.GetName());
} }
// TODO(fspreck) cognitive complexity > 25 (threshold) TEST(test_entity, test_insert_with_property) {
TEST(test_entity, test_insert_with_property) { // NOLINT
auto transaction = caosdb::transaction::Transaction( auto transaction = caosdb::transaction::Transaction(
std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr), std::shared_ptr<transaction::EntityTransactionService::Stub>(nullptr),
std::shared_ptr<transaction::FileTransmissionService::Stub>(nullptr)); std::shared_ptr<transaction::FileTransmissionService::Stub>(nullptr));
...@@ -233,8 +230,7 @@ TEST(test_entity, test_insert_with_property) { // NOLINT ...@@ -233,8 +230,7 @@ TEST(test_entity, test_insert_with_property) { // NOLINT
EXPECT_EQ(prop.GetDatatype(), inserted_prop.GetDatatype()); EXPECT_EQ(prop.GetDatatype(), inserted_prop.GetDatatype());
} }
// TODO(tf) cognitive complexity > 25 (threshold) TEST(test_entity, test_from_id_response) {
TEST(test_entity, test_from_id_response) { // NOLINT
IdResponse idResponse; IdResponse idResponse;
idResponse.set_id("entity_id"); idResponse.set_id("entity_id");
auto *error = idResponse.add_entity_errors(); auto *error = idResponse.add_entity_errors();
......
...@@ -29,8 +29,7 @@ namespace caosdb { ...@@ -29,8 +29,7 @@ namespace caosdb {
using caosdb::entity::v1alpha1::Entity; using caosdb::entity::v1alpha1::Entity;
using caosdb::entity::v1alpha1::Message; using caosdb::entity::v1alpha1::Message;
// TODO(tf) cognitive complexity > 25 (threshold) TEST(test_protobuf, test_swap_trivial) {
TEST(test_protobuf, test_swap_trivial) { // NOLINT
Message message_source; Message message_source;
message_source.set_code(1234); message_source.set_code(1234);
message_source.set_description("desc"); message_source.set_description("desc");
...@@ -50,8 +49,7 @@ TEST(test_protobuf, test_swap_trivial) { // NOLINT ...@@ -50,8 +49,7 @@ TEST(test_protobuf, test_swap_trivial) { // NOLINT
EXPECT_EQ(message_destination.description(), "desc"); EXPECT_EQ(message_destination.description(), "desc");
} }
// TODO(tf) cognitive complexity again TEST(test_protobuf, test_swap_nested) {
TEST(test_protobuf, test_swap_nested) { // NOLINT
Entity entity_source; Entity entity_source;
entity_source.set_id("entity_id"); entity_source.set_id("entity_id");
auto *version_source = entity_source.mutable_version(); auto *version_source = entity_source.mutable_version();
......
...@@ -41,8 +41,7 @@ using caosdb::exceptions::ConnectionError; ...@@ -41,8 +41,7 @@ using caosdb::exceptions::ConnectionError;
using caosdb::transaction::UniqueResult; using caosdb::transaction::UniqueResult;
using ProtoEntity = caosdb::entity::v1alpha1::Entity; using ProtoEntity = caosdb::entity::v1alpha1::Entity;
// TODO(tf) cognitive complexity > 25 (threshold) TEST(test_transaction, create_transaction) {
TEST(test_transaction, create_transaction) { // NOLINT
const auto *host = "localhost"; const auto *host = "localhost";
auto configuration = InsecureConnectionConfiguration(host, 8000); auto configuration = InsecureConnectionConfiguration(host, 8000);
Connection connection(configuration); Connection connection(configuration);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment