Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
test_status.cpp File Reference
#include "iGeom.h"
#include "iMesh.h"
#include "iRel.h"
#include "TestUtil.hpp"
#include <cstdlib>
+ Include dependency graph for test_status.cpp:

Go to the source code of this file.

Functions

void test_initial_inactive ()
void test_initial_notexist ()
int main ()

Variables

iGeom_Instance geom
iMesh_Instance mesh
iRel_Instance rel

Function Documentation

int main ( )

Definition at line 72 of file test_status.cpp.

References geom, iMesh_dtor, iMesh_newMesh, iRel_create, iRel_destroy, mesh, rel, RUN_TEST, test_initial_inactive(), and test_initial_notexist().

{
    int err;
    int num_fail = 0;

    iGeom_newGeom( 0, &geom, &err, 0 );
    iMesh_newMesh( 0, &mesh, &err, 0 );
    iRel_create( 0, &rel, &err, 0 );

    num_fail += RUN_TEST( test_initial_inactive );
    num_fail += RUN_TEST( test_initial_notexist );

    iRel_destroy( rel, &err );
    iMesh_dtor( mesh, &err );
    iGeom_dtor( geom, &err );

    return num_fail;
}

Definition at line 14 of file test_status.cpp.

References CHECK, geom, iBase_SUCCESS, iMesh_createEntSet, iRel_ACTIVE, iRel_changePairStatus, iRel_createPair, iRel_getSetSetRelation, iRel_IGEOM_IFACE, iRel_IMESH_IFACE, iRel_INACTIVE, iRel_SET, iRel_setSetSetRelation, mesh, mesh_set, and rel.

Referenced by main().

{
    int err;
    iRel_PairHandle pair;

    iRel_createPair( rel, geom, iRel_SET, iRel_IGEOM_IFACE, iRel_INACTIVE, mesh, iRel_SET, iRel_IMESH_IFACE,
                     iRel_ACTIVE, &pair, &err );CHECK_ERR( err );

    iBase_EntitySetHandle geom_set;
    iGeom_createEntSet( geom, false, &geom_set, &err );CHECK_ERR( err );

    iBase_EntitySetHandle mesh_set;
    iMesh_createEntSet( mesh, false, &mesh_set, &err );CHECK_ERR( err );

    iRel_setSetSetRelation( rel, pair, geom_set, mesh_set, &err );CHECK_ERR( err );

    iBase_EntitySetHandle related_set;
    iRel_getSetSetRelation( rel, pair, mesh_set, 1, &related_set, &err );CHECK_ERR( err );
    CHECK_EQUAL( related_set, geom_set );

    iRel_getSetSetRelation( rel, pair, geom_set, 0, &related_set, &err );
    CHECK( err != iBase_SUCCESS );

    iRel_changePairStatus( rel, pair, iRel_ACTIVE, iRel_ACTIVE, &err );CHECK_ERR( err );

    iRel_getSetSetRelation( rel, pair, geom_set, 0, &related_set, &err );CHECK_ERR( err );
    CHECK_EQUAL( related_set, mesh_set );
}

Definition at line 43 of file test_status.cpp.

References CHECK, geom, iBase_SUCCESS, iMesh_createEntSet, iRel_ACTIVE, iRel_changePairStatus, iRel_createPair, iRel_getSetSetRelation, iRel_IGEOM_IFACE, iRel_IMESH_IFACE, iRel_NOTEXIST, iRel_SET, iRel_setSetSetRelation, mesh, mesh_set, and rel.

Referenced by main().

{
    int err;
    iRel_PairHandle pair;

    iRel_createPair( rel, geom, iRel_SET, iRel_IGEOM_IFACE, iRel_NOTEXIST, mesh, iRel_SET, iRel_IMESH_IFACE,
                     iRel_ACTIVE, &pair, &err );CHECK_ERR( err );

    iBase_EntitySetHandle geom_set;
    iGeom_createEntSet( geom, false, &geom_set, &err );CHECK_ERR( err );

    iBase_EntitySetHandle mesh_set;
    iMesh_createEntSet( mesh, false, &mesh_set, &err );CHECK_ERR( err );

    iRel_setSetSetRelation( rel, pair, geom_set, mesh_set, &err );CHECK_ERR( err );

    iBase_EntitySetHandle related_set;
    iRel_getSetSetRelation( rel, pair, mesh_set, 1, &related_set, &err );CHECK_ERR( err );
    CHECK_EQUAL( related_set, geom_set );

    iRel_getSetSetRelation( rel, pair, geom_set, 0, &related_set, &err );
    CHECK( err != iBase_SUCCESS );

    iRel_changePairStatus( rel, pair, iRel_ACTIVE, iRel_ACTIVE, &err );CHECK_ERR( err );

    iRel_getSetSetRelation( rel, pair, geom_set, 0, &related_set, &err );CHECK_ERR( err );
    CHECK_EQUAL( related_set, mesh_set );
}

Variable Documentation

iGeom_Instance geom

Definition at line 9 of file test_status.cpp.

Definition at line 10 of file test_status.cpp.

Definition at line 11 of file test_status.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines