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
vb@509
     1
#include <iostream>
vb@509
     2
#include <string>
vb@509
     3
#include <assert.h>
vb@509
     4
#include "message_api.h"
vb@509
     5
vb@509
     6
using namespace std;
vb@509
     7
vb@509
     8
int main() {
vb@509
     9
    cout << "\n*** pgp_binary_test ***\n\n";
vb@509
    10
vb@509
    11
    PEP_SESSION session;
vb@509
    12
    
vb@509
    13
    cout << "calling init()\n";
vb@509
    14
    PEP_STATUS status1 = init(&session);   
vb@509
    15
    assert(status1 == PEP_STATUS_OK);
vb@509
    16
    assert(session);
vb@509
    17
    cout << "init() completed.\n";
vb@509
    18
vb@509
    19
    // pgp_binary test code
vb@509
    20
vb@509
    21
    const char *path;
vb@509
    22
    PEP_STATUS status2 = get_binary_path(PEP_crypt_OpenPGP, &path);
vb@509
    23
    assert(status2 == PEP_STATUS_OK);
vb@513
    24
#ifdef USE_GPG
vb@513
    25
    assert(path);
vb@513
    26
#endif
vb@509
    27
    if (path)
vb@509
    28
        cout << "PGP binary at " << path << "\n";
vb@509
    29
    else
vb@509
    30
        cout << "no PGP binary path available\n";
vb@509
    31
vb@509
    32
    cout << "calling release()\n";
vb@509
    33
    release(session);
vb@509
    34
    return 0;
vb@509
    35
}
vb@509
    36