test/message_api_test.cc
changeset 40 3e7aa2f67b7e
parent 39 66b5cc6cb987
child 45 37a80387790d
     1.1 --- a/test/message_api_test.cc	Tue Dec 30 13:04:17 2014 +0100
     1.2 +++ b/test/message_api_test.cc	Tue Dec 30 18:39:59 2014 +0100
     1.3 @@ -13,13 +13,26 @@
     1.4      assert(session);
     1.5      cout << "init() completed.\n";
     1.6  
     1.7 +    cout << "creating message…\n";
     1.8      pEp_identity * me = new_identity("outlooktest@dingens.org", NULL, "23", "Outlook Test");
     1.9      me->me = true;
    1.10      identity_list *to = new_identity_list(new_identity("vb@dingens.org", NULL, "42", "Volker Birk"));
    1.11 +    message *msg = new_message(PEP_dir_outgoing, me, to, "hello, world");
    1.12 +    assert(msg);
    1.13 +    cout << "message created.\n";
    1.14  
    1.15 -    message *msg = new_message(PEP_dir_outgoing, me, to, "hello, world");
    1.16 +    cout << "encrypting message…\n";
    1.17 +    message *enc_msg;
    1.18 +    cout << "calling encrypt_message()\n";
    1.19 +    PEP_STATUS status2 = encrypt_message(session, msg, NULL, &enc_msg, PEP_enc_pieces);
    1.20 +    assert(status2 == PEP_STATUS_OK);
    1.21 +    assert(enc_msg);
    1.22 +    cout << "message encrypted.\n";
    1.23  
    1.24 +    cout << "freeing messages…\n";
    1.25      free_message(msg);
    1.26 +    free_message(enc_msg);
    1.27 +    cout << "done.\n";
    1.28  
    1.29      cout << "calling release()\n";
    1.30      release(session);