Ignore:
Timestamp:
Jun 7, 2008, 12:24:06 PM (17 years ago)
Author:
cinc
Message:

NOMTestCase: Implemented method runTests()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/class_c/nomtestcase.c

    r349 r356  
    4444#endif /* __OS2__ */
    4545
     46#include "string.h"
    4647#include <nom.h>
    4748#include <nomtk.h>
     
    4950#include "nomarray.h"
    5051#include "nomtestcase.ih"
     52#include "nomstring.ih"
     53#include "nommethod.ih"
     54
     55typedef void* NOMLINK nomProc(void*, void*);
    5156
    5257NOMDLLEXPORT NOM_Scope void NOMLINK impl_NOMTestCase_setUp(NOMTestCase* nomSelf,
     
    6873{
    6974  NOMArray* resultArray=NOMArrayNew();
     75  NOMArray* methodArray=NULL;
     76  int a;
    7077 
    7178  /* NOMTestCaseData* nomThis = NOMTestCaseGetData(nomSelf); */
    72 
    73   _setUp(nomSelf, NULL);
     79  methodArray=_nomGetMethodList(nomSelf, FALSE, NULL);
    7480 
    75   _tearDown(nomSelf, NULL);
     81  for(a=0; a<NOMArray_length(methodArray, NULL); a++)
     82  {
     83    char* methodName=_queryString(_getName(NOMArray_queryObjectAtIdx(methodArray, a, NULL), NULL), NULL);
     84   
     85    /* Only Methods starting with ˚test˚ are run. */
     86    if(0==strstr( methodName, "test"))
     87    {
     88      nomProc* nProc=_queryMethodToken(NOMArray_queryObjectAtIdx(methodArray, a, NULL), NULL);
     89     
     90      _setUp(nomSelf, NULL);
     91     
     92      if(NULL!=nProc)
     93        nProc(nomSelf, NULL);
     94     
     95      _tearDown(nomSelf, NULL);     
     96    }
     97   
     98  }
     99 
    76100  return resultArray;   
    77101}
     
    85109  _setUp(nomSelf, NULL);
    86110 
     111  g_message("%s: This method is not yet implemented.", __FUNCTION__);
    87112 
    88113  _tearDown(nomSelf, NULL); 
Note: See TracChangeset for help on using the changeset viewer.