adding test
authorVolker Birk <vb@pep-project.org>
Wed, 16 Mar 2016 11:35:12 +0100
changeset 509e5973d08c6c9
parent 508 a4710d4c678a
child 510 fa26f8ffe06b
child 513 2b4337ce0819
adding test
test/pgp_binary_test.cc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/pgp_binary_test.cc	Wed Mar 16 11:35:12 2016 +0100
     1.3 @@ -0,0 +1,33 @@
     1.4 +#include <iostream>
     1.5 +#include <string>
     1.6 +#include <assert.h>
     1.7 +#include "message_api.h"
     1.8 +
     1.9 +using namespace std;
    1.10 +
    1.11 +int main() {
    1.12 +    cout << "\n*** pgp_binary_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 +    // pgp_binary test code
    1.23 +
    1.24 +    const char *path;
    1.25 +    PEP_STATUS status2 = get_binary_path(PEP_crypt_OpenPGP, &path);
    1.26 +    assert(status2 == PEP_STATUS_OK);
    1.27 +    if (path)
    1.28 +        cout << "PGP binary at " << path << "\n";
    1.29 +    else
    1.30 +        cout << "no PGP binary path available\n";
    1.31 +
    1.32 +    cout << "calling release()\n";
    1.33 +    release(session);
    1.34 +    return 0;
    1.35 +}
    1.36 +