summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/collection/collection_stack.c2
-rw-r--r--common/collection/collection_ut.c36
2 files changed, 36 insertions, 2 deletions
diff --git a/common/collection/collection_stack.c b/common/collection/collection_stack.c
index 347d9b6c..70211220 100644
--- a/common/collection/collection_stack.c
+++ b/common/collection/collection_stack.c
@@ -94,7 +94,7 @@ int push_binary_property(struct collection_item *stack,
return EINVAL;
}
- error = add_binary_property(stack, NULL, property, binary_data, length)
+ error = add_binary_property(stack, NULL, property, binary_data, length);
TRACE_FLOW_STRING("push_binary_property", "Exit.");
return error;
diff --git a/common/collection/collection_ut.c b/common/collection/collection_ut.c
index 15cebdbf..c1a4fcf8 100644
--- a/common/collection/collection_ut.c
+++ b/common/collection/collection_ut.c
@@ -874,6 +874,39 @@ int insert_extract_test()
return EOK;
}
+int delete_test()
+{
+
+ struct collection_item *col;
+ int error = EOK;
+
+ printf("\n\n==== DELETION TEST ====\n\n");
+
+ if ((error = create_collection(&col, "test", 0)) ||
+ (error = add_int_property(col, NULL, "tt", 1)) ||
+ (error = debug_collection(col, COL_TRAVERSE_DEFAULT)) ||
+ (error = add_int_property(col, NULL, "test", 1)) ||
+ (error = debug_collection(col, COL_TRAVERSE_DEFAULT)) ||
+ (error = delete_property(col, "test", COL_TYPE_ANY, COL_TRAVERSE_DEFAULT)) ||
+ (error = debug_collection(col, COL_TRAVERSE_DEFAULT)) ||
+ (error = add_int_property(col, NULL, "test", 1)) ||
+ (error = debug_collection(col, COL_TRAVERSE_DEFAULT)) ||
+ (error = delete_property(col, "test", COL_TYPE_ANY, COL_TRAVERSE_DEFAULT)) ||
+ (error = debug_collection(col, COL_TRAVERSE_DEFAULT)) ||
+ (error = add_int_property(col, NULL, "test", 1))) {
+ printf("Error in delete test %d\n", error);
+ destroy_collection(col);
+ return error;
+ }
+
+ debug_collection(col, COL_TRAVERSE_DEFAULT);
+
+ printf("\n\n==== DELETION TEST END ====\n\n");
+
+
+ destroy_collection(col);
+ return error;
+}
/* Main function of the unit test */
@@ -887,7 +920,8 @@ int main()
(error = add_collection_test()) ||
(error = mixed_collection_test()) ||
(error = iterator_test()) ||
- (error = insert_extract_test())) {
+ (error = insert_extract_test()) ||
+ (error = delete_test())) {
printf("Failed!\n");
}
else printf("Success!\n");