void saImmOiRtObjectCreate_2_04(void)
{
    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);

    rc = saImmOiRtObjectCreate_2(immOiHandle, className, &rootObj, attrValues);
    test_validate(rc, SA_AIS_ERR_BAD_OPERATION);

    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
}
void saImmOiRtObjectCreate_2_05(void)
{
    const SaImmOiImplementerNameT implementerName = (SaImmOiImplementerNameT) __FUNCTION__;

    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(immOiHandle, implementerName), SA_AIS_OK);

    rc = saImmOiRtObjectCreate_2(immOiHandle, "XXX", &rootObj, attrValues);
    test_validate(rc, SA_AIS_ERR_NOT_EXIST);

    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
}
void saImmOiRtObjectCreate_2_06(void)
{
    SaImmOiHandleT newhandle;
    const SaImmOiImplementerNameT implementerName = (SaImmOiImplementerNameT) __FUNCTION__;
    const SaImmOiImplementerNameT implementerName2 = (SaImmOiImplementerNameT) "tet_imm_implementer2";

    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(immOiHandle, implementerName), SA_AIS_OK);
    safassert(saImmOiRtObjectCreate_2(immOiHandle, "SaLogStream", &rootObj, attrValues), SA_AIS_OK);

    /* try create the same object again using a new handle */
    safassert(saImmOiInitialize_2(&newhandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(newhandle, implementerName2), SA_AIS_OK);

    rc = saImmOiRtObjectCreate_2(newhandle, "SaLogStream", &rootObj, attrValues);
    test_validate(rc, SA_AIS_ERR_EXIST);

    safassert(saImmOiRtObjectDelete(immOiHandle, &dnObj1), SA_AIS_OK);
    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
    safassert(saImmOiFinalize(newhandle), SA_AIS_OK);
}
void saImmOiRtObjectDelete_01(void)
{
    const SaImmOiImplementerNameT implementerName = (SaImmOiImplementerNameT) __FUNCTION__;

    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(immOiHandle, implementerName), SA_AIS_OK);
    safassert(saImmOiRtObjectCreate_2(immOiHandle, className, &config_obj_dn, attrValues), SA_AIS_OK);

    rc = saImmOiRtObjectDelete(immOiHandle, &dn);
    test_validate(rc, SA_AIS_OK);

    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
}
void saImmOiRtObjectCreate_2_01(void)
{
    const SaImmOiImplementerNameT implementerName = (SaImmOiImplementerNameT) __FUNCTION__;

    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(immOiHandle, implementerName), SA_AIS_OK);
    safassert(saImmOiRtObjectCreate_2(immOiHandle, className, NULL, NULL), SA_AIS_ERR_INVALID_PARAM);
    /* Create under root */
    if ((rc = saImmOiRtObjectCreate_2(immOiHandle, className, NULL, attrValues)) != SA_AIS_OK)
        goto done;
    safassert(saImmOiRtObjectDelete(immOiHandle, &rdnObj1), SA_AIS_OK);

    /* Create under parent */
    if ((rc = saImmOiRtObjectCreate_2(immOiHandle, className, &rootObj, attrValues)) != SA_AIS_OK)
        goto done;

    safassert(saImmOiRtObjectDelete(immOiHandle, &dnObj1), SA_AIS_OK);

