summaryrefslogtreecommitdiffstats
path: root/collection/collection_ut.c
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-09-04 20:28:06 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-09-09 09:12:53 -0400
commit9701da59c11be7152ecca5171d676e075539fc22 (patch)
treef1a857a04561c5add2fe3bb2d7302a1b0c1f58b8 /collection/collection_ut.c
parent2e29828454a8566d4b0fd6ebc82746d576bfecfe (diff)
downloadding-libs2-9701da59c11be7152ecca5171d676e075539fc22.tar.gz
ding-libs2-9701da59c11be7152ecca5171d676e075539fc22.tar.xz
ding-libs2-9701da59c11be7152ecca5171d676e075539fc22.zip
COLLECTION Copy collection flat with concatenated names
This patch addresses several issues: a) Adds capability to add or copy the collections in flattened mode but construct names of attributes in dotted notation. For example when you append collection "sub" with items "foo" and "bar" previously you could add them as "foo" and "bar" not you can flatten them and the names will be "sub.foo" and "sub.bar" this allows better processing of the attributes in the elapi message. b) Removes old implemntation of the copy collection function. c) Removes the col_set_timestamp, this functionality has been moved to ELAPI long ago. d) Updates collection unit test. e) Updates elapi to use new functionality f) Updates elapi unit test Have run under valgrind with no problems.
Diffstat (limited to 'collection/collection_ut.c')
-rw-r--r--collection/collection_ut.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/collection/collection_ut.c b/collection/collection_ut.c
index 6d913f9..3666179 100644
--- a/collection/collection_ut.c
+++ b/collection/collection_ut.c
@@ -283,7 +283,7 @@ int mixed_collection_test(void)
col_debug_collection(socket1, COL_TRAVERSE_DEFAULT);
printf("Creating a copy of SOCKET1 collection named SOCKET2.\n");
- error = col_copy_collection(&socket2, socket1, "socket2");
+ error = col_copy_collection(&socket2, socket1, "socket2", COL_COPY_NORMAL);
if (error) {
col_destroy_collection(peer);
col_destroy_collection(host);
@@ -640,7 +640,7 @@ int iterator_test(void)
return error;
}
- error = col_add_collection_to_collection(peer, NULL, "forth", socket1, COL_ADD_MODE_EMBED);
+ error = col_add_collection_to_collection(peer, NULL, "forth", socket1, COL_ADD_MODE_FLATDOT);
if (error) {
col_destroy_collection(peer);
col_destroy_collection(socket1);
@@ -648,6 +648,16 @@ int iterator_test(void)
return error;
}
+ error = col_add_collection_to_collection(peer, NULL, NULL, socket1, COL_ADD_MODE_FLATDOT);
+ if (error) {
+ col_destroy_collection(peer);
+ col_destroy_collection(socket1);
+ printf("Failed to add collection to collection. Error %d\n", error);
+ return error;
+ }
+
+ col_destroy_collection(socket1);
+
/* Bind iterator */
error = col_bind_iterator(&iterator, peer, COL_TRAVERSE_DEFAULT);
if (error) {