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
     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", 1, &phrase);
    31     assert(status3 == PEP_STATUS_OK);
    32     assert(phrase);
    33 
    34     cout << "\nGerman: " << phrase << "\n";
    35     pEp_free(phrase);
    36 
    37     cout << "calling release()\n";
    38     release(session);
    39     return 0;
    40 }
    41