test/i18n_test.cc
author Edouard Tisserant <edouard@pep-project.org>
Mon, 24 Oct 2016 21:46:30 +0200
branchkeysync
changeset 1336 f1ee8497bbfd
parent 556 90576c91102b
child 1513 e7f7e42385b5
permissions -rw-r--r--
closed branch
     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*** i18n_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     // i18n test code
    20 
    21     char *languages;
    22     PEP_STATUS status2 = get_languagelist(session, &languages);
    23     assert(status2 == PEP_STATUS_OK);
    24     assert(languages);
    25 
    26     cout << languages;
    27     pEp_free(languages);
    28 
    29     char *phrase;
    30     PEP_STATUS status3 = get_phrase(session, "de", 1000, &phrase);
    31     assert(status3 == PEP_STATUS_OK);
    32     assert(phrase);
    33 
    34     cout << "\nGerman: " << phrase << "\n";
    35     pEp_free(phrase);
    36 
    37     status3 = get_phrase(session, "zz", 1000, &phrase);
    38     assert(status3 == PEP_PHRASE_NOT_FOUND);
    39     assert(phrase == NULL);
    40 
    41     cout << "calling release()\n";
    42     release(session);
    43     return 0;
    44 }
    45