test/i18n_test.cc
author Edouard Tisserant <edouard@pep-project.org>
Mon, 24 Oct 2016 20:44:48 +0200
changeset 1329 876ad7615d75
parent 556 90576c91102b
child 1513 e7f7e42385b5
permissions -rw-r--r--
sync : fix encrypted sync messages not being injected when decrypted from non-sync session
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@556
    30
    PEP_STATUS status3 = get_phrase(session, "de", 1000, &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@556
    37
    status3 = get_phrase(session, "zz", 1000, &phrase);
vb@461
    38
    assert(status3 == PEP_PHRASE_NOT_FOUND);
vb@461
    39
    assert(phrase == NULL);
vb@461
    40
vb@460
    41
    cout << "calling release()\n";
vb@460
    42
    release(session);
vb@460
    43
    return 0;
vb@460
    44
}
vb@460
    45