test/pgp_binary_test.cc
author Volker Birk <vb@pep-project.org>
Thu, 17 Mar 2016 19:49:27 +0100
changeset 513 2b4337ce0819
parent 509 e5973d08c6c9
child 1513 e7f7e42385b5
permissions -rw-r--r--
GnuPG should be able to deliver the path
     1 #include <iostream>
     2 #include <string>
     3 #include <assert.h>
     4 #include "message_api.h"
     5 
     6 using namespace std;
     7 
     8 int main() {
     9     cout << "\n*** pgp_binary_test ***\n\n";
    10 
    11     PEP_SESSION session;
    12     
    13     cout << "calling init()\n";
    14     PEP_STATUS status1 = init(&session);   
    15     assert(status1 == PEP_STATUS_OK);
    16     assert(session);
    17     cout << "init() completed.\n";
    18 
    19     // pgp_binary test code
    20 
    21     const char *path;
    22     PEP_STATUS status2 = get_binary_path(PEP_crypt_OpenPGP, &path);
    23     assert(status2 == PEP_STATUS_OK);
    24 #ifdef USE_GPG
    25     assert(path);
    26 #endif
    27     if (path)
    28         cout << "PGP binary at " << path << "\n";
    29     else
    30         cout << "no PGP binary path available\n";
    31 
    32     cout << "calling release()\n";
    33     release(session);
    34     return 0;
    35 }
    36