test/i18n_test.cc
author Volker Birk <vb@pep-project.org>
Sun, 21 Feb 2016 22:48:35 +0100
changeset 460 1a83b8144619
child 461 262ffb42e277
permissions -rw-r--r--
unittest file
vb@460
     1
#include <iostream>
vb@460
     2
#include <string>
vb@460
     3
#include <assert.h>
vb@460
     4
#include "pEpEngine.h"
vb@460
     5
vb@460
     6
using namespace std;
vb@460
     7
vb@460
     8
int main() {
vb@460
     9
    cout << "\n*** i18n_test ***\n\n";
vb@460
    10
vb@460
    11
    PEP_SESSION session;
vb@460
    12
    
vb@460
    13
    cout << "calling init()\n";
vb@460
    14
    PEP_STATUS status1 = init(&session);   
vb@460
    15
    assert(status1 == PEP_STATUS_OK);
vb@460
    16
    assert(session);
vb@460
    17
    cout << "init() completed.\n";
vb@460
    18
vb@460
    19
    // i18n test code
vb@460
    20
vb@460
    21
    char *languages;
vb@460
    22
    PEP_STATUS status2 = get_languagelist(session, &languages);
vb@460
    23
    assert(status2 == PEP_STATUS_OK);
vb@460
    24
    assert(languages);
vb@460
    25
vb@460
    26
    cout << languages;
vb@460
    27
    pEp_free(languages);
vb@460
    28
vb@460
    29
    char *phrase;
vb@460
    30
    PEP_STATUS status3 = get_phrase(session, "de", 1, &phrase);
vb@460
    31
    assert(status3 == PEP_STATUS_OK);
vb@460
    32
    assert(phrase);
vb@460
    33
vb@460
    34
    cout << "\nGerman: " << phrase << "\n";
vb@460
    35
    pEp_free(phrase);
vb@460
    36
vb@460
    37
    cout << "calling release()\n";
vb@460
    38
    release(session);
vb@460
    39
    return 0;
vb@460
    40
}
vb@460
    41