1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#include "TestRunner.hpp"
#include "iMesh.h"
#include "iMesh_extensions.h"
#include "MBiMesh.hpp"
#include "moab/Core.hpp"
#include <algorithm>

void test_tag_iterate();
void test_step_iter();

int main( int argc, char* argv[] )
{
    REGISTER_TEST( test_tag_iterate );
    REGISTER_TEST( test_step_iter );

    return RUN_TESTS( argc, argv );
}

void test_tag_iterate()
{
    iMesh_Instance mesh;
    int err;
    iMesh_newMesh( "", &mesh, &err, 0 );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    iBase_EntitySetHandle root_set, entset;
    iMesh_getRootSet( mesh, &root_set, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    iBase_EntityHandle* verts = 0;
    int verts_alloc = 0, verts_size = 0;
    double coords[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5 };
    iMesh_createVtxArr( mesh, 6, iBase_INTERLEAVED, coords, 18, &verts, &verts_alloc, &verts_size, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    /* create an entity set with two subranges */
    iMesh_createEntSet( mesh, 0, &entset, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_addEntArrToSet( mesh, verts, 2, entset, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_addEntArrToSet( mesh, &verts[3], 3, entset, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    /* create a dbl tag and set vertices */
    iBase_TagHandle tagh;
    iMesh_createTagWithOptions( mesh, "dum", "moab:TAG_STORAGE_TYPE=DENSE", 1, iBase_DOUBLE, &tagh, &err, 3, 27 );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_setDblArrData( mesh, verts, 6, tagh, coords + 3, 6, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    /* get an iterator over the root set, and check tag iterator for that */
    iBase_EntityArrIterator iter;
    int count, atend;
    double* data;
    iMesh_initEntArrIter( mesh, root_set, iBase_ALL_TYPES, iMesh_ALL_TOPOLOGIES, 6, 0, &iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_tagIterate( mesh, tagh, iter, &data, &count, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    if( count != 6 ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );

    for( int i = 0; i < 6; i++ )
    {
        if( data[i] != coords[i + 3] ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );
    }
    iMesh_endEntArrIter( mesh, iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iter = 0;  // iMesh_endEntArrIter frees iter

    /* get an iterator over the set with two subranges, and check tag iterator for that */
    iMesh_initEntArrIter( mesh, entset, iBase_ALL_TYPES, iMesh_ALL_TOPOLOGIES, 6, 0, &iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_tagIterate( mesh, tagh, iter, &data, &count, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    if( count != 2 || data[0] != coords[3] || data[1] != coords[4] ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );
    iMesh_stepEntArrIter( mesh, iter, 2, &atend, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    /* shouldn't be at end yet */
    if( atend ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );

    iMesh_tagIterate( mesh, tagh, iter, &data, &count, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    if( count != 3 || data[0] != coords[6] || data[1] != coords[7] ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );
    iMesh_stepEntArrIter( mesh, iter, 3, &atend, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    /* should be at end now */
    if( !atend ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );
    iMesh_endEntArrIter( mesh, iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    iMesh_dtor( mesh, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    free( verts );
}

void test_step_iter()
{
    iMesh_Instance mesh;
    int err;
    iMesh_newMesh( "", &mesh, &err, 0 );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    iBase_EntitySetHandle root_set;
    iMesh_getRootSet( mesh, &root_set, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    iBase_EntityHandle* verts = 0;
    int verts_alloc = 0, verts_size = 0;
    double coords[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5 };
    iMesh_createVtxArr( mesh, 6, iBase_INTERLEAVED, coords, 18, &verts, &verts_alloc, &verts_size, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    /* make a non-array iterator and test stepping over it */
    iBase_EntityIterator iter;
    int atend;
    iMesh_initEntIter( mesh, root_set, iBase_ALL_TYPES, iMesh_ALL_TOPOLOGIES, 0, &iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_stepEntIter( mesh, iter, 2, &atend, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    /* shouldn't be at end yet */
    if( atend ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );

    iMesh_stepEntIter( mesh, iter, 4, &atend, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    /* should be at end now */
    if( !atend ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );
    iMesh_endEntIter( mesh, iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    /* make an array iterator and test stepping over it */
    iBase_EntityArrIterator arr_iter;
    iMesh_initEntArrIter( mesh, root_set, iBase_ALL_TYPES, iMesh_ALL_TOPOLOGIES, 6, 0, &arr_iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    iMesh_stepEntArrIter( mesh, arr_iter, 2, &atend, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    /* shouldn't be at end yet */
    if( atend ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );

    iMesh_stepEntArrIter( mesh, arr_iter, 4, &atend, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );
    /* should be at end now */
    if( !atend ) CHECK_EQUAL( iBase_SUCCESS, iBase_FAILURE );
    iMesh_endEntArrIter( mesh, arr_iter, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    iMesh_dtor( mesh, &err );<--- Skipping configuration 'MOAB_FC_FUNC' since the value of 'MOAB_FC_FUNC' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.<--- Skipping configuration 'MOAB_FC_FUNC_' since the value of 'MOAB_FC_FUNC_' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
    CHECK_EQUAL( iBase_SUCCESS, err );

    free( verts );
}