test/i18n_test.cc
changeset 460 1a83b8144619
child 461 262ffb42e277
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/i18n_test.cc	Sun Feb 21 22:48:35 2016 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +#include <iostream>
     1.5 +#include <string>
     1.6 +#include <assert.h>
     1.7 +#include "pEpEngine.h"
     1.8 +
     1.9 +using namespace std;
    1.10 +
    1.11 +int main() {
    1.12 +    cout << "\n*** i18n_test ***\n\n";
    1.13 +
    1.14 +    PEP_SESSION session;
    1.15 +    
    1.16 +    cout << "calling init()\n";
    1.17 +    PEP_STATUS status1 = init(&session);   
    1.18 +    assert(status1 == PEP_STATUS_OK);
    1.19 +    assert(session);
    1.20 +    cout << "init() completed.\n";
    1.21 +
    1.22 +    // i18n test code
    1.23 +
    1.24 +    char *languages;
    1.25 +    PEP_STATUS status2 = get_languagelist(session, &languages);
    1.26 +    assert(status2 == PEP_STATUS_OK);
    1.27 +    assert(languages);
    1.28 +
    1.29 +    cout << languages;
    1.30 +    pEp_free(languages);
    1.31 +
    1.32 +    char *phrase;
    1.33 +    PEP_STATUS status3 = get_phrase(session, "de", 1, &phrase);
    1.34 +    assert(status3 == PEP_STATUS_OK);
    1.35 +    assert(phrase);
    1.36 +
    1.37 +    cout << "\nGerman: " << phrase << "\n";
    1.38 +    pEp_free(phrase);
    1.39 +
    1.40 +    cout << "calling release()\n";
    1.41 +    release(session);
    1.42 +    return 0;
    1.43 +}
    1.44 +