test/message_api_test.cc
changeset 39 66b5cc6cb987
child 40 3e7aa2f67b7e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/message_api_test.cc	Tue Dec 30 13:04:17 2014 +0100
     1.3 @@ -0,0 +1,28 @@
     1.4 +#include <iostream>
     1.5 +#include <assert.h>
     1.6 +#include "message_api.h"
     1.7 +
     1.8 +using namespace std;
     1.9 +
    1.10 +int main() {
    1.11 +    PEP_SESSION session;
    1.12 +    
    1.13 +    cout << "calling init()\n";
    1.14 +    PEP_STATUS status1 = init(&session);   
    1.15 +    assert(status1 == PEP_STATUS_OK);
    1.16 +    assert(session);
    1.17 +    cout << "init() completed.\n";
    1.18 +
    1.19 +    pEp_identity * me = new_identity("outlooktest@dingens.org", NULL, "23", "Outlook Test");
    1.20 +    me->me = true;
    1.21 +    identity_list *to = new_identity_list(new_identity("vb@dingens.org", NULL, "42", "Volker Birk"));
    1.22 +
    1.23 +    message *msg = new_message(PEP_dir_outgoing, me, to, "hello, world");
    1.24 +
    1.25 +    free_message(msg);
    1.26 +
    1.27 +    cout << "calling release()\n";
    1.28 +    release(session);
    1.29 +    return 0;
    1.30 +}
    1.31 +