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:18 -0500
commitd99755b28d67140d148b01d5192d33136fa5cac5 (patch)
treec50772be7cef2d5b85a91cbc2251d90bd2e7f0bc /common/collection/collection_ut.c
parent589c51929a46ea2136c12b6115f6723702cce3a7 (diff)
downloadsssd-d99755b28d67140d148b01d5192d33136fa5cac5.tar.gz
sssd-d99755b28d67140d148b01d5192d33136fa5cac5.tar.xz
sssd-d99755b28d67140d148b01d5192d33136fa5cac5.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");