From: Konrad R. <kon...@us...> - 2005-04-19 16:04:36
|
Update of /cvsroot/sblim/indication_helper/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5765/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: [ 1183083] CMPI-BASE: Indication Provider delivers only first occurence Added a new flag to ind_reg_pollfnc so that the developer can determine what behaviour he/she wants. Index: Test_reg_pollfnc2.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc2.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc2.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc2.c 19 Apr 2005 16:04:24 -0000 1.2 @@ -87,9 +87,9 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register the test function */ - assert ( ind_reg_pollfnc("test1", "A", test1, 1) == IND_OK); - assert ( ind_reg_pollfnc("test1", "B", test2, 1) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test2, 1) == IND_OK); + 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 ( test1_values == 1 ); Index: Test_reg_pollfnc.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_reg_pollfnc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc.c 19 Apr 2005 16:04:23 -0000 1.2 @@ -305,27 +305,27 @@ assert ( ind_reg(&b, &ctx) == IND_OK); /* Register functions with data types */ - assert ( ind_reg_pollfnc("test4", "uint16", test_uint16, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4", "uint16", test_uint16, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4", "char", test_char, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4", "char", test_char, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"string", test_string, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"string", test_string, 1, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint64", test_uint64, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint32", test_uint32, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"uint8", test_uint8, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint64", test_sint64, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint32", test_sint32, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint16", test_sint16, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"sint8", test_sint8, 1) == 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" ,"real32", test_real32, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"real64", test_real64, 1) == 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" ,"boolean", test_boolean, 1) == IND_OK); - assert ( ind_reg_pollfnc("test4" ,"char16", test_char16, 1) == 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" ,"ptr", test_ptr, 1) == IND_OK); + assert ( ind_reg_pollfnc("test4" ,"ptr", test_ptr, 1, IND_BEHAVIOUR_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.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_addProperty.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_addProperty.c 19 Apr 2005 16:04:16 -0000 1.2 @@ -51,8 +51,8 @@ debug =1; /* Register functions with data types */ - assert ( ind_reg_pollfnc("test5", "test_BAD", test_BAD, 10) == -100); - assert ( ind_reg_pollfnc("test5", "test_BAD2", test_BAD2, 10) == IND_OK); + 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_shutdown() == IND_OK); Index: Test_all_functions.c =================================================================== RCS file: /cvsroot/sblim/indication_helper/test/Test_all_functions.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_all_functions.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_all_functions.c 19 Apr 2005 16:04:23 -0000 1.2 @@ -37,8 +37,8 @@ assert ( IND_OK == ind_shutdown()); /* Monitored */ - assert ( IND_INVALID_ARGS == ind_reg_pollfnc("","",NULL, 0)); - assert ( IND_INVALID_ARGS == ind_reg_pollfnc_ns("","","",NULL, 0)); + 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_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.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc3_threaded.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc3_threaded.c 19 Apr 2005 16:04:24 -0000 1.2 @@ -56,7 +56,7 @@ { snprintf(pn, 100,"A%d", i); - if (ind_reg_pollfnc("test1", pn, test1, 1) == IND_MUTEX) { + if (ind_reg_pollfnc("test1", pn, test1, 1,IND_BEHAVIOUR_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.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_genIndication_fail.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_genIndication_fail.c 19 Apr 2005 16:04:23 -0000 1.2 @@ -541,9 +541,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_OK); + 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", "string", test_string, 1) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test9-poll", "string", test_string, 1,IND_BEHAVIOUR_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.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Test_reg_pollfnc3.c 2 Feb 2005 19:06:51 -0000 1.1.1.1 +++ Test_reg_pollfnc3.c 19 Apr 2005 16:04:24 -0000 1.2 @@ -42,15 +42,15 @@ for (loops =0; loops < 5; loops++) { /* Register */ - assert ( ind_reg_pollfnc("test1", "A", test1, 10) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test1", "A", NULL, 10) == IND_DUPLICATE); + assert ( ind_reg_pollfnc("test1", "A", NULL, 10,IND_BEHAVIOUR_LEVEL_EDGE) == IND_DUPLICATE); - assert ( ind_reg_pollfnc("test1" ,"B", test1, 20) == IND_OK); + assert ( ind_reg_pollfnc("test1" ,"B", test1, 20,IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test1, 30) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test1, 30,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); - assert ( ind_reg_pollfnc("test2", "D", test2, 2) == IND_OK); + assert ( ind_reg_pollfnc("test2", "D", test2, 2,IND_BEHAVIOUR_LEVEL_EDGE) == IND_OK); /* Modify the function */ @@ -87,13 +87,13 @@ } - assert ( ind_reg_pollfnc("test1", "A", test1, 10) == IND_OK); + assert ( ind_reg_pollfnc("test1", "A", test1, 10, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1" ,"B", test1, 20) == IND_OK); + assert ( ind_reg_pollfnc("test1" ,"B", test1, 20, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test1", "C", test1, 30) == IND_OK); + assert ( ind_reg_pollfnc("test1", "C", test1, 30, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); - assert ( ind_reg_pollfnc("test2", "D", test2, 2) == IND_OK); + assert ( ind_reg_pollfnc("test2", "D", test2, 2, IND_BEHAVIOUR_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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Test_genIndication.c 22 Mar 2005 22:02:57 -0000 1.2 +++ Test_genIndication.c 19 Apr 2005 16:04:23 -0000 1.3 @@ -114,8 +114,10 @@ /* Change the return code on odd numbers */ if (uint16_v % 2) return IND_OK; - else + else { + fprintf(stderr,"Ignore the warning. This is intended\n"); return IND_INVALID_ARGS; + } } IndErrorT get_value_string(CMPIData *v) @@ -676,9 +678,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_OK); + 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", "uint16", test_uint16, 1) == IND_OK); + assert ( ind_reg_pollfnc_ns(NAMESPACE,"test8-poll", "uint16", test_uint16, 1, IND_BEHAVIOUR_AGAINST_ZERO) == IND_OK); /* Register a property for the test8 class */ @@ -737,7 +739,7 @@ /* Start and stop the worker */ assert ( ind_start() == IND_OK ); - printf("Waiting 3 seconds. Ought to see two indications...\n"); + printf("Waiting 3 seconds. Ought to see three indications...\n"); sleep (3); assert ( ind_stop() == IND_OK ); @@ -746,7 +748,7 @@ two seconds will be called four times, but the test_uint16 returns -100 instead of IND_OK for every even number, hence we will only get two of them*/ - assert ( indication_count >= 2 ); + assert ( indication_count >= 3 ); /* Shutdown */ assert ( ind_shutdown() == IND_OK); |