Changeset 101035 in vbox for trunk/src/VBox/Main/testcase
- Timestamp:
- Sep 7, 2023 8:59:15 AM (20 months ago)
- svn:sync-xref-src-repo-rev:
- 158992
- Location:
- trunk/src/VBox/Main/testcase
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/Makefile.kmk
r99770 r101035 48 48 tstMediumLock \ 49 49 tstSafeArray \ 50 tstSettings \ 50 51 tstBstr \ 51 52 tstGuid \ … … 294 295 tstSafeArray_SOURCES = tstSafeArray.cpp 295 296 297 298 # 299 # tstSettings 300 # 301 tstSettings_TEMPLATE = VBoxMainClientTstExe 302 tstSettings_INCS = \ 303 ../include \ 304 $(VBOX_MAIN_APIWRAPPER_INCS) \ 305 $(dir $(VBOX_XML_SCHEMADEFS_H)) 306 tstSettings_SOURCES = \ 307 tstSettings.cpp \ 308 ../src-all/HashedPw.cpp \ 309 ../xml/Settings.cpp 296 310 297 311 # … … 349 363 # generate rules. 350 364 include $(FILE_KBUILD_SUB_FOOTER) 351 -
trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp
r98103 r101035 65 65 66 66 67 static BOOLtstApiIVirtualBox(IVirtualBox *pVBox)67 static void tstApiIVirtualBox(IVirtualBox *pVBox) 68 68 { 69 69 HRESULT hrc; … … 128 128 RTTestFailed(g_hTest, "%d: IVirtualBox::guestOSTypes failed", __LINE__); 129 129 130 /** Create VM */ 130 /* For now we only test same-same architectures (host == guest). */ 131 PlatformArchitecture_T enmPlatformArch; 132 #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) 133 enmPlatformArch = PlatformArchitecture_x86; 134 #elif defined(RT_ARCH_ARM32) || defined(RT_ARCH_ARM64) 135 enmPlatformArch = PlatformArchitecture_ARM; 136 #else 137 # error "Port me!" 138 #endif 139 140 /* 141 * Host 142 */ 143 ComPtr<IHost> host; 144 RTTestSub(g_hTest, "IVirtualBox::host"); 145 CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam())); 146 if (SUCCEEDED(hrc)) 147 { 148 RTTestPassed(g_hTest, "IVirtualBox::host"); 149 CHECK_ERROR(host, COMGETTER(Architecture)(&enmPlatformArch)); 150 151 switch (enmPlatformArch) 152 { 153 case PlatformArchitecture_x86: 154 { 155 ComPtr<IHostX86> hostX86; 156 CHECK_ERROR(host, COMGETTER(X86)(hostX86.asOutParam())); 157 break; 158 } 159 160 default: 161 break; 162 } 163 } 164 else 165 RTTestFailed(g_hTest, "%d: IVirtualBox::host failed", __LINE__); 166 167 ComPtr<ISystemProperties> sysprop; 168 RTTestSub(g_hTest, "IVirtualBox::systemProperties"); 169 CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam())); 170 if (SUCCEEDED(hrc)) 171 { 172 RTTestPassed(g_hTest, "IVirtualBox::systemProperties"); 173 174 RTTestSub(g_hTest, "IVirtualBox::platform::::platformProperties"); 175 ComPtr<IPlatformProperties> platformprop; 176 CHECK_ERROR(sysprop, COMGETTER(Platform)(platformprop.asOutParam())); 177 BOOL fTemp; 178 CHECK_ERROR(platformprop, COMGETTER(ExclusiveHwVirt)(&fTemp)); 179 ULONG ulTemp; 180 CHECK_ERROR(platformprop, GetMaxNetworkAdapters(ChipsetType_PIIX3, &ulTemp)); 181 } 182 else 183 RTTestFailed(g_hTest, "%d: IVirtualBox::systemProperties failed", __LINE__); 184 185 /* 186 * VM 187 */ 131 188 RTTestSub(g_hTest, "IVirtualBox::CreateMachine"); 132 189 ComPtr<IMachine> ptrMachine; … … 135 192 CHECK_ERROR(pVBox, CreateMachine(NULL, /** Settings */ 136 193 tstMachineName.raw(), /** Name */ 194 enmPlatformArch, 137 195 ComSafeArrayAsInParam(groups), /** Groups */ 138 196 NULL, /** OS Type */ … … 147 205 { 148 206 RTTestFailed(g_hTest, "%d: IVirtualBox::CreateMachine failed", __LINE__); 149 return FALSE;207 return; 150 208 } 151 209 … … 157 215 { 158 216 RTTestFailed(g_hTest, "%d: IVirtualBox::RegisterMachine failed", __LINE__); 159 return FALSE; 160 } 161 162 ComPtr<IHost> host; 163 RTTestSub(g_hTest, "IVirtualBox::host"); 164 CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam())); 165 if (SUCCEEDED(hrc)) 166 { 167 /** @todo Add IHost testing here. */ 168 RTTestPassed(g_hTest, "IVirtualBox::host"); 169 } 170 else 171 RTTestFailed(g_hTest, "%d: IVirtualBox::host failed", __LINE__); 172 173 ComPtr<ISystemProperties> sysprop; 174 RTTestSub(g_hTest, "IVirtualBox::systemProperties"); 175 CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam())); 176 if (SUCCEEDED(hrc)) 177 { 178 /** @todo Add ISystemProperties testing here. */ 179 RTTestPassed(g_hTest, "IVirtualBox::systemProperties"); 180 } 181 else 182 RTTestFailed(g_hTest, "%d: IVirtualBox::systemProperties failed", __LINE__); 217 return; 218 } 183 219 184 220 com::SafeIfaceArray<IMachine> machines; 185 RTTestSub(g_hTest, "IVirtualBox::machines ");221 RTTestSub(g_hTest, "IVirtualBox::machines2"); 186 222 CHECK_ERROR(pVBox, COMGETTER(Machines)(ComSafeArrayAsOutParam(machines))); 187 223 if (SUCCEEDED(hrc)) 188 224 { 189 bool bFound = FALSE;225 bool fFound = FALSE; 190 226 for (size_t i = 0; i < machines.size(); ++i) 191 227 { … … 198 234 if (tmpName == tstMachineName) 199 235 { 200 bFound = TRUE;236 fFound = TRUE; 201 237 break; 202 238 } … … 205 241 } 206 242 207 if ( bFound)243 if (fFound) 208 244 RTTestPassed(g_hTest, "IVirtualBox::machines"); 209 245 else … … 212 248 else 213 249 RTTestFailed(g_hTest, "%d: IVirtualBox::machines failed", __LINE__); 250 251 RTTestSub(g_hTest, "IMachine::FirmwareSettings"); 252 ComPtr<IFirmwareSettings> ptrFirmwareSettings; 253 CHECK_ERROR(ptrMachine, COMGETTER(FirmwareSettings)(ptrFirmwareSettings.asOutParam())); 254 FirmwareType_T firmwareType; 255 CHECK_ERROR(ptrFirmwareSettings, COMGETTER(FirmwareType)(&firmwareType)); 256 257 // CHECK_ERROR(ptrMachine, LockMachine()); 258 // RTTestSub(g_hTest, "IMachine::saveSettings"); 259 // CHECK_ERROR(ptrMachine, SaveSettings()); 260 261 Bstr bstSettingsFile; 262 CHECK_ERROR(ptrMachine, COMGETTER(SettingsFilePath)(bstSettingsFile.asOutParam())); 263 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Settings file: %ls\n", bstSettingsFile.raw()); 264 // CHECK_ERROR(ptrMachine, UnlockMachine()); 214 265 215 266 #if 0 /** Not yet implemented */ … … 344 395 else 345 396 RTTestFailed(g_hTest, "%d: IVirtualBox::genericNetworkDrivers failed", __LINE__); 346 347 return TRUE;348 397 } 349 398 350 399 351 static BOOLtstApiClean(IVirtualBox *pVBox)400 static void tstApiClean(IVirtualBox *pVBox) 352 401 { 353 402 HRESULT hrc; … … 355 404 /** Delete created VM and its files */ 356 405 ComPtr<IMachine> machine; 357 CHECK_ERROR _RET(pVBox, FindMachine(Bstr(tstMachineName).raw(), machine.asOutParam()), FALSE);406 CHECK_ERROR(pVBox, FindMachine(Bstr(tstMachineName).raw(), machine.asOutParam())); 358 407 SafeIfaceArray<IMedium> media; 359 CHECK_ERROR_RET(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, 360 ComSafeArrayAsOutParam(media)), FALSE); 408 CHECK_ERROR(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(media))); 361 409 ComPtr<IProgress> progress; 362 CHECK_ERROR_RET(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam()), FALSE); 363 CHECK_ERROR_RET(progress, WaitForCompletion(-1), FALSE); 364 365 return TRUE; 410 CHECK_ERROR(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam())); 411 CHECK_ERROR(progress, WaitForCompletion(-1)); 366 412 } 367 413 … … 402 448 tstApiIVirtualBox(ptrVBox); 403 449 404 405 450 /** Clean files/configs */ 406 451 tstApiClean(ptrVBox); -
trunk/src/VBox/Main/testcase/tstVBoxAPIXPCOM.cpp
r99775 r101035 198 198 rc = virtualBox->CreateMachine(NULL, /* settings file */ 199 199 NS_LITERAL_STRING("A brand new name").get(), 200 PlatformArchitecture_x86, 200 201 0, nsnull, /* groups (safearray)*/ 201 202 nsnull, /* ostype */ -
trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp
r98103 r101035 334 334 /* Default VM settings */ 335 335 CHECK_ERROR_L(pVBox, CreateMachine(NULL, /* Settings */ 336 machineName.raw(), /* Name */ 337 ComSafeArrayAsInParam(groups), /* Groups */ 338 NULL, /* OS Type */ 339 NULL, /** Cipher */ 340 NULL, /** Password id */ 341 NULL, /** Password */ 342 NULL, /* Create flags */ 343 ptrMachine.asOutParam())); 336 machineName.raw(), /* Name */ 337 PlatformArchitecture_x86, 338 ComSafeArrayAsInParam(groups), /* Groups */ 339 NULL, /* OS Type */ 340 NULL, /** Cipher */ 341 NULL, /** Password id */ 342 NULL, /** Password */ 343 NULL, /* Create flags */ 344 ptrMachine.asOutParam())); 344 345 if (SUCCEEDED(hrc)) 345 346 {
Note:
See TracChangeset
for help on using the changeset viewer.