cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcliwrapper/ut_psetcliwrapper.cpp
--- a/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcliwrapper/ut_psetcliwrapper.cpp Fri Mar 19 09:40:14 2010 +0200
+++ b/cellular/telephonysettings/xqbindings/psetwrapper/tsrc/ut_psetcliwrapper/ut_psetcliwrapper.cpp Fri Apr 16 15:31:58 2010 +0300
@@ -16,10 +16,10 @@
*/
#include <PsetContainer.h>
-#include <MPsetCliObserver.h>
+#include <mpsetcliobserver.h>
#include <psetwrappertypes.h>
#include <PsetCli.h>
-#include <PsuiConstants.h>
+#include <psuiconstants.h>
#include "ut_psetcliwrapper.h"
#include "testutilities.h"
#define private public
@@ -62,6 +62,12 @@
}
};
+void SimulateLeaveL()
+{
+ User::Leave(KErrGeneral);
+}
+
+
/*!
UT_PSetCliWrapper::UT_PSetCliWrapper
*/
@@ -121,6 +127,25 @@
}
/*!
+ UT_PSetCliWrapper::t_construction
+ */
+void UT_PSetCliWrapper::t_construction()
+{
+ if (qstrcmp(QTest::currentTestFunction(), "t_exceptionSafety") != 0) {
+ expect("CPsetContainer::CreateCliObjectL").
+ willOnce(invokeWithoutArguments(SimulateLeaveL));
+
+ PSetCliWrapper *wrapper = NULL;
+ EXPECT_EXCEPTION(
+ wrapper = new PSetCliWrapper(*m_psetContainerMock, NULL);
+ )
+ delete wrapper;
+
+ QVERIFY(verify());
+ }
+}
+
+/*!
UT_PSetCliWrapper::t_getColpMode
*/
void UT_PSetCliWrapper::t_getColpMode()
@@ -329,19 +354,7 @@
{
cleanup();
- OomTestExecuter::runTest(*this, &t_getColpMode);
- OomTestExecuter::runTest(*this, &t_getClipMode);
- OomTestExecuter::runTest(*this, &t_getClirMode);
- OomTestExecuter::runTest(*this, &t_getColrMode);
- OomTestExecuter::runTest(*this, &t_getCnap);
- OomTestExecuter::runTest(*this, &t_cancelAll);
-
-// OomTestExecuter::runTest(*this, &t_handleCliRequesting);
-// OomTestExecuter::runTest(*this, &t_cliInformation);
-// OomTestExecuter::runTest(*this, &t_handleCliStatus);
-// OomTestExecuter::runTest(*this, &t_handleCnapStatus);
-// OomTestExecuter::runTest(*this, &t_handleCliError);
-// OomTestExecuter::runTest(*this, &t_setEngineContact);
+ OomTestExecuter::runAllTests(*this, "t_exceptionSafety");
}
void UT_PSetCliWrapper::SimulateLeaveAtMockMethodCallL()