test/pgp_binary_test.cc
author Krista Bennett <krista@pep-project.org>
Fri, 01 Jun 2018 10:27:30 +0200
branchENGINE-135
changeset 2708 11e836fe7f0a
parent 1513 e7f7e42385b5
permissions -rw-r--r--
close branch
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #include <iostream>
     5 #include <string>
     6 #include <assert.h>
     7 #include "message_api.h"
     8 
     9 using namespace std;
    10 
    11 int main() {
    12     cout << "\n*** pgp_binary_test ***\n\n";
    13 
    14     PEP_SESSION session;
    15     
    16     cout << "calling init()\n";
    17     PEP_STATUS status1 = init(&session);   
    18     assert(status1 == PEP_STATUS_OK);
    19     assert(session);
    20     cout << "init() completed.\n";
    21 
    22     // pgp_binary test code
    23 
    24     const char *path;
    25     PEP_STATUS status2 = get_binary_path(PEP_crypt_OpenPGP, &path);
    26     assert(status2 == PEP_STATUS_OK);
    27 #ifdef USE_GPG
    28     assert(path);
    29 #endif
    30     if (path)
    31         cout << "PGP binary at " << path << "\n";
    32     else
    33         cout << "no PGP binary path available\n";
    34 
    35     cout << "calling release()\n";
    36     release(session);
    37     return 0;
    38 }
    39