test/i18n_test.cc
author Krista Bennett <krista@pep-project.org>
Wed, 14 Jun 2017 18:52:55 +0200
branchENGINE-215
changeset 1856 99348d336639
parent 1513 e7f7e42385b5
permissions -rw-r--r--
ENGINE-215: needs to be tested, test cases impacted by the change need to be adjusted
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #include <iostream>
     5 #include <string>
     6 #include <assert.h>
     7 #include "pEpEngine.h"
     8 
     9 using namespace std;
    10 
    11 int main() {
    12     cout << "\n*** i18n_test ***\n\n";
    13 
    14     PEP_SESSION session;
    15     
    16     cout << "calling init()\n";
    17     PEP_STATUS status1 = init(&session);   
    18     assert(status1 == PEP_STATUS_OK);
    19     assert(session);
    20     cout << "init() completed.\n";
    21 
    22     // i18n test code
    23 
    24     char *languages;
    25     PEP_STATUS status2 = get_languagelist(session, &languages);
    26     assert(status2 == PEP_STATUS_OK);
    27     assert(languages);
    28 
    29     cout << languages;
    30     pEp_free(languages);
    31 
    32     char *phrase;
    33     PEP_STATUS status3 = get_phrase(session, "de", 1000, &phrase);
    34     assert(status3 == PEP_STATUS_OK);
    35     assert(phrase);
    36 
    37     cout << "\nGerman: " << phrase << "\n";
    38     pEp_free(phrase);
    39 
    40     status3 = get_phrase(session, "zz", 1000, &phrase);
    41     assert(status3 == PEP_PHRASE_NOT_FOUND);
    42     assert(phrase == NULL);
    43 
    44     cout << "calling release()\n";
    45     release(session);
    46     return 0;
    47 }
    48