Index: /trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp
===================================================================
--- /trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp	(revision 50438)
+++ /trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp	(revision 50439)
@@ -39,4 +39,5 @@
 *******************************************************************************/
 static RTTEST g_hTest;
+static Bstr   tstMachineName = "tstVBoxAPI test VM";
 
 
@@ -54,5 +55,4 @@
 
 
-
 static BOOL tstApiIVirtualBox(IVirtualBox *pVBox)
 {
@@ -121,5 +121,4 @@
     RTTestSub(g_hTest, "IVirtualBox::CreateMachine");
     ComPtr<IMachine> ptrMachine;
-    Bstr tstMachineName = "tstVBoxAPI test VM";
     com::SafeArray<BSTR> groups;
     /** Default VM settings */
@@ -181,5 +180,5 @@
             {
                 Bstr tmpName;
-                CHECK_ERROR(machines[i], COMGETTER(Name)(tmpName.asOutParam()));
+                rc = machines[i]->COMGETTER(Name)(tmpName.asOutParam());
                 if (SUCCEEDED(rc))
                 {
@@ -333,4 +332,12 @@
         RTTestFailed(g_hTest, "%d: IVirtualBox::genericNetworkDrivers failed", __LINE__);
 
+    return TRUE;
+}
+
+
+static BOOL tstApiClean(IVirtualBox *pVBox)
+{
+    HRESULT rc;
+
     /** Delete created VM and its files */
     ComPtr<IMachine> machine;
@@ -345,5 +352,4 @@
     return TRUE;
 }
-
 
 
@@ -379,4 +385,8 @@
                 /** Test IVirtualBox interface */
                 tstApiIVirtualBox(ptrVBox);
+
+
+                /** Clean files/configs */
+                tstApiClean(ptrVBox);
             }
         }
