Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » problem with compilation/linking - Duplicate .cpp file in single package
Re: problem with compilation/linking - Duplicate .cpp file in single package [message #11602 is a reply to message #11598] |
Tue, 18 September 2007 21:40   |
Zardos
Messages: 62 Registered: April 2007
|
Member |
|
|
Well, if it is all about a Unittest package you can probably write one which would fit perfectly into U++.
I have attached a zip-file containing 3 files. UTest.cpp, UTest.h and _Test_.cpp
_Test_.cpp shows an example how to use it.
Basically there are:
UTest(testname) {
}
UModule(modulename) {
int var1;
XY *xy;
UInit(modulename) { // Initialize a module
xy = new XY;
}
UTerm(modulename) { // Terminate a module
delete xy;
}
... following UTest(..) "functions" probably using var1 and xy
}
// to be used inside UTest(...)
UCheck(expression) // checks if an expression evaluates to true (ASSERT for UTest)
UExcept(ExectionClass, functioncall) // checks if an exception is thrown
UTiming(seconds) {// checks if a function executes in a given time
// Block which gets messured
}
These files work not out of the box with U++!!!!
You have to rewrite some functions with the U++ classes and functions. But all in all it's just 160 lines... So it can probably done in 20 minutes.
Basically replace Vec with Vector. replace the foreach(e, c) loops with the U++ style iteration: for(int i = 0, i < ...). Change the Logging functions: Err/Inf to the U++ logging functions and finally replace the Timing class Timer with the U++ version.
Ahh and you have to call RunUTests() somewhere
If I have a little bit time tomorrow I can do it for you. I'm currently just playing around with some other stuff, so it's not in U++ this time.
-
Attachment: UTest.zip
(Size: 2.18KB, Downloaded 315 times)
[Updated on: Tue, 18 September 2007 21:42] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Wed Aug 27 00:10:48 CEST 2025
Total time taken to generate the page: 0.08733 seconds
|