Hello koen, this is how it works :-). I miss the 'Test' folder totally. Thanks Sven
-------- Original-Nachricht -------- > Datum: Fri, 21 May 2010 11:42:31 +0200 > Von: Koen Deforche <[email protected]> > An: [email protected] > Betreff: Re: [Wt-interest] WContainerWidget and UnitTest > Hey Sven, > > 2010/5/21 Sven Knoblich <[email protected]>: > > Hello all, > > currently we start to write tests for our classes. On class we want to > test is 'Page' with inherits from WContainerWidget. The problem occure > during the cleanup (DTOR) from WWidget. Because of we write unittests without > any dependency to the remaining project we create our page without an > WApplication. During the call of the destructor, WWidget fetches the > WApplication > (which is zero) and want to call sessen. Now it crashs because of the non > existing WApplication object. > > > > Now here is my question: > > Exists there are any mechanism to create a dummy WApplication object or > other ways to test the ctor/dtor of WWContainerWidget without using the > WRun mechanism. > > Yes, you can: you can pass it a WTestEnvironment. See for example > test/chart/WChartTest.C in the Wt distribution. > > eg.: > > void mytest() > { > Wt::Test::WTestEnvironment environment; > Wt::WApplication app(environment); > > ... > } > > Regards, > koen > > ------------------------------------------------------------------------------ > > _______________________________________________ > witty-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/witty-interest ------------------------------------------------------------------------------ _______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
