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