(root)/
libredwg-0.13/
test/
unit-testing/
appid_control.c
       1  #define DWG_TYPE DWG_TYPE_APPID_CONTROL
       2  #include "common.c"
       3  
       4  void
       5  api_process (dwg_object *obj)
       6  {
       7    int error, isnew;
       8    BITCODE_BS i, num_entries;
       9    BITCODE_H *entries, *hdls;
      10  
      11    dwg_obj_appid_control *ctrl = dwg_object_to_APPID_CONTROL (obj);
      12  
      13    CHK_ENTITY_TYPE (ctrl, APPID_CONTROL, num_entries, BS);
      14    entries = dwg_object_tablectrl_get_entries (obj, &error);
      15    if (!dwg_dynapi_entity_value (ctrl, "APPID_CONTROL", "entries", &hdls, NULL))
      16      fail ("APPID_CONTROL.entries");
      17    for (i = 0; i < num_entries; i++)
      18      {
      19        if (hdls[i] == entries[i])
      20          {
      21            if (entries[i])
      22              ok ("APPID_CONTROL.entries[%d]: " FORMAT_REF, i,
      23                  ARGS_REF (entries[i]));
      24            else
      25              ok ("APPID_CONTROL.entries[%d]: NULL", i);
      26          }
      27        else
      28          {
      29            if (entries[i])
      30              fail ("APPID_CONTROL.entries[%d]: " FORMAT_REF, i,
      31                    ARGS_REF (entries[i]));
      32            else
      33              fail ("APPID_CONTROL.entries[%d]: NULL", i);
      34          }
      35      }
      36  }