joseph
4th April 2007, 07:42
i am working in Qt 4.2.2, using the VC++ .net versiong( 2007 ).
Here i am testing some classes using test cases .Instead of write the junk of code [testing code] in main.cpp
i created a testMacro.h, here i will write the test code as MACRO [ eg: TEST_CASE_1 ].
Then i am including this "testMacro.h" in the main.cpp.
In main.cpp i can DISABLE or ENABLE individual test or the whole test cases which is written in testMacro.h
It's working properly.
My problem is , in testMacro.h file while creating a object "myObject" of class "MyClass" [just for testing] ,
then if am puting dot [.] or arrow[->] to list the member functions.It is not listing any of the class member's
NOTE:
I have included "MyClass.h,"
The MyClass contains public members.
If am creating any "myObject" in main.cpp , it will list the member functions of "MyClass",while putting arrow or dot operator.
Why it's not working in "testMacro.h" file.
See my main.cpp
#include "MyClass.h"
int main( )
{
MyClass myObj;
myObj.foo(); // here the dot operator [.] will list the foo() automatically in VC++ editor
}
see testMacro.h
#include "MyClass.h"
MyClass myObj;
myObj.foo(); //here the editor will not show the foo()
//even after putting the dot operator [.]
#define TEST_CASE_1
/* i will attach the code " myObj.foo(); " here in the macro later */
#define TEST_CASE_2
#define TEST_CASE_3
please direct me ...if am doing anything wrong.
Here i am testing some classes using test cases .Instead of write the junk of code [testing code] in main.cpp
i created a testMacro.h, here i will write the test code as MACRO [ eg: TEST_CASE_1 ].
Then i am including this "testMacro.h" in the main.cpp.
In main.cpp i can DISABLE or ENABLE individual test or the whole test cases which is written in testMacro.h
It's working properly.
My problem is , in testMacro.h file while creating a object "myObject" of class "MyClass" [just for testing] ,
then if am puting dot [.] or arrow[->] to list the member functions.It is not listing any of the class member's
NOTE:
I have included "MyClass.h,"
The MyClass contains public members.
If am creating any "myObject" in main.cpp , it will list the member functions of "MyClass",while putting arrow or dot operator.
Why it's not working in "testMacro.h" file.
See my main.cpp
#include "MyClass.h"
int main( )
{
MyClass myObj;
myObj.foo(); // here the dot operator [.] will list the foo() automatically in VC++ editor
}
see testMacro.h
#include "MyClass.h"
MyClass myObj;
myObj.foo(); //here the editor will not show the foo()
//even after putting the dot operator [.]
#define TEST_CASE_1
/* i will attach the code " myObj.foo(); " here in the macro later */
#define TEST_CASE_2
#define TEST_CASE_3
please direct me ...if am doing anything wrong.