---
 src/log/apitest/tet_saLogInitialize.c         |  4 ++++
 src/log/apitest/tet_saLogSelectionObjectGet.c | 16 ++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/src/log/apitest/tet_saLogInitialize.c 
b/src/log/apitest/tet_saLogInitialize.c
index 079b0c5..5b941b8 100644
--- a/src/log/apitest/tet_saLogInitialize.c
+++ b/src/log/apitest/tet_saLogInitialize.c
@@ -159,6 +159,7 @@ void 
saLogInitialize_handle_callbk_version_NULL_pointer_error_15(void)
 
 extern void saLogSelectionObjectGet_01(void);
 extern void saLogSelectionObjectGet_02(void);
+extern void saLogSelectionObjectGet_03(void);
 extern void saLogFinalize_01(void);
 extern void saLogFinalize_02(void);
 extern void saLogDispatch_01(void);
@@ -205,6 +206,9 @@ __attribute__((constructor)) static void 
saLibraryLifeCycle_constructor(void)
                      "saLogSelectionObjectGet() OK");
        test_case_add(1, saLogSelectionObjectGet_02,
                      "saLogSelectionObjectGet() with NULL log handle");
+       test_case_add(1, saLogSelectionObjectGet_03,
+                     "saLogSelectionObjectGet() with finalized log handle");
+
        test_case_add(1, saLogDispatch_01, "saLogDispatch() OK");
        test_case_add(1, saLogFinalize_01, "saLogFinalize() OK");
        test_case_add(1, saLogFinalize_02,
diff --git a/src/log/apitest/tet_saLogSelectionObjectGet.c 
b/src/log/apitest/tet_saLogSelectionObjectGet.c
index 4ba0d23..465f1e7 100644
--- a/src/log/apitest/tet_saLogSelectionObjectGet.c
+++ b/src/log/apitest/tet_saLogSelectionObjectGet.c
@@ -31,3 +31,19 @@ void saLogSelectionObjectGet_02(void)
        rc = saLogSelectionObjectGet(0, &selectionObject);
        test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
 }
+
+/* Object to test: saLogSelectionObjectGet() API:
+ * Test: Test the saLogSelectionObjectGet() with finalized handle
+ * step1:Call saLogInitialize() API and it returns SA_AIS_OK
+ * step2:call logFinalize()
+ * step3:Now call the saLogSelectionObjectGet() with logHandle
+ * Result: Shall fail with return code SA_AIS_ERR_BAD_HANDLE
+ */
+void saLogSelectionObjectGet_03(void)
+{
+       SaVersionT log_version = kLogVersion;
+       rc = saLogInitialize(&logHandle, &logCallbacks, &log_version);
+       logFinalize();
+       rc = saLogSelectionObjectGet(logHandle, &selectionObject);
+       test_validate(rc, SA_AIS_ERR_BAD_HANDLE);
+}
-- 
2.7.4



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to