test/sequence_test.cc
author Volker Birk <vb@pep-project.org>
Mon, 16 May 2016 17:53:24 +0200
changeset 637 d93d1fe6a24c
child 654 0aa96447e38f
permissions -rw-r--r--
test and Make
vb@637
     1
#include <iostream>
vb@637
     2
#include <string>
vb@637
     3
#include <assert.h>
vb@637
     4
#include "pEpEngine.h"
vb@637
     5
vb@637
     6
using namespace std;
vb@637
     7
vb@637
     8
int main() {
vb@637
     9
    cout << "\n*** sequence_test ***\n\n";
vb@637
    10
vb@637
    11
    PEP_SESSION session;
vb@637
    12
    
vb@637
    13
    cout << "calling init()\n";
vb@637
    14
    PEP_STATUS status1 = init(&session);   
vb@637
    15
    assert(status1 == PEP_STATUS_OK);
vb@637
    16
    assert(session);
vb@637
    17
    cout << "init() completed.\n";
vb@637
    18
vb@637
    19
    // sequence test code
vb@637
    20
vb@637
    21
    int64_t value1;
vb@637
    22
    PEP_STATUS status2 = sequence_value(session, "test", &value1);
vb@637
    23
    assert(status2 == PEP_STATUS_OK);
vb@637
    24
vb@637
    25
    cout << "test sequence: " << value1 << "\n";
vb@637
    26
vb@637
    27
    int64_t value2;
vb@637
    28
    PEP_STATUS status3 = sequence_value(session, "test", &value2);
vb@637
    29
    assert(status3 == PEP_STATUS_OK);
vb@637
    30
vb@637
    31
    cout << "test sequence: " << value2 << "\n";
vb@637
    32
    assert(value2 == value1 + 1);
vb@637
    33
vb@637
    34
    cout << "calling release()\n";
vb@637
    35
    release(session);
vb@637
    36
    return 0;
vb@637
    37
}
vb@637
    38