예제 #1
0
// Things that should be tested:
// extreme values (0 - big) for putData
// segmentation (setMaxSendSegmentSize())
// performance: packets/second (depending on packet size and # of participants)
int main(int argc, char *argv[])
{
    int result = 0;
    bool send = false;
    bool recv = false;

    RecvPacketTransmissionTest *rx;
    SendPacketTransmissionTest *tx;

    // accept as parameter if must run as --send or --recv

    // run several tests in parallel threads
    if ( send ) {
        tx = new SendPacketTransmissionTest();
        tx->start();
        tx->join();
    } else  if ( recv ) {
        rx = new RecvPacketTransmissionTest();
        rx->start();
        rx->join();
    } else {
        MiscTest m;
        m.start();
        m.join();
    }
    exit(result);
}
예제 #2
0
파일: ccrtptest.cpp 프로젝트: dyfet/ccrtp
// Things that should be tested:
// extreme values (0 - big) for putData
// segmentation (setMaxSendSegmentSize())
// performance: packets/second (depending on packet size and # of participants)
int main(int argc, char *argv[])
{
    int result = 0;
    bool send = false;
    bool recv = false;

    // accept as parameter if must run as --send or --recv
    for (int i = 1; i < argc; ++i) {
        send |= !strcmp(argv[i], "-s") or !strcmp(argv[i], "--send");
        if ( send )
            break;
        recv |= !strcmp(argv[i], "-r") or !strcmp(argv[i], "--recv");
        if ( recv )
            break;
    }

    // run several tests in parallel threads
    if ( send ) {
        SendPacketTransmissionTest tx;
        tx.start();
        tx.join();
    } else  if ( recv ) {
        RecvPacketTransmissionTest rx;
        rx.start();
        rx.join();
    } else {
        MiscTest m;
        m.start();
        m.join();
    }
    exit(result);
}
예제 #3
0
int main(int argc, char *argv[])
{
    int result = 0;
    bool send = false;
    bool recv = false;

    char c;

    /* check args */
    while (1) {
        c = getopt(argc, argv, "rsR:S:");
        if (c == -1) {
            break;
        }
        switch (c) {
        case 'r':
            recv = true;
            break;
        case 's':
            send = true;
            break;
        case 'R':
            pattern.setReceiverAddress(new InetHostAddress(optarg));
            break;
        case 'S':
            pattern.setSenderAddress(new InetHostAddress(optarg));
            break;
        default:
            cerr << "Wrong Arguments, only -s and -r are accepted" << endl;
        }
    }

    if (send || recv) {
        if (send) {
            cout << "Running as sender" << endl;
        }
        else {
            cout << "Running as receiver" << endl;
        }
    }
    else {
        cerr << "No send or receive argument specificied" << endl;
        exit(1);
    }

    // accept as parameter if must run as --send or --recv

#if 0
     RecvPacketTransmissionTest *rx;
     SendPacketTransmissionTest *tx;

    // run several tests in parallel threads
    if ( send ) {
        tx = new SendPacketTransmissionTest();
        tx->start();
        tx->join();
    } else if ( recv ) {
        rx = new RecvPacketTransmissionTest();
        rx->start();
        rx->join();
    }
//#endif
//#if 0
    ZrtpRecvPacketTransmissionTest *zrx;
    ZrtpSendPacketTransmissionTest *ztx;

    if ( send ) {
        ztx = new ZrtpSendPacketTransmissionTest();
        ztx->start();
        ztx->join();
    } else if ( recv ) {
        zrx = new ZrtpRecvPacketTransmissionTest();
        zrx->start();
        zrx->join();
    }
#endif
    ZrtpRecvPacketTransmissionTestCB *zrxcb;
    ZrtpSendPacketTransmissionTestCB *ztxcb;

    if ( send ) {
        ztxcb = new ZrtpSendPacketTransmissionTestCB();
        ztxcb->start();
        ztxcb->join();
    } else if ( recv ) {
        zrxcb = new ZrtpRecvPacketTransmissionTestCB();
        zrxcb->start();
        zrxcb->join();
    }

    exit(result);
}