--- src/log/apitest/tet_saLogFinalize.c | 16 ++++++++++++++++ src/log/apitest/tet_saLogInitialize.c | 3 +++ 2 files changed, 19 insertions(+)
diff --git a/src/log/apitest/tet_saLogFinalize.c b/src/log/apitest/tet_saLogFinalize.c index 7b23a98..74faea3 100644 --- a/src/log/apitest/tet_saLogFinalize.c +++ b/src/log/apitest/tet_saLogFinalize.c @@ -30,3 +30,19 @@ void saLogFinalize_02(void) rc = saLogFinalize(0); test_validate(rc, SA_AIS_ERR_BAD_HANDLE); } + +/* Object to test: saLogFinalize() API: + * Test: Test the saLogFinalize() with finalized handle + * step1:Call saLogInitialize() API and it returns SA_AIS_OK + * step2:call logFinalize() + * step3:Now call the saLogFinalize() with logHandle + * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE + */ +void saLogFinalize_03(void) +{ + SaVersionT log_version = kLogVersion; + rc = saLogInitialize(&logHandle, &logCallbacks, &log_version); + logFinalize(); + rc = saLogFinalize(logHandle); + test_validate(rc, SA_AIS_ERR_BAD_HANDLE); +} diff --git a/src/log/apitest/tet_saLogInitialize.c b/src/log/apitest/tet_saLogInitialize.c index b4e85d2..dd3e474 100644 --- a/src/log/apitest/tet_saLogInitialize.c +++ b/src/log/apitest/tet_saLogInitialize.c @@ -162,6 +162,7 @@ extern void saLogSelectionObjectGet_02(void); extern void saLogSelectionObjectGet_03(void); extern void saLogFinalize_01(void); extern void saLogFinalize_02(void); +extern void saLogFinalize_03(void); extern void saLogDispatch_01(void); extern void saLogDispatch_02(void); extern void saLogDispatch_03(void); @@ -221,4 +222,6 @@ __attribute__((constructor)) static void saLibraryLifeCycle_constructor(void) test_case_add(1, saLogFinalize_01, "saLogFinalize() OK"); test_case_add(1, saLogFinalize_02, "saLogFinalize() with NULL log handle"); + test_case_add(1, saLogFinalize_03, + "saLogFinalize() with finalized log handle"); } -- 2.7.4 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel