Hi Hung,

Ack from me.

Thanks,
Zoran

-----Original Message-----
From: Hung Nguyen [mailto:[email protected]] 
Sent: den 25 oktober 2016 12:54
To: Zoran Milinkovic <[email protected]>; 
[email protected]
Cc: [email protected]
Subject: [PATCH 1 of 1] imm: Avoid hard coding attributes count in 
saImmOmAccessorGet_2_04 [#2140]

 tests/immsv/management/test_saImmOmAccessorGet_2.c |  15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)


Avoid hard coding attributes count in saImmOmAccessorGet_2_04.

diff --git a/tests/immsv/management/test_saImmOmAccessorGet_2.c 
b/tests/immsv/management/test_saImmOmAccessorGet_2.c
--- a/tests/immsv/management/test_saImmOmAccessorGet_2.c
+++ b/tests/immsv/management/test_saImmOmAccessorGet_2.c
@@ -131,9 +131,22 @@ void saImmOmAccessorGet_2_04(void)
     safassert(saImmOmInitialize(&immOmHandle, &immOmCallbacks, &immVersion), 
SA_AIS_OK);
     safassert(saImmOmAccessorInitialize(immOmHandle, &accessorHandle), 
SA_AIS_OK);
     rc = saImmOmAccessorGet_2(accessorHandle, &objectName, 
accessorGetConfigAttrsToken, &attributes);
+    /* Count the number of config attributes of the class */
+    SaImmClassCategoryT category;
+    SaImmAttrDefinitionT_2** classAttributes;
+    safassert(saImmOmClassDescriptionGet_2(immOmHandle, "OpensafImm", 
&category, &classAttributes), SA_AIS_OK);
+    int configAttrCount = 0;
+    SaImmAttrDefinitionT_2** currentAttr = classAttributes;
+    while(*currentAttr) {
+        if ((*currentAttr)->attrFlags & SA_IMM_ATTR_CONFIG) {
+            ++configAttrCount;
+        }
+        ++currentAttr;
+    }
+    safassert(saImmOmClassDescriptionMemoryFree_2(immOmHandle, 
classAttributes), SA_AIS_OK);
     /* Verify the number of config attributes */
     cnt = print_SaImmAttrValuesT_2(attributes);
-    assert(cnt == 12);
+    assert(cnt == configAttrCount);
     test_validate(rc, SA_AIS_OK);
     safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
 }

------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to