|
From: Konrad R. <kon...@us...> - 2005-05-17 17:20:42
|
Update of /cvsroot/sblim/indication_helper/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4581/test Modified Files: Test_addProperty.c Test_all_functions.c Test_genIndication.c Test_genIndication_fail.c Test_reg_pollfnc.c Test_reg_pollfnc2.c Test_reg_pollfnc3.c Test_reg_pollfnc3_threaded.c Log Message: BUG#: 1199129 ( Providers won't compile with CMPI 1.0) Porting ind_helper library to CMPI 1.00 spec. Changing spelling of BEHAVIOUR to BEHAVIOR Index: Test_reg_pollfnc2.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc2.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_reg_pollfnc2.c 19 Apr 2005 16:04:24 -0000 1.2 +++ Test_reg_pollfnc2.c 17 May 2005 17:20:31 -0000 1.3 @@ -21,15 +21,19 @@ #include <unistd.h> #include <stdlib.h> +#ifdef CMPI_VER_100 +#define CONST const +#else +#define CONST +#endif int test1_values = 0; int debug = 0; CMPIStatus good = {CMPI_RC_OK, NULL}; CMPIContext context; - -CMPIContext* _fake_prepareAttachThread(CMPIBroker* b, CMPIContext* ctx); -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c); -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx); +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* b, CONST CMPIContext* ctx); +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c); +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx); IndErrorT test1(CMPIData *v); IndErrorT test2(CMPIData *v); @@ -51,17 +55,17 @@ fprintf(stderr,"test2 called\n"); return IND_OK; } -CMPIContext* _fake_prepareAttachThread(CMPIBroker* b, CMPIContext* ctx) +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* b, CONST CMPIContext* ctx) { return &context; } -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c) +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c) { return good; } -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx) +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx) { return good;; } @@ -87,9 +91,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register the test function */ - assert ( ind_reg_pollfnc("test1", "A", test1, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test1", "B", test2, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test2, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 1,IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "B", test2, 1,IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test2, 1,IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); assert ( test1_values == 1 ); Index: Test_reg_pollfnc.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_reg_pollfnc.c 19 Apr 2005 16:04:23 -0000 1.2 +++ Test_reg_pollfnc.c 17 May 2005 17:20:31 -0000 1.3 @@ -22,6 +22,12 @@ #include <stdlib.h> #include <unistd.h> +#ifdef CMPI_VER_100 +#define CONST const +#else +#define CONST +#endif + static CMPIBroker b; static CMPIContext ctx; static int debug = 0; @@ -42,13 +48,14 @@ IndErrorT test_char(CMPIData *v); IndErrorT test_string(CMPIData *v); -char * _fake_getCharPtrString (CMPIString* st, CMPIStatus* rc); + +char * _fake_getCharPtrString (CONST CMPIString* st, CMPIStatus* rc); CMPIStatus _fake_releaseString (CMPIString* st) ; -CMPIString* _fake_cloneString(CMPIString* st, CMPIStatus* rc); -CMPIString* _fake_newString (CMPIBroker* mb, const char *data, CMPIStatus* rc); -CMPIContext* _fake_prepareAttachThread(CMPIBroker* mb, CMPIContext* ctx); -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c); -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx); +CMPIString* _fake_cloneString(CONST CMPIString* st, CMPIStatus* rc); +CMPIString* _fake_newString (CONST CMPIBroker* mb, const char *data, CMPIStatus* rc); +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* mb, CONST CMPIContext* ctx); +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c); +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx); /* Test routines */ IndErrorT test_uint16(CMPIData *v) @@ -184,7 +191,7 @@ /* Fake CMPI functions. They were written so we don't have to depend on a CMPI broker and can use our own. */ -char * _fake_getCharPtrString (CMPIString* st, CMPIStatus* rc) +char * _fake_getCharPtrString (CONST CMPIString* st, CMPIStatus* rc) { if (debug) fprintf(stderr,"_fake_getCharPtrString: %p\n", st); @@ -207,7 +214,7 @@ return status; } -CMPIString* _fake_cloneString(CMPIString* st, CMPIStatus* rc) +CMPIString* _fake_cloneString(CONST CMPIString* st, CMPIStatus* rc) { CMPIString *s = (CMPIString *)malloc( sizeof(CMPIString)); @@ -231,7 +238,7 @@ -CMPIString* _fake_newString (CMPIBroker* mb, const char *data, CMPIStatus* rc) +CMPIString* _fake_newString (CONST CMPIBroker* mb, const char *data, CMPIStatus* rc) { CMPIString *s = (CMPIString *)malloc(sizeof(CMPIString)); @@ -252,21 +259,21 @@ CMPIContext context; CMPIStatus good = {CMPI_RC_OK, NULL}; -CMPIContext* _fake_prepareAttachThread(CMPIBroker* mb, CMPIContext* ctx) +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* mb, CONST CMPIContext* ctx) { if (debug) fprintf(stderr,"_fake_prepareAttachThread called.\n"); return &context; } -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c) +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c) { if (debug) fprintf(stderr,"_fake_attachThread called.\n"); return good; } -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx) +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx) { if (debug) fprintf(stderr,"_fake_detachThread called.\n"); @@ -305,27 +312,27 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc("test4", "uint16", test_uint16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4", "uint16", test_uint16, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4", "char", test_char, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4", "char", test_char, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"string", test_string, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"string", test_string, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint64", test_uint64, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint32", test_uint32, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint8", test_uint8, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint64", test_sint64, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint32", test_sint32, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint16", test_sint16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint8", test_sint8, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"uint64", test_uint64, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"uint32", test_uint32, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"uint8", test_uint8, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint64", test_sint64, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint32", test_sint32, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint16", test_sint16, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"sint8", test_sint8, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"real32", test_real32, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"real64", test_real64, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"real32", test_real32, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"real64", test_real64, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"boolean", test_boolean, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"char16", test_char16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"boolean", test_boolean, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"char16", test_char16, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"ptr", test_ptr, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"ptr", test_ptr, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); assert ( ind_start() == IND_OK); Index: Test_addProperty.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_addProperty.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_addProperty.c 19 Apr 2005 16:04:16 -0000 1.2 +++ Test_addProperty.c 17 May 2005 17:20:31 -0000 1.3 @@ -51,8 +51,8 @@ debug =1; /* Register functions with data types */ - assert ( ind_reg_pollfnc("test5", "test_BAD", test_BAD, 10, IND_BEHAVIOUR_LEVEL_EDGE) == -100); - assert ( ind_reg_pollfnc("test5", "test_BAD2", test_BAD2, 10, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test5", "test_BAD", test_BAD, 10, IND_BEHAVIOR_LEVEL_EDGE) == -100); + assert ( ind_reg_pollfnc("test5", "test_BAD2", test_BAD2, 10, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); assert ( ind_shutdown() == IND_OK); Index: Test_all_functions.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_all_functions.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_all_functions.c 19 Apr 2005 16:04:23 -0000 1.2 +++ Test_all_functions.c 17 May 2005 17:20:31 -0000 1.3 @@ -37,8 +37,8 @@ assert ( IND_OK == ind_shutdown()); /* Monitored */ - assert ( IND_INVALID_ARGS == ind_reg_pollfnc("","",NULL, 0,IND_BEHAVIOUR_LEVEL_EDGE )); - assert ( IND_INVALID_ARGS == ind_reg_pollfnc_ns("","","",NULL, 0, IND_BEHAVIOUR_AGAINST_ZERO)); + assert ( IND_INVALID_ARGS == ind_reg_pollfnc("","",NULL, 0,IND_BEHAVIOR_LEVEL_EDGE )); + assert ( IND_INVALID_ARGS == ind_reg_pollfnc_ns("","","",NULL, 0, IND_BEHAVIOR_AGAINST_ZERO)); assert ( IND_INVALID_ARGS == ind_unreg_pollfnc("","")); assert ( IND_INVALID_ARGS == ind_unreg_pollfnc_ns("","","")); Index: Test_reg_pollfnc3_threaded.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc3_threaded.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_reg_pollfnc3_threaded.c 19 Apr 2005 16:04:24 -0000 1.2 +++ Test_reg_pollfnc3_threaded.c 17 May 2005 17:20:31 -0000 1.3 @@ -56,7 +56,7 @@ { snprintf(pn, 100,"A%d", i); - if (ind_reg_pollfnc("test1", pn, test1, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_MUTEX) { + if (ind_reg_pollfnc("test1", pn, test1, 1,IND_BEHAVIOR_LEVEL_EDGE) == IND_MUTEX) { rc = IND_MUTEX; return NULL; } Index: Test_genIndication_fail.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_genIndication_fail.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_genIndication_fail.c 19 Apr 2005 16:04:23 -0000 1.2 +++ Test_genIndication_fail.c 17 May 2005 17:20:31 -0000 1.3 @@ -21,31 +21,38 @@ #include <stdlib.h> #include <unistd.h> #include <string.h> + +#ifdef CMPI_VER_100 +#define CONST const +#else +#define CONST +#endif + IndErrorT test_uint16(CMPIData *v); IndErrorT test_string(CMPIData *v); IndErrorT get_value(CMPIData *v); -CMPIContext* _fake_prepareAttachThread(CMPIBroker* b, CMPIContext* ctx);; -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c);; -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx);; -CMPIContext* _fake_prepareAttachThread(CMPIBroker* b, CMPIContext* ctx); -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c); -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx); -char * _fake_getCharPtrString (CMPIString* st, CMPIStatus* rc); +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* b, CONST CMPIContext* ctx);; +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c);; +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx);; +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* b, CONST CMPIContext* ctx); +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c); +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx); +char * _fake_getCharPtrString (CONST CMPIString* st, CMPIStatus* rc); CMPIStatus _fake_releaseString (CMPIString* st) ; -CMPIString* _fake_cloneString(CMPIString* st, CMPIStatus* rc); -CMPIString* _fake_newString (CMPIBroker* mb, const char *data, CMPIStatus* rc); +CMPIString* _fake_cloneString(CONST CMPIString* st, CMPIStatus* rc); +CMPIString* _fake_newString (CONST CMPIBroker* mb, const char *data, CMPIStatus* rc); CMPIStatus _fake_release_ObjectPath (CMPIObjectPath* op); -CMPIObjectPath* _fake_clone_ObjectPath (CMPIObjectPath* op, CMPIStatus* rc); -CMPIObjectPath* _fake_newObjectPath (CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc); +CMPIObjectPath* _fake_clone_ObjectPath (CONST CMPIObjectPath* op, CMPIStatus* rc); +CMPIObjectPath* _fake_newObjectPath (CONST CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc); CMPIStatus _fake_release_Instance (CMPIInstance* inst); -CMPIStatus _fake_setProperty_Instance (CMPIInstance* inst, const char *name, CMPIValue* value, CMPIType type); +CMPIStatus _fake_setProperty_Instance (CONST CMPIInstance* inst, const char *name, CONST CMPIValue* value, CMPIType type); -CMPIInstance* _fake_clone_Instance (CMPIInstance* inst, CMPIStatus* rc); -CMPIInstance* _fake_newInstance (CMPIBroker* mb,CMPIObjectPath* op,CMPIStatus* rc); -CMPIStatus _fake_deliverIndication (CMPIBroker* mb, CMPIContext* ctx, const char *ns, CMPIInstance* ind); -CMPIContext* _fake_prepareAttachThread(CMPIBroker* mb, CMPIContext* ctx); -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c); -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx); +CMPIInstance* _fake_clone_Instance (CONST CMPIInstance* inst, CMPIStatus* rc); +CMPIInstance* _fake_newInstance (CONST CMPIBroker* mb,CONST CMPIObjectPath* op,CMPIStatus* rc); +CMPIStatus _fake_deliverIndication (CONST CMPIBroker* mb, CONST CMPIContext* ctx, const char *ns, CONST CMPIInstance* ind); +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* mb, CONST CMPIContext* ctx); +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c); +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx); static CMPIBroker b; @@ -116,7 +123,7 @@ CMPIStatus bad = {CMPI_RC_ERROR, NULL}; /* Fake CMPIString handlers */ -char * _fake_getCharPtrString (CMPIString* st, CMPIStatus* rc) +char * _fake_getCharPtrString (CONST CMPIString* st, CMPIStatus* rc) { /* if (debug) @@ -139,7 +146,7 @@ return good; } -CMPIString* _fake_cloneString(CMPIString* st, CMPIStatus* rc) +CMPIString* _fake_cloneString(CONST CMPIString* st, CMPIStatus* rc) { CMPIString *s = (CMPIString *)malloc( sizeof(CMPIString)); @@ -163,7 +170,7 @@ return s; } -CMPIString* _fake_newString (CMPIBroker* mb, const char *data, CMPIStatus* rc) +CMPIString* _fake_newString (CONST CMPIBroker* mb, const char *data, CMPIStatus* rc) { CMPIString *s = (CMPIString *)malloc(sizeof(CMPIString)); @@ -210,7 +217,7 @@ return good; } -CMPIObjectPath* _fake_clone_ObjectPath (CMPIObjectPath* op, CMPIStatus* rc) +CMPIObjectPath* _fake_clone_ObjectPath (CONST CMPIObjectPath* op, CMPIStatus* rc) { CMPIObjectPath *objpath; _objPath *objPathData, *old; @@ -237,7 +244,7 @@ return objpath; } -CMPIObjectPath* _fake_newObjectPath (CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc) +CMPIObjectPath* _fake_newObjectPath (CONST CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc) { CMPIObjectPath *objpath; _objPath *objPathData; @@ -325,7 +332,7 @@ free(inst); return good; } -CMPIStatus _fake_setProperty_Instance (CMPIInstance* inst, const char *name, CMPIValue* value, CMPIType type) +CMPIStatus _fake_setProperty_Instance (CONST CMPIInstance* inst, const char *name, CONST CMPIValue* value, CMPIType type) { /* No checking to see if the value exist */ _instance *last,*p; @@ -369,7 +376,7 @@ return good; } -CMPIInstance* _fake_clone_Instance (CMPIInstance* inst, CMPIStatus* rc) +CMPIInstance* _fake_clone_Instance (CONST CMPIInstance* inst, CMPIStatus* rc) { CMPIInstance *instance; _instance *_inst, *_old, *p, *q; @@ -424,7 +431,7 @@ } -CMPIInstance* _fake_newInstance (CMPIBroker* mb,CMPIObjectPath* op,CMPIStatus* rc) +CMPIInstance* _fake_newInstance (CONST CMPIBroker* mb,CONST CMPIObjectPath* op,CMPIStatus* rc) { CMPIInstance *inst; _instance *instance; @@ -454,7 +461,7 @@ /* Fake deliver indication */ -CMPIStatus _fake_deliverIndication (CMPIBroker* mb, CMPIContext* ctx, const char *ns, CMPIInstance* ind) +CMPIStatus _fake_deliverIndication (CONST CMPIBroker* mb, CONST CMPIContext* ctx, const char *ns, CONST CMPIInstance* ind) { _instance *inst, *p; CMPIObjectPath *objPath; @@ -484,21 +491,21 @@ } -CMPIContext* _fake_prepareAttachThread(CMPIBroker* mb, CMPIContext* ctx) +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* mb, CONST CMPIContext* ctx) { if (debug) fprintf(stderr,"_fake_prepareAttachThread called.\n"); return &context; } -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c) +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c) { if (debug) fprintf(stderr,"_fake_attachThread called.\n"); return good; } -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx) +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx) { if (debug) fprintf(stderr,"_fake_detachThread called.\n"); @@ -541,9 +548,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "uint16", test_uint16, 1,IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "uint16", test_uint16, 1,IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "string", test_string, 1,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "string", test_string, 1,IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); /* Register a property for the test9 class */ Index: Test_reg_pollfnc3.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc3.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_reg_pollfnc3.c 19 Apr 2005 16:04:24 -0000 1.2 +++ Test_reg_pollfnc3.c 17 May 2005 17:20:31 -0000 1.3 @@ -42,15 +42,15 @@ for (loops =0; loops < 5; loops++) { /* Register */ - assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test1", "A", NULL, 10,IND_BEHAVIOUR_LEVEL_EDGE) == IND_DUPLICATE); + assert ( ind_reg_pollfnc("test1", "A", NULL, 10,IND_BEHAVIOR_LEVEL_EDGE) == IND_DUPLICATE); - assert ( ind_reg_pollfnc("test1" ,"B", test1, 20,IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc("test1" ,"B", test1, 20,IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test1, 30,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test1, 30,IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test2", "D", test2, 2,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc("test2", "D", test2, 2,IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); /* Modify the function */ @@ -87,13 +87,13 @@ } - assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1" ,"B", test1, 20, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc("test1" ,"B", test1, 20, IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test1, 30, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test1, 30, IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test2", "D", test2, 2, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc("test2", "D", test2, 2, IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); /* They should be deleted in order of : D A B C */ assert ( ind_shutdown() == IND_OK); printf("+++ %s succedeed\n",__FILE__); Index: Test_genIndication.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_genIndication.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Test_genIndication.c 19 Apr 2005 16:04:23 -0000 1.3 +++ Test_genIndication.c 17 May 2005 17:20:31 -0000 1.4 @@ -22,6 +22,12 @@ #include <unistd.h> #include <string.h> +#ifdef CMPI_VER_100 +#define CONST const +#else +#define CONST +#endif + static CMPIBroker b; static CMPIContext ctx; static int debug = 0; @@ -33,28 +39,28 @@ IndErrorT test_string(CMPIData *v); IndErrorT get_value(CMPIData *v); IndErrorT get_value_string(CMPIData *v); -char * _fake_getCharPtrString (CMPIString* st, CMPIStatus* rc); +char * _fake_getCharPtrString (CONST CMPIString* st, CMPIStatus* rc); CMPIStatus _fake_releaseString (CMPIString* st) ; -CMPIString* _fake_cloneString(CMPIString* st, CMPIStatus* rc); -CMPIString* _fake_newString (CMPIBroker* mb, const char *data, CMPIStatus* rc); +CMPIString* _fake_cloneString(CONST CMPIString* st, CMPIStatus* rc); +CMPIString* _fake_newString (CONST CMPIBroker* mb, const char *data, CMPIStatus* rc); CMPIStatus _fake_release_ObjectPath (CMPIObjectPath* op); -CMPIObjectPath* _fake_clone_ObjectPath (CMPIObjectPath* op, CMPIStatus* rc); -CMPIObjectPath* _fake_newObjectPath (CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc); +CMPIObjectPath* _fake_clone_ObjectPath (CONST CMPIObjectPath* op, CMPIStatus* rc); +CMPIObjectPath* _fake_newObjectPath (CONST CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc); CMPIStatus _fake_release_Instance (CMPIInstance* inst); -CMPIStatus _fake_setProperty_Instance (CMPIInstance* inst, const char *name, CMPIValue* value, CMPIType type); +CMPIStatus _fake_setProperty_Instance (CONST CMPIInstance* inst, const char *name, CONST CMPIValue* value, CMPIType type); -CMPIInstance* _fake_clone_Instance (CMPIInstance* inst, CMPIStatus* rc); -CMPIInstance* _fake_newInstance (CMPIBroker* mb,CMPIObjectPath* op,CMPIStatus* rc); +CMPIInstance* _fake_clone_Instance (CONST CMPIInstance* inst, CMPIStatus* rc); +CMPIInstance* _fake_newInstance (CONST CMPIBroker* mb,CONST CMPIObjectPath* op,CMPIStatus* rc); CMPIStatus _fake_release_Select (CMPISelectExp* se); -CMPIString* _fake_getString_Select(CMPISelectExp* se, CMPIStatus* rc); -CMPIBoolean _fake_evaluate_Select(CMPISelectExp* se, CMPIInstance* inst_s, CMPIStatus* rc); -CMPISelectExp* _fake_clone_Select(CMPISelectExp* se, CMPIStatus* rc); -CMPISelectExp* _fake_newSelectExp(CMPIBroker* mb, const char *query, const char *lang,CMPIArray** projection, CMPIStatus* st); -CMPIStatus _fake_deliverIndication (CMPIBroker* mb, CMPIContext* ctx, const char *ns, CMPIInstance* ind); -CMPIContext* _fake_prepareAttachThread(CMPIBroker* mb, CMPIContext* ctx); -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c); -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx); -CMPIString* _fake_toString (CMPIBroker* mb, void* object, CMPIStatus* rc); +CMPIString* _fake_getString_Select(CONST CMPISelectExp* se, CMPIStatus* rc); +CMPIBoolean _fake_evaluate_Select(CONST CMPISelectExp* se, CONST CMPIInstance* inst_s, CMPIStatus* rc); +CMPISelectExp* _fake_clone_Select(CONST CMPISelectExp* se, CMPIStatus* rc); +CMPISelectExp* _fake_newSelectExp(CONST CMPIBroker* mb, const char *query, const char *lang,CMPIArray** projection, CMPIStatus* st); +CMPIStatus _fake_deliverIndication (CONST CMPIBroker* mb, CONST CMPIContext* ctx, const char *ns, CONST CMPIInstance* ind); +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* mb, CONST CMPIContext* ctx); +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c); +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx); +CMPIString* _fake_toString (CONST CMPIBroker* mb, CONST void* object, CMPIStatus* rc); /* Test routines. Everytime they are called, the @@ -151,7 +157,7 @@ CMPIStatus bad = {CMPI_RC_ERROR, NULL}; /* Fake CMPIString handlers */ -char * _fake_getCharPtrString (CMPIString* st, CMPIStatus* rc) +char * _fake_getCharPtrString (CONST CMPIString* st, CMPIStatus* rc) { /* if (debug) @@ -174,7 +180,7 @@ return good; } -CMPIString* _fake_cloneString(CMPIString* st, CMPIStatus* rc) +CMPIString* _fake_cloneString(CONST CMPIString* st, CMPIStatus* rc) { CMPIString *s = (CMPIString *)malloc( sizeof(CMPIString)); @@ -198,7 +204,7 @@ return s; } -CMPIString* _fake_newString (CMPIBroker* mb, const char *data, CMPIStatus* rc) +CMPIString* _fake_newString (CONST CMPIBroker* mb, const char *data, CMPIStatus* rc) { CMPIString *s = (CMPIString *)malloc(sizeof(CMPIString)); @@ -245,7 +251,7 @@ return good; } -CMPIObjectPath* _fake_clone_ObjectPath (CMPIObjectPath* op, CMPIStatus* rc) +CMPIObjectPath* _fake_clone_ObjectPath (CONST CMPIObjectPath* op, CMPIStatus* rc) { CMPIObjectPath *objpath; _objPath *objPathData, *old; @@ -272,7 +278,7 @@ return objpath; } -CMPIObjectPath* _fake_newObjectPath (CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc) +CMPIObjectPath* _fake_newObjectPath (CONST CMPIBroker* mb, const char *ns, const char *cn, CMPIStatus* rc) { CMPIObjectPath *objpath; _objPath *objPathData; @@ -360,7 +366,7 @@ free(inst); return good; } -CMPIStatus _fake_setProperty_Instance (CMPIInstance* inst, const char *name, CMPIValue* value, CMPIType type) +CMPIStatus _fake_setProperty_Instance (CONST CMPIInstance* inst, const char *name, CONST CMPIValue* value, CMPIType type) { /* No checking to see if the value exist */ _instance *last,*p; @@ -404,7 +410,7 @@ return good; } -CMPIInstance* _fake_clone_Instance (CMPIInstance* inst, CMPIStatus* rc) +CMPIInstance* _fake_clone_Instance (CONST CMPIInstance* inst, CMPIStatus* rc) { CMPIInstance *instance; _instance *_inst, *_old, *p, *q; @@ -459,7 +465,7 @@ } -CMPIInstance* _fake_newInstance (CMPIBroker* mb,CMPIObjectPath* op,CMPIStatus* rc) +CMPIInstance* _fake_newInstance (CONST CMPIBroker* mb,CONST CMPIObjectPath* op,CMPIStatus* rc) { CMPIInstance *inst; _instance *instance; @@ -499,7 +505,7 @@ } -CMPIString* _fake_getString_Select(CMPISelectExp* se, CMPIStatus* rc) +CMPIString* _fake_getString_Select(CONST CMPISelectExp* se, CMPIStatus* rc) { CMPIString *s; @@ -508,7 +514,7 @@ return s; } -CMPIBoolean _fake_evaluate_Select(CMPISelectExp* se, CMPIInstance* inst_s, CMPIStatus* rc) +CMPIBoolean _fake_evaluate_Select(CONST CMPISelectExp* se, CONST CMPIInstance* inst_s, CMPIStatus* rc) { _instance *inst; CMPIObjectPath *objPath; @@ -537,7 +543,7 @@ } -CMPISelectExp* _fake_clone_Select(CMPISelectExp* se, CMPIStatus* rc) +CMPISelectExp* _fake_clone_Select(CONST CMPISelectExp* se, CMPIStatus* rc) { CMPISelectExp *filter; @@ -559,7 +565,7 @@ } -CMPISelectExp* _fake_newSelectExp(CMPIBroker* mb, const char *query, const char *lang,CMPIArray** projection, CMPIStatus* st) +CMPISelectExp* _fake_newSelectExp(CONST CMPIBroker* mb, const char *query, const char *lang,CMPIArray** projection, CMPIStatus* st) { CMPISelectExp *filter; @@ -583,7 +589,7 @@ /* Fake deliver indication */ -CMPIStatus _fake_deliverIndication (CMPIBroker* mb, CMPIContext* ctx, const char *ns, CMPIInstance* ind) +CMPIStatus _fake_deliverIndication (CONST CMPIBroker* mb, CONST CMPIContext* ctx, const char *ns, CONST CMPIInstance* ind) { _instance *inst, *p; CMPIObjectPath *objPath; @@ -613,28 +619,28 @@ } -CMPIContext* _fake_prepareAttachThread(CMPIBroker* mb, CMPIContext* ctx) +CMPIContext* _fake_prepareAttachThread(CONST CMPIBroker* mb, CONST CMPIContext* ctx) { if (debug) fprintf(stderr,"_fake_prepareAttachThread called.\n"); return &context; } -CMPIStatus _fake_attachThread (CMPIBroker*b, CMPIContext*c) +CMPIStatus _fake_attachThread (CONST CMPIBroker*b, CONST CMPIContext*c) { if (debug) fprintf(stderr,"_fake_attachThread called.\n"); return good; } -CMPIStatus _fake_detachThread (CMPIBroker* mb, CMPIContext* ctx) +CMPIStatus _fake_detachThread (CONST CMPIBroker* mb, CONST CMPIContext* ctx) { if (debug) fprintf(stderr,"_fake_detachThread called.\n"); return good; } -CMPIString* _fake_toString (CMPIBroker* mb, void* object, CMPIStatus* rc) +CMPIString* _fake_toString (CONST CMPIBroker* mb, CONST void* object, CMPIStatus* rc) { CMPIString *val = mb->eft->newString(mb, "Unknown", rc); return val; @@ -678,9 +684,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "string", test_string, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "string", test_string, 1, IND_BEHAVIOR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "uint16", test_uint16, 1, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "uint16", test_uint16, 1, IND_BEHAVIOR_AGAINST_ZERO) == IND_OK); /* Register a property for the test8 class */ |