chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes

Hi,

Basically I am trying to test some Qt codes, like the following:

class MyClass: public QObject

{MyClass();};

when I tried to fake MyClass:

FAKE<MyClass>();

Isolator++ complained:

Isolator++ may fail to fake objects that aren't used anywhere in your test project as the compiler optimizes these. Using of FAKE<QObject>(ISOLATOR_FORCE_SYMBOL) may help (for static methods please use FAKE_STATICS(QObject)).

Someone raised a similar issue there.

It seems that this issue is similar to the issue when faking a pure virtual class, so I followed this page, and tested with a simple pure virtual class:

class MyPureClass

{

public:

 virtual int GetResult() = 0;

};

I tried to fake it using the following:

FAKE<MyPureClass>(ISOLATOR_FORCE_SYMBOL);

Isolator++ again complained:

Isolator++ may fail to fake objects that aren't used anywhere in your test project as the compiler optimizes these. Using of FAKE<MyPureClass>(ISOLATOR_FORCE_SYMBOL) may help (for static methods please use FAKE_STATICS(MyPureClass)).

I disabled the compiler optimization, in the makefile I have the following:

CC            = gcc

CXX           = g++

DEFINES       = -DGTEST_LANG_CXX11 -DQT_QML_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB

CFLAGS        = -pipe -g -O0 -w -g3 $(QMAKE_INCDIR) -D_REENTRANT -Wall -W -fPIC $(DEFINES)

CXXFLAGS      = -pipe -g -O0 -w -g3 $(QMAKE_INCDIR) -std=gnu++11 -D_REENTRANT -Wall -W -fPIC $(DEFINES)

Can you please kindly advise me on this problem?

Thank you in advance

asked by QtTester (600 points)

1 Answer

0 votes

Hi,

Thank you for the detailed information,

We will dig into it and keep you posted on our progress.

Can you please share with me the logs of the run.

To enable logs see the following link: .https://www.typemock.com/docs/?book=Ipp&page=suppressing_additional_message.htm

Cheers,

Alon Sapozhnikov.

Support Specialist.

answered by Alon_TypeMock (9k points)
Thank you for your reply, I don't know how to link to the text file, so I am gonna copy & paste here...

 The log file for QObject failure is too long to be posted here, the log file I posted was for the abstract class failure. I also sent you a private message of the log file, if private message doesn't have limitations on characteristics length, I can send you log files via private messages.

Hi,

I received the private message with the log.

I will dig into the log and keep you posted.

Btw, did you ran 1 test with log enabled or multiple?
If you ran  more the 1 test it will be better to run 1 specific test which produces the error and send me the log of that run.

Cheers,
Alon Sapozhnikov
Support Specialist.

...