diff options
author | Dmitri Pal <dpal@redhat.com> | 2009-09-04 20:28:06 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-09-09 09:12:53 -0400 |
commit | 191b97b118b0c357209166c3c374dec33560ed3a (patch) | |
tree | 18073a7b1d471c0cf752c1d89e4d41537cf5b1c0 /common/collection/collection_ut.c | |
parent | 717f368f86f160744e27a430d3b4ec2fd4c3bd64 (diff) | |
download | sssd-191b97b118b0c357209166c3c374dec33560ed3a.tar.gz sssd-191b97b118b0c357209166c3c374dec33560ed3a.tar.xz sssd-191b97b118b0c357209166c3c374dec33560ed3a.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 'common/collection/collection_ut.c')
-rw-r--r-- | common/collection/collection_ut.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/common/collection/collection_ut.c b/common/collection/collection_ut.c index 6d913f9a3..3666179c9 100644 --- a/common/collection/collection_ut.c +++ b/common/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) { |