Skip to content

Commit

Permalink
Remove duplicate name checking for complex elements,it should be done…
Browse files Browse the repository at this point in the history
… at build time

(cherry picked from commit bd931c0)
  • Loading branch information
xuzhenbao authored and PengZheng committed Dec 1, 2023
1 parent 9acb9f6 commit 7d8c78d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
7 changes: 0 additions & 7 deletions libs/dfi/gtest/src/dyn_type_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,6 @@ TEST_F(DynTypeTests, NrOfEntriesTest) {
dynType_destroy(type);
}

TEST_F(DynTypeTests, ComplexHasDuplicateName) {
dyn_type *type = NULL;
auto rc = dynType_parseWithStr(R"({II a a})", nullptr, nullptr, &type);
ASSERT_EQ(3, rc);
celix_err_printErrors(stderr, nullptr, nullptr);
}

TEST_F(DynTypeTests, ComplexHasEmptyName) {
dyn_type *type = NULL;
auto rc = dynType_parseWithStr(R"({II a })", nullptr, nullptr, &type);
Expand Down
8 changes: 0 additions & 8 deletions libs/dfi/src/dyn_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,6 @@ static int dynType_parseComplex(FILE *stream, dyn_type *type) {
if (status == OK) {
TAILQ_FOREACH(entry, &type->complex.entriesHead, entries) {
count +=1;
struct complex_type_entry *entry2 = NULL;
for(entry2 = entry->entries.tqe_next; entry2 != NULL; entry2 = entry2->entries.tqe_next) {
if (entry2->name != NULL && entry->name != NULL && strcmp(entry2->name, entry->name) == 0) {
status = PARSE_ERROR;
LOG_ERROR("Error duplicate name '%s'", entry->name);
break;
}
}
}
}

Expand Down

0 comments on commit 7d8c78d

Please sign in to comment.