(root)/
libredwg-0.13/
test/
unit-testing/
sortentstable.c
       1  #define DWG_TYPE DWG_TYPE_SORTENTSTABLE
       2  #include "common.c"
       3  
       4  void
       5  api_process (dwg_object *obj)
       6  {
       7    int error;
       8    BITCODE_BL i, num_ents;
       9    BITCODE_H *sort_ents;
      10    BITCODE_H block_owner;
      11    BITCODE_H *ents, *hdls;
      12  
      13    dwg_obj_sortentstable *_obj = dwg_object_to_SORTENTSTABLE (obj);
      14  
      15    CHK_ENTITY_H (_obj, SORTENTSTABLE, block_owner);
      16    CHK_ENTITY_TYPE (_obj, SORTENTSTABLE, num_ents, BL);
      17    if (!dwg_dynapi_entity_value (_obj, "SORTENTSTABLE", "ents", &ents, NULL))
      18      fail ("SORTENTSTABLE.ents");
      19    if (!dwg_dynapi_entity_value (_obj, "SORTENTSTABLE", "sort_ents", &sort_ents,
      20                                  NULL))
      21      fail ("SORTENTSTABLE.sort_ents");
      22    hdls = _obj->ents;
      23    for (i = 0; i < num_ents; i++)
      24      {
      25        if (hdls[i] == ents[i])
      26          {
      27            if (ents[i])
      28              ok ("SORTENTSTABLE.ents[%d]: " FORMAT_REF, i, ARGS_REF (ents[i]));
      29            else
      30              ok ("SORTENTSTABLE.ents[%d]: NULL", i);
      31          }
      32        else
      33          fail ("SORTENTSTABLE.ents[%d]: " FORMAT_REF, i, ARGS_REF (ents[i]));
      34        if (sort_ents[i])
      35          ok ("SORTENTSTABLE.sort_ents[%d]: " FORMAT_REF, i,
      36              ARGS_REF (sort_ents[i]));
      37        else
      38          ok ("SORTENTSTABLE.sort_ents[%d]: NULL", i);
      39      }
      40  }