Changeset 358 for trunk/nom/class_c/nomtestcase.c
- Timestamp:
- Jun 7, 2008, 6:08:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nom/class_c/nomtestcase.c
r356 r358 49 49 50 50 #include "nomarray.h" 51 #include "nomstring.h" 52 #include "nomtestresult.h" 51 53 #include "nomtestcase.ih" 52 #include "nomstring.ih" 53 #include "nommethod.ih" 54 #include "nommethod.h" 54 55 55 typedef void*NOMLINK nomProc(void*, void*);56 typedef boolean NOMLINK nomProc(void*, void*); 56 57 57 58 NOMDLLEXPORT NOM_Scope void NOMLINK impl_NOMTestCase_setUp(NOMTestCase* nomSelf, … … 86 87 if(0==strstr( methodName, "test")) 87 88 { 89 NOMTestResult* nResult=NOMTestResultNew(); 88 90 nomProc* nProc=_queryMethodToken(NOMArray_queryObjectAtIdx(methodArray, a, NULL), NULL); 89 91 90 92 _setUp(nomSelf, NULL); 91 93 94 /* The name of this test */ 95 _setName(nResult, _getName(NOMArray_queryObjectAtIdx(methodArray, a, NULL), NULL), NULL); 96 97 /* Call the test method */ 92 98 if(NULL!=nProc) 93 nProc(nomSelf, NULL);99 _setSuccess(nResult, nProc(nomSelf, NULL), NULL); /* TRUE if success */ 94 100 95 _tearDown(nomSelf, NULL); 96 } 97 101 /* Clean up */ 102 _tearDown(nomSelf, NULL); 103 NOMArray_append(resultArray, nResult, NULL); 104 } 98 105 } 99 106 … … 101 108 } 102 109 103 NOMDLLEXPORT NOM_Scope voidNOMLINK impl_NOMTestCase_runSingleTest(NOMTestCase* nomSelf,110 NOMDLLEXPORT NOM_Scope NOMTestResult* NOMLINK impl_NOMTestCase_runSingleTest(NOMTestCase* nomSelf, 104 111 const CORBA_char* chrTestName, 105 112 CORBA_Environment *ev) 106 113 { 114 NOMTestResult* nResult=NOMTestResultNew(); 115 NOMString* nsName; 116 NOMArray* methodArray=NULL; 117 int a; 118 107 119 /* NOMTestCaseData* nomThis = NOMTestCaseGetData(nomSelf); */ 108 120 109 _setUp(nomSelf, NULL); 121 /* Get list of all methods of this class */ 122 methodArray=_nomGetMethodList(nomSelf, FALSE, NULL); 123 124 /* The name of this test */ 125 nsName=NOMStringNew(); 126 NOMString_assignString(nsName, chrTestName, NULL); 110 127 111 g_message("%s: This method is not yet implemented.", __FUNCTION__); 128 _setName(nResult, nsName, NULL); 129 130 for(a=0; a<NOMArray_length(methodArray, NULL); a++) 131 { 132 char* methodName=_queryString(_getName(NOMArray_queryObjectAtIdx(methodArray, a, NULL), NULL), NULL); 133 134 if(0==strcmp( methodName, chrTestName)) 135 { 136 nomProc* nProc=_queryMethodToken(NOMArray_queryObjectAtIdx(methodArray, a, NULL), NULL); 137 138 _setUp(nomSelf, NULL); 139 140 /* Call the test method */ 141 if(NULL!=nProc) 142 _setSuccess(nResult, nProc(nomSelf, NULL), NULL); /* TRUE if success */ 143 144 /* Clean up */ 145 _tearDown(nomSelf, NULL); 146 } 147 } 112 148 113 _tearDown(nomSelf, NULL);149 return nResult; 114 150 } 115 151
Note:
See TracChangeset
for help on using the changeset viewer.