VirtualBox

Changeset 3422 in vbox


Ignore:
Timestamp:
Jul 4, 2007 4:07:49 PM (18 years ago)
Author:
vboxsync
Message:

Main/testcase: Added mutability chek for properties that may be changed when the VM is saved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r3387 r3422  
    523523    {
    524524        ComPtr <IMachine> machine;
    525         Bstr name = "Windows XP";
     525        Bstr name = argc > 1 ? argv [1] : "dos";
    526526        printf ("Getting a machine object named '%ls'...\n", name.raw());
    527527        CHECK_ERROR_BREAK (virtualBox, FindMachine (name, machine.asOutParam()));
    528 //        printf ("Accessing the machine in read-only mode:\n");
    529 //        readAndChangeMachineSettings (machine);
    530 //        if (argc != 2)
    531 //        {
    532 //            printf("Error: a string has to be supplied!\n");
    533 //        }
    534 //        else
    535 //        {
    536 //            Bstr secureLabel = argv[1];
    537 //            machine->COMSETTER(ExtraData)(L"VBoxSDL/SecureLabel", secureLabel);
    538 //        }
    539     }
    540     while (FALSE);
     528        printf ("Accessing the machine in read-only mode:\n");
     529        readAndChangeMachineSettings (machine);
     530#if 0
     531        if (argc != 2)
     532        {
     533            printf ("Error: a string has to be supplied!\n");
     534        }
     535        else
     536        {
     537            Bstr secureLabel = argv[1];
     538            machine->COMSETTER(ExtraData)(L"VBoxSDL/SecureLabel", secureLabel);
     539        }
     540#endif
     541    }
     542    while (0);
    541543    printf ("\n");
    542544#endif
     
    709711    {
    710712        ComPtr <IMachine> machine;
    711         Bstr name = L"dos";
     713        Bstr name = argc > 1 ? argv [1] : "dos";
    712714        printf ("Getting a machine object named '%ls'...\n", name.raw());
    713715        CHECK_ERROR_BREAK (virtualBox, FindMachine (name, machine.asOutParam()));
     
    722724        printf ("Accessing the machine within the session:\n");
    723725        readAndChangeMachineSettings (sessionMachine, machine);
     726#if 0
     727        printf ("\n");
     728        printf ("Enabling the VRDP server (must succeed even if the VM is saved):\n");
     729        ComPtr <IVRDPServer> vrdp;
     730        CHECK_ERROR_BREAK (sessionMachine, COMGETTER(VRDPServer) (vrdp.asOutParam()));
     731        if (FAILED (vrdp->COMSETTER(Enabled) (TRUE)))
     732        {
     733            PRINT_ERROR_INFO (com::ErrorInfo (vrdp));
     734        }
     735        else
     736        {
     737            BOOL enabled = FALSE;
     738            CHECK_ERROR_BREAK (vrdp, COMGETTER(Enabled) (&enabled));
     739            printf ("VRDP server is %s\n", enabled ? "enabled" : "disabled");
     740        }
     741#endif
    724742#endif
    725743#if 0
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette