--- src/log/apitest/tet_saLogDispatch.c | 28 ++++++++++++++++++++++++++++ src/log/apitest/tet_saLogInitialize.c | 8 ++++++++ 2 files changed, 36 insertions(+)
diff --git a/src/log/apitest/tet_saLogDispatch.c b/src/log/apitest/tet_saLogDispatch.c index 4419e05..30597d6 100644 --- a/src/log/apitest/tet_saLogDispatch.c +++ b/src/log/apitest/tet_saLogDispatch.c @@ -25,3 +25,31 @@ void saLogDispatch_01(void) test_validate(rc, SA_AIS_OK); logFinalize(); } + +/* Object to test: saLogDispatch() API: + * Test: Test the saLogDispatch() with finalized handle + * step1:Call logInitialize() + * step2:call logFinalize() + * step3:Now call the saLogDispatch() with logHandle + * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE + */ +void saLogDispatch_02(void) +{ + rc = logInitialize(); + logFinalize(); + rc = saLogDispatch(logHandle, SA_DISPATCH_ALL); + test_validate(rc, SA_AIS_ERR_BAD_HANDLE); +} + +/* Object to test: saLogDispatch() API: + * Test: Set inparameter log handle(invalid handle) to ZERO(0) + * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE + */ +void saLogDispatch_03(void) +{ + rc = logInitialize(); + if (rc == SA_AIS_OK) + rc = saLogDispatch(0, SA_DISPATCH_ALL); + test_validate(rc, SA_AIS_ERR_BAD_HANDLE); + logFinalize(); +} diff --git a/src/log/apitest/tet_saLogInitialize.c b/src/log/apitest/tet_saLogInitialize.c index 5b941b8..b4e85d2 100644 --- a/src/log/apitest/tet_saLogInitialize.c +++ b/src/log/apitest/tet_saLogInitialize.c @@ -163,6 +163,8 @@ extern void saLogSelectionObjectGet_03(void); extern void saLogFinalize_01(void); extern void saLogFinalize_02(void); extern void saLogDispatch_01(void); +extern void saLogDispatch_02(void); +extern void saLogDispatch_03(void); __attribute__((constructor)) static void saLibraryLifeCycle_constructor(void) { @@ -210,6 +212,12 @@ __attribute__((constructor)) static void saLibraryLifeCycle_constructor(void) "saLogSelectionObjectGet() with finalized log handle"); test_case_add(1, saLogDispatch_01, "saLogDispatch() OK"); + test_case_add( + 1, saLogDispatch_02, + "saLogDispatch() with finalized handle SA_AIS_ERR_BAD_HANDLE"); + test_case_add( + 1, saLogDispatch_03, + "saLogDispatch() with invalid handle SA_AIS_ERR_BAD_HANDLE"); test_case_add(1, saLogFinalize_01, "saLogFinalize() OK"); test_case_add(1, saLogFinalize_02, "saLogFinalize() with NULL log handle"); -- 2.7.4 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel