Date: Monday, December 18, 2006 @ 17:04:15
  Author: gilles
    Path: /cvsroot/carob/carob/test/10-Connection

Modified: TestConnect.cpp (1.11 -> 1.12)

Added catch of Unexpected exception in order to get clean failures


-----------------+
 TestConnect.cpp |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletion(-)


Index: carob/test/10-Connection/TestConnect.cpp
diff -u carob/test/10-Connection/TestConnect.cpp:1.11 
carob/test/10-Connection/TestConnect.cpp:1.12
--- carob/test/10-Connection/TestConnect.cpp:1.11       Mon Dec  4 15:14:35 2006
+++ carob/test/10-Connection/TestConnect.cpp    Mon Dec 18 17:04:15 2006
@@ -56,6 +56,12 @@
     logError(fctName, L"Connection failed (this is ok). Exception: "
         + ce.description());
   }
+  catch (CarobException unexpected)
+  {
+    logInfo(fctName, L"Caught other exception: " + unexpected.description());
+    // We should receive an exception instead of coming here
+    CPPUNIT_ASSERT(false);
+  }
 }
 
 void TestConnect::testConnectBadPort()
@@ -79,6 +85,12 @@
     logError(fctName, L"Connection failed (this is ok). Exception: "
         + ce.description());
   }
+  catch (CarobException unexpected)
+  {
+    logInfo(fctName, L"Caught other exception: " + unexpected.description());
+    // We should receive an exception instead of coming here
+    CPPUNIT_ASSERT(false);
+  }
 }
 void TestConnect::testConnectBadDB()
 {
@@ -93,7 +105,7 @@
   {
     connectionPtr = new Connection(connectionPrms);
     logInfo(fctName, L"Connecting to controller - should fail");
-    
+
     // We should receive an exception instead of coming here
     CPPUNIT_ASSERT(false);
   }
@@ -102,6 +114,12 @@
     logError(fctName, L"Connection failed (this is ok). Exception: "
         + ae.description());
   }
+  catch (CarobException unexpected)
+  {
+    logInfo(fctName, L"Caught other exception: " + unexpected.description());
+    // We should receive an exception instead of coming here
+    CPPUNIT_ASSERT(false);
+  }
 }
 
 void TestConnect::testConnectBadUser()
@@ -126,6 +144,12 @@
     logError(fctName, L"Connection failed (this is ok). Exception: "
         + ae.description());
   }
+  catch (CarobException unexpected)
+  {
+    logInfo(fctName, L"Caught other exception: " + unexpected.description());
+    // We should receive an exception instead of coming here
+    CPPUNIT_ASSERT(false);
+  }
 }
 
 void TestConnect::testConnectBadPass()
@@ -150,6 +174,12 @@
     logError(fctName, L"Connection failed (this is ok). Exception: "
         + ae.description());
   }
+  catch (CarobException unexpected)
+  {
+    logInfo(fctName, L"Caught other exception: " + unexpected.description());
+    // We should receive an exception instead of coming here
+    CPPUNIT_ASSERT(false);
+  }
 }
 
 void TestConnect::testConnectGood()

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to