[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: build error in kdelibs - QTest related
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2009-12-07 22:08:28
Message-ID: 200912072308.34206 () thufir ! ingo-kloecker ! de
[Download RAW message or body]


On Monday 07 December 2009, Alexander Neundorf wrote:
> Hi,
>
> kdelibs currently does not build on Solaris with the Sun Studio
> compiler if the tests are enabled:
> http://my.cdash.org/viewBuildError.php?buildid=40434
>
> This is the error:
> [ 31%] Building CXX object
> kdecore/tests/CMakeFiles/kjobtest.dir/kjobtest.o
>
> "/.../srcdir/kdecore/tests/kjobtest.cpp", line 96: Error: Could not
> find a match for QTest::qCompare<QTest::T>(KJob*, TestJob*, const
> char[45], const char[4], const char[65], int) needed in
> KJobTest::testProgressTracking().
>
>
> Any idea what's wrong here ?

Excerpt of http://doc.trolltech.com/4.5/qtest.html#QCOMPARE:
QCOMPARE is very strict on the data types. Both actual and expected have 
to be of the same type, otherwise the test won't compile. This 
prohibits unspecified behavior from being introduced; that is behavior 
that usually occurs when the compiler implicitly casts the argument.

Apparently, the Sun Studio compiler is stricter than gcc and does not 
cast TestJob* to KJob*, but regards them as different (which they are).

Changing
QCOMPARE( processed_spy.at( 0 ).at( 0 ).value<KJob*>(), job );
to
QCOMPARE( processed_spy.at( 0 ).at( 0 ).value<KJob*>(), 
static_cast<KJob*>( job ) );
should help.


Regards,
Ingo

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic