test/pEpEngineTest.cc
changeset 8 26cc9f0228f4
parent 0 16f27efbef98
child 9 41e66a54f03e
     1.1 --- a/test/pEpEngineTest.cc	Fri Jul 11 12:07:26 2014 +0200
     1.2 +++ b/test/pEpEngineTest.cc	Fri Jul 11 17:43:11 2014 +0200
     1.3 @@ -8,10 +8,6 @@
     1.4  #include "../src/pEpEngine.h"
     1.5  #include "../src/keymanagement.h"
     1.6  
     1.7 -#ifdef _WIN32
     1.8 -#define strdup _strdup
     1.9 -#endif
    1.10 -
    1.11  using namespace std;
    1.12  
    1.13  int main(int argc, char* argv[])
    1.14 @@ -165,10 +161,10 @@
    1.15  	pEp_identity *identity;
    1.16  
    1.17      identity = new_identity(
    1.18 -            strdup("leon.schumacher@digitalekho.com"),
    1.19 -            strdup("8BD08954C74D830EEFFB5DEB2682A17F7C87F73D"),
    1.20 -            strdup("23"),
    1.21 -            strdup("Leon Schumacher")
    1.22 +            "leon.schumacher@digitalekho.com",
    1.23 +            "8BD08954C74D830EEFFB5DEB2682A17F7C87F73D",
    1.24 +            "23",
    1.25 +            "Leon Schumacher"
    1.26          );
    1.27  	identity->comm_type = PEP_ct_pEp;
    1.28  
    1.29 @@ -179,8 +175,15 @@
    1.30  	get_identity(session, "leon.schumacher@digitalekho.com", &identity);
    1.31  	assert(identity);
    1.32  	cout << "set: " << identity->address << ", " << identity->fpr << ", " << identity->user_id << ", " << identity->username << "\n";
    1.33 +
    1.34 +    PEP_STATUS get_trust_result = get_trust(session, identity);
    1.35 +    assert(get_trust_result == PEP_STATUS_OK);
    1.36 +    cout << "trust of " << identity->user_id << " is " << identity->comm_type << "\n";
    1.37 +
    1.38      free_identity(identity);
    1.39  
    1.40 +    // testing key management
    1.41 +
    1.42      stringlist_t *addresses = new_stringlist("leon.schumacher@digitalekho.com");
    1.43      PEP_comm_type comm_type;
    1.44      cout << "\nretrieving communication type for leon.schumacher@digitalekho.com\n";
    1.45 @@ -200,10 +203,10 @@
    1.46  
    1.47      cout << "\ngenerating key for testuser\n";
    1.48      identity = new_identity(
    1.49 -            strdup("testuser@pibit.ch"),
    1.50 +            "testuser@pibit.ch",
    1.51              NULL,
    1.52 -            strdup("423"),
    1.53 -            strdup("Alfred E. Neuman")
    1.54 +            "423",
    1.55 +            "Alfred E. Neuman"
    1.56          );
    1.57      assert(identity);
    1.58      PEP_STATUS generate_status = generate_keypair(session, identity);