mandag 15 December 2008 skrev jb: > On Monday 15 December 2008 08.39:36 Mads Bondo Dydensborg wrote: > > As kdenlive is clearly very much a GUI program major parts of kdenlive can > > not be unittested. However, some parts can. Right now I would like to > > create a unit test for part of the KdenliveDoc::convertDocument() function. > > I am capable of doing this, but would like to know beforehand if it would > > be OK with all? (Especially JB, I reckon). > > I have absolutely no experience in unit tests, but I admit that it would be > great to have an automated way to check the loading / saving of documents > whenever some changes are made to the kdenlive document format.
I will add something then. How about asserts? A number of functions could benefit from asserts, I think. Look at http://www.kdenlive.org/mantis/view.php?id=472 It crashes in: void ClipItem::setEffectAt(int ix, QDomElement effect) { kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag"); because m_effectList is empty. Would you mind me adding Q_ASSERT_X( m_effectList.size() > ix, "ClipItem::setEffectAt", QString( "Index ix = %1 is out of bounds, m_effectList.size() = %2. Kdenlive expected that more than ix effects were present" ). arg ( ix ). arg( m_effectList.size() ); or similar to that function? (I'll use the correct QString syntax, can't recall right now). And other places, where I stumble on similar situations? I know that QList will assert on debug builds, but it would be nice to get a bit more information. There are also a number of potential NULL references, that I would like to assert. Regards Mads -- Mads Bondo Dydensborg m...@dydensborg.dk http://www.madsdydensborg.dk/ Of course the people don't want war. But after all, it's the leaders of the country who determine the policy, and it's always a simple matter to drag the people along whether it's a democracy, a fascist dictatorship, or a parliament, or a communist dictatorship. Voice or no voice, the people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked, and denounce the pacifists for lack of patriotism, and exposing the country to greater danger. - Herman Goering at the Nuremberg trials ------------------------------------------------------------------------------ SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ _______________________________________________ Kdenlive-devel mailing list Kdenlive-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kdenlive-devel