test/pgp_binary_test.cc
author Volker Birk <vb@pep-project.org>
Wed, 16 Mar 2016 11:35:12 +0100
changeset 509 e5973d08c6c9
child 513 2b4337ce0819
permissions -rw-r--r--
adding test
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@509
    24
    if (path)
vb@509
    25
        cout << "PGP binary at " << path << "\n";
vb@509
    26
    else
vb@509
    27
        cout << "no PGP binary path available\n";
vb@509
    28
vb@509
    29
    cout << "calling release()\n";
vb@509
    30
    release(session);
vb@509
    31
    return 0;
vb@509
    32
}
vb@509
    33