summaryrefslogtreecommitdiffstats
path: root/common/elapi/elapi_test/elapi_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
commit191b97b118b0c357209166c3c374dec33560ed3a (patch)
tree18073a7b1d471c0cf752c1d89e4d41537cf5b1c0 /common/elapi/elapi_test/elapi_ut.c
parent717f368f86f160744e27a430d3b4ec2fd4c3bd64 (diff)
downloadsssd-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/elapi/elapi_test/elapi_ut.c')
-rw-r--r--common/elapi/elapi_test/elapi_ut.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/common/elapi/elapi_test/elapi_ut.c b/common/elapi/elapi_test/elapi_ut.c
index 2cb94bf7b..4be031e8f 100644
--- a/common/elapi/elapi_test/elapi_ut.c
+++ b/common/elapi/elapi_test/elapi_ut.c
@@ -262,6 +262,32 @@ int complex_event_test(void)
col_destroy_collection(col);
+ if ((error = col_create_collection(&col, "flat", 0)) ||
+ /* We are forsing overwrite with different type */
+ (error = col_add_int_property(col, NULL, "zzz", 1)) ||
+ (error = col_add_long_property(col, NULL, "zzz2", 100000000L))) {
+ elapi_destroy_event_template(template);
+ printf("Failed to add property. Error %d\n", error);
+ elapi_destroy_event(event);
+ return error;
+ }
+
+ error = elapi_modify_event(
+ event,
+ col,
+ COL_ADD_MODE_FLATDOT,
+ E_EOARG);
+
+ if (error) {
+ printf("Failed to set create template %d\n", error);
+ elapi_destroy_event(event);
+ elapi_destroy_event_template(template);
+ col_destroy_collection(col);
+ return error;
+ }
+
+ col_destroy_collection(col);
+
error = elapi_copy_event(&event_copy, event);
if (error) {
printf("Failed to set create template %d\n", error);