Ignore:
Timestamp:
Jun 22, 2008, 5:10:06 PM (17 years ago)
Author:
cinc
Message:

Added testing of NOMObject base methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/c/test-nom.c

    r331 r362  
    6363#include "bclass.h"
    6464
     65/* For unit test */
     66#include "nomarray.h"
     67#include "nomstring.h"
     68#include "nommethod.h"
     69#include "nomtestresult.h"
     70#include "testnomobject.h"
     71
     72
    6573#define ULONG_TESTVALUE_1         0xffeeddcc
    6674#define ULONG_TESTVALUE_2         0x55aa1122
     
    210218
    211219
     220static void printTestResults(NOMArray* nArray)
     221{
     222  int a;
     223 
     224  for(a=0; a < NOMArray_length(nArray, NULL) ; a++)
     225  {
     226    g_message("Test '%s()': %s", _queryString(NOMTestResult_queryName(NOMArray_queryObjectAtIdx(nArray, a, NULL), NULL), NULL),
     227              NOMTestResult_success(NOMArray_queryObjectAtIdx(nArray, a, NULL), NULL) ? "Ok" : "Not ok");
     228  }
     229}
     230
     231
    212232/**
    213233   Main entry point for the idl compiler.
     
    219239  AClass*  aObject;
    220240  BClass*  bObject;
     241
     242  /* Unit test */
     243  NOMArray* nArray;
     244  TestNomObject* tstNomObject;
     245  int a;
    221246
    222247#if 0
     
    279304  tstSetBClassInstanceVar(bObject);
    280305
     306  nomPrintf("\n");
     307  g_message("Testing NOMObject");
     308  tstNomObject=TestNomObjectNew();
     309  _setClassMgrObject(tstNomObject, NOMClassMgrObject, NULL);
     310  nArray=_runTests(tstNomObject, NULL);
     311  printTestResults(nArray);
     312 
    281313  return 0;
    282314};
Note: See TracChangeset for help on using the changeset viewer.