Changeset 40:ec5dde8a6ff6 in xplra for test/basictest.cc


Ignore:
Timestamp:
02/14/13 18:21:47 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented the client support for the new commands and updated the basic test programs with tests showing messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/basictest.cc

    r36 r40  
    3131#include <hu/varadiistvan/xplra/XPlane.h>
    3232
     33#include <hu/varadiistvan/scpl/Thread.h>
     34
    3335#include <cstdio>
    3436#include <cstring>
     
    3941using hu::varadiistvan::xplra::Exception;
    4042using hu::varadiistvan::xplra::ProtocolException;
     43
     44using hu::varadiistvan::scpl::Thread;
    4145
    4246using std::string;
     
    5660        int xplmVersion = 0;
    5761        int xplraVersion = 0;
     62
     63        printf("Showing a message...\n");
     64        xplane.showMessage("[basictest] Starting tests", 5.0);
     65        printf("\n");
    5866
    5967        printf("Querying the versions...\n");
     
    242250        }
    243251
     252        printf("Preparing for the message tests, sleeping for 5 seconds...\n");
     253        Thread::sleep(5*1000);
     254
     255        printf("Showing a message for 10 seconds...\n");
     256        xplane.showMessage("[basictest] this message appears for 10 seconds", 10.0);
     257
     258        printf("Sleeping for 3 seconds...\n");
     259        Thread::sleep(3*1000);
     260
     261        printf("Showing another message interrupting the previous one for 3 seconds\n");
     262        xplane.showMessage("[basictest] but this message interrupts it, and is displayed for 3 seconds", 3.0);
     263
     264        printf("Sleeping for 5 seconds...\n");
     265        Thread::sleep(5*1000);
     266        xplane.showMessage("[basictest] and the tests come to an end!", 5.0);
    244267
    245268        return 0;
Note: See TracChangeset for help on using the changeset viewer.