done:
    test_validate(rc, SA_AIS_OK);
    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
}
void saImmOmCcbObjectModify_2_17(void)
{
    const SaImmAdminOwnerNameT adminOwnerName = (SaImmAdminOwnerNameT) __FUNCTION__;
    const SaImmOiImplementerNameT implementerName = (SaImmOiImplementerNameT) __FUNCTION__;
    SaImmAdminOwnerHandleT ownerHandle;
    SaImmCcbHandleT ccbHandle;
    const SaNameT obj1 = { strlen("id=1"), "id=1" };
    const SaNameT obj2 = { strlen("id=2"), "id=2" };
    const SaNameT* attrValues[] = { &obj1 };
    SaImmAttrValuesT_2 v1 = {"attr1", SA_IMM_ATTR_SANAMET, 1, (void**)attrValues};
    SaImmAttrModificationT_2 attrMod = { SA_IMM_ATTR_VALUES_REPLACE, v1 };
    const SaImmAttrModificationT_2 *attrMods[] = { &attrMod, NULL };

    const SaNameT* rdnValues1[] = { &obj1 };
    SaImmAttrValuesT_2 rdnAttr1 = { "rdn", SA_IMM_ATTR_SANAMET, 1, (void**)rdnValues1 };
    const SaImmAttrValuesT_2 *attrValues1[] = { &rdnAttr1, NULL };

    safassert(saImmOmInitialize(&immOmHandle, NULL, &immVersion), SA_AIS_OK);
    safassert(saImmOmAdminOwnerInitialize(immOmHandle, adminOwnerName, SA_TRUE, &ownerHandle), SA_AIS_OK);
    safassert(nodangling_class_create(immOmHandle), SA_AIS_OK);
    safassert(runtime_class_create(immOmHandle), SA_AIS_OK);
    safassert(object_create(immOmHandle, ownerHandle, nodanglingClassName, &obj2, NULL, NULL), SA_AIS_OK);

    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(immOiHandle, implementerName), SA_AIS_OK);
    safassert(saImmOiRtObjectCreate_2(immOiHandle, runtimeClassName, NULL, attrValues1), SA_AIS_OK);

    safassert(saImmOmCcbInitialize(ownerHandle, 0, &ccbHandle), SA_AIS_OK);
    rc = saImmOmCcbObjectModify_2(ccbHandle, &obj2, attrMods);
    safassert(saImmOmCcbFinalize(ccbHandle), SA_AIS_OK);

    safassert(saImmOiRtObjectDelete(immOiHandle, &obj1), SA_AIS_OK);
    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);

    safassert(object_delete(ownerHandle, &obj2, 1), SA_AIS_OK);
    safassert(runtime_class_delete(immOmHandle), SA_AIS_OK);
    safassert(nodangling_class_delete(immOmHandle), SA_AIS_OK);
    safassert(saImmOmAdminOwnerFinalize(ownerHandle), SA_AIS_OK);
    safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);

    test_validate(rc, SA_AIS_ERR_INVALID_PARAM);
}
void saImmOiRtObjectCreate_2_07(void)
{
    const SaImmOiImplementerNameT implementerName = (SaImmOiImplementerNameT) __FUNCTION__;
    const char *long_name = 
        "123456789012345678901234567890123456789012345678901234567890123"; /* 63 chars long */


    SaNameT rdnObj27;
    rdnObj27.length = 64;
    strncpy((char *) rdnObj27.value, long_name, 64);
    SaImmAttrValueT nameValues27[] = {&long_name};

    //const SaNameT *nameValues27[] = {&rdnObj27};
    const SaImmAttrValuesT_2 v27 = { "safLgStr",  SA_IMM_ATTR_SASTRINGT, 1, (void**)nameValues27 };
    const SaImmAttrValuesT_2* attrValues27[] = {&v1, &v27, &v3, &v4, &v5, &v6, &v7, &v8, &v9, &v10, &v11, NULL};

    SaNameT tmpName;

    safassert(saImmOiInitialize_2(&immOiHandle, &immOiCallbacks, &immVersion), SA_AIS_OK);
    safassert(saImmOiImplementerSet(immOiHandle, implementerName), SA_AIS_OK);

    /*Create first rt object. */
    safassert(saImmOiRtObjectCreate_2(immOiHandle, className, &rootObj, attrValues27), SA_AIS_OK);/*107  (63+44)*/

    tmpName.length = 107;
    strncpy((char *) tmpName.value, 
        "123456789012345678901234567890123456789012345678901234567890123,rdn=root", 107);
    /*Create second rt object. */
    safassert(saImmOiRtObjectCreate_2(immOiHandle, className, &tmpName, attrValues27), SA_AIS_OK);/* 171 (63 + 108)*/

    tmpName.length = 171;
    strncpy((char *) tmpName.value, 
        "123456789012345678901234567890123456789012345678901234567890123,"
        "123456789012345678901234567890123456789012345678901234567890123,rdn=root", 171);
    /*Create third rt object. */
    safassert(saImmOiRtObjectCreate_2(immOiHandle, className, &tmpName, attrValues27), SA_AIS_OK);/* 235  (63 + 172) */

    tmpName.length = 235;
    strncpy((char *) tmpName.value, 
        "123456789012345678901234567890123456789012345678901234567890123,"
        "123456789012345678901234567890123456789012345678901234567890123,"
        "123456789012345678901234567890123456789012345678901234567890123,rdn=root", 235);
    /*Create of fourth rt object should fail. */
    rc = saImmOiRtObjectCreate_2(immOiHandle, className, &tmpName, attrValues27);/*299!!   (63 + 236)*/

    if(!osaf_is_extended_names_enabled()) {
        test_validate(rc, SA_AIS_ERR_NAME_TOO_LONG);
    } else {
        test_validate(rc, SA_AIS_OK);
    }

    /*Tear down*/

    tmpName.length = 107;
    strncpy((char *) tmpName.value, 
        "123456789012345678901234567890123456789012345678901234567890123,rdn=root", 107);
    /* Delete first rt object and all its subobjects! */
    safassert(saImmOiRtObjectDelete(immOiHandle, &tmpName), SA_AIS_OK);

    safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
}