summaryrefslogtreecommitdiffstats
path: root/common/collection/collection_ut.c
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-10-25 13:21:24 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-12-10 17:20:26 -0500
commit18c06c0836306c194e5f89e37d2f3913b3bf01e4 (patch)
treec991c0a4fa484733c14822769f71f04d90492711 /common/collection/collection_ut.c
parent7faf7764c8b99bd51e952f24350dcdb05f9ab78e (diff)
downloadsssd-18c06c0836306c194e5f89e37d2f3913b3bf01e4.tar.gz
sssd-18c06c0836306c194e5f89e37d2f3913b3bf01e4.tar.xz
sssd-18c06c0836306c194e5f89e37d2f3913b3bf01e4.zip
COLLECTION Create reference to the top level collection
This patch adds ability to create a reference to the top level collection. Previously one could get reference only to collection inside other collection. With this change it becomes possible to have two pointers to the same top level collection from multiple places. COLLECTION Adding comment. COLLECTION: Some tracing
Diffstat (limited to 'common/collection/collection_ut.c')
-rw-r--r--common/collection/collection_ut.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/common/collection/collection_ut.c b/common/collection/collection_ut.c
index 1e91c2326..86620550d 100644
--- a/common/collection/collection_ut.c
+++ b/common/collection/collection_ut.c
@@ -33,6 +33,7 @@ int ref_collection_test(void)
{
struct collection_item *peer = NULL;
struct collection_item *socket = NULL;
+ struct collection_item *socket2 = NULL;
char binary_dump[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
int error = EOK;
@@ -98,7 +99,19 @@ int ref_collection_test(void)
col_destroy_collection(peer);
col_debug_collection(socket, COL_TRAVERSE_DEFAULT);
+
+ error = col_get_collection_reference(socket, &socket2, NULL);
+ if (error) {
+ col_destroy_collection(socket);
+ printf("Failed to extract collection. Error %d\n", error);
+ return error;
+ }
+
+ col_debug_collection(socket2, COL_TRAVERSE_DEFAULT);
col_destroy_collection(socket);
+ col_debug_collection(socket2, COL_TRAVERSE_DEFAULT);
+ col_destroy_collection(socket2);
+
TRACE_FLOW_NUMBER("ref_collection_test. Returning", error);
printf("\n\nEND OF REF TEST!!!.\n\n\n");