test/sequence_test.cc
author Edouard Tisserant
Thu, 09 Jun 2016 19:19:46 +0200
branchimport_own_key
changeset 727 382718692559
parent 654 0aa96447e38f
child 1085 9db2d7650ddc
permissions -rw-r--r--
branched
     1 #include <iostream>
     2 #include <string>
     3 #include <assert.h>
     4 #include "pEpEngine.h"
     5 
     6 using namespace std;
     7 
     8 int main() {
     9     cout << "\n*** sequence_test ***\n\n";
    10 
    11     PEP_SESSION session;
    12     
    13     cout << "calling init()\n";
    14     PEP_STATUS status1 = init(&session);   
    15     assert(status1 == PEP_STATUS_OK);
    16     assert(session);
    17     cout << "init() completed.\n";
    18 
    19     // sequence test code
    20 
    21     int32_t value1;
    22     PEP_STATUS status2 = sequence_value(session, "test", &value1);
    23     assert(status2 == PEP_STATUS_OK);
    24 
    25     cout << "test sequence: " << value1 << "\n";
    26 
    27     int32_t value2;
    28     PEP_STATUS status3 = sequence_value(session, "test", &value2);
    29     assert(status3 == PEP_STATUS_OK);
    30 
    31     cout << "test sequence: " << value2 << "\n";
    32     assert(value2 == value1 + 1);
    33 
    34     cout << "calling release()\n";
    35     release(session);
    36     return 0;
    37 }
    38