- Timestamp:
- Jun 7, 2008, 6:08:51 PM (17 years ago)
- Location:
- trunk/nom
- Files:
-
- 4 edited
-
class_c/nomtestcase.c (modified) (3 diffs)
-
class_c/nomtestresult.c (modified) (2 diffs)
-
idl/nomtestcase.idl (modified) (3 diffs)
-
idl/nomtestresult.idl (modified) (2 diffs)
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 -
trunk/nom/class_c/nomtestresult.c
r347 r358 20 20 #include <nomtk.h> 21 21 22 #include "nomstring.h" 22 23 #include "nomtestresult.ih" 23 24 … … 31 32 } 32 33 34 35 NOMDLLEXPORT NOM_Scope void NOMLINK impl_NOMTestResult_setSuccess(NOMTestResult* nomSelf, 36 const CORBA_boolean fSuccess, 37 CORBA_Environment *ev) 38 { 39 NOMTestResultData* nomThis = NOMTestResultGetData(nomSelf); 40 41 _fSuccess=fSuccess; 42 } 43 44 45 NOMDLLEXPORT NOM_Scope void NOMLINK impl_NOMTestResult_setName(NOMTestResult* nomSelf, 46 const NOMString* nsName, 47 CORBA_Environment *ev) 48 { 49 NOMTestResultData* nomThis = NOMTestResultGetData(nomSelf); 50 51 _nsTestName=nsName; 52 } 53 54 55 NOMDLLEXPORT NOM_Scope NOMString* NOMLINK impl_NOMTestResult_queryName(NOMTestResult* nomSelf, 56 CORBA_Environment *ev) 57 { 58 NOMTestResultData* nomThis = NOMTestResultGetData(nomSelf); 59 60 return _nsTestName; 61 } 62 -
trunk/nom/idl/nomtestcase.idl
r349 r358 39 39 40 40 interface NOMArray; 41 interface NOMTestResult; 41 42 42 43 NOMCLASSNAME(NOMTestCase); … … 67 68 /*boolean assertTrue();*/ 68 69 NOMArray* runTests(); 69 voidrunSingleTest(in string chrTestName);70 NOMTestResult* runSingleTest(in string chrTestName); 70 71 71 72 /** … … 74 75 //NOMOVERRIDE(nomInit); 75 76 76 /**77 The GPtrArray holding the objects78 */79 //NOMINSTANCEVAR(GPtrArray* pPtrArray);80 77 }; 81 78 -
trunk/nom/idl/nomtestresult.idl
r353 r358 41 41 NOMCLASSNAME(NOMTestResult); 42 42 43 43 interface NOMString; 44 44 45 45 /** \class NOMTestResult … … 63 63 */ 64 64 boolean success(); 65 66 void setSuccess(in boolean fSuccess); 67 68 void setName(in NOMString* nsName); 69 NOMString* queryName(); 70 71 NOMINSTANCEVAR(boolean fSuccess); 72 NOMINSTANCEVAR(NOMString* nsTestName); 73 65 74 }; 66 75
Note:
See TracChangeset
for help on using the changeset viewer.
