Unsolved How could I output variable's value on QtTest.
-
I make a simple test for our module:
#include <QTest> #include <QDebug> #include <MMDModel> class tst_MMDModel: public MMDModel { Q_OBJECT public: private Q_SLOTS: void loadValidSource( void ) { QString file( __FILE__ ); file.append( "/hatsunemiku/hatsunemiku_ver2.pmd" ); setSource( file ); //QVERIFY( errorString( ) == "" ); qWarning( ) << errorString( ); QCOMPARE( errorString( ), QString( "" ) ); } }; QTEST_APPLESS_MAIN( tst_MMDModel ) #include "tst_mmdmodel.moc"
Actually I want to show errorString( ) in output panel, how could I achieve this?
-
@jiancaiyang said in How could I output variable's value on QtTest.:
qWarning( ) << errorString( );
You're already doing it. It doesn't work?
-
@jsulm I found QWARN macro works, other like "qDebug", "qWarning" does not work.
-
@jiancaiyang Do you mean it doesn't print anything, or it doesn't compile?
-
@jsulm It does'nt print anything.
-
Hi,
What if you use
qDebug("Print me");
?