test/i18n_test.cc
author Krista Bennett <krista@pep-project.org>
Fri, 19 Jan 2018 14:12:02 +0100
changeset 2418 05678e77bc6a
parent 1513 e7f7e42385b5
permissions -rw-r--r--
fixed update_identity call that could be called on a myself value in outgoing_message_rating
vb@1513
     1
// This file is under GNU General Public License 3.0
vb@1513
     2
// see LICENSE.txt
vb@1513
     3
vb@460
     4
#include <iostream>
vb@460
     5
#include <string>
vb@460
     6
#include <assert.h>
vb@460
     7
#include "pEpEngine.h"
vb@460
     8
vb@460
     9
using namespace std;
vb@460
    10
vb@460
    11
int main() {
vb@460
    12
    cout << "\n*** i18n_test ***\n\n";
vb@460
    13
vb@460
    14
    PEP_SESSION session;
vb@460
    15
    
vb@460
    16
    cout << "calling init()\n";
vb@460
    17
    PEP_STATUS status1 = init(&session);   
vb@460
    18
    assert(status1 == PEP_STATUS_OK);
vb@460
    19
    assert(session);
vb@460
    20
    cout << "init() completed.\n";
vb@460
    21
vb@460
    22
    // i18n test code
vb@460
    23
vb@460
    24
    char *languages;
vb@460
    25
    PEP_STATUS status2 = get_languagelist(session, &languages);
vb@460
    26
    assert(status2 == PEP_STATUS_OK);
vb@460
    27
    assert(languages);
vb@460
    28
vb@460
    29
    cout << languages;
vb@460
    30
    pEp_free(languages);
vb@460
    31
vb@460
    32
    char *phrase;
vb@556
    33
    PEP_STATUS status3 = get_phrase(session, "de", 1000, &phrase);
vb@460
    34
    assert(status3 == PEP_STATUS_OK);
vb@460
    35
    assert(phrase);
vb@460
    36
vb@460
    37
    cout << "\nGerman: " << phrase << "\n";
vb@460
    38
    pEp_free(phrase);
vb@460
    39
vb@556
    40
    status3 = get_phrase(session, "zz", 1000, &phrase);
vb@461
    41
    assert(status3 == PEP_PHRASE_NOT_FOUND);
vb@461
    42
    assert(phrase == NULL);
vb@461
    43
vb@460
    44
    cout << "calling release()\n";
vb@460
    45
    release(session);
vb@460
    46
    return 0;
vb@460
    47
}
vb@460
    48