unit test template
authorvb
Sun, 08 Feb 2015 13:42:23 -0500
changeset 53d9eacd197962
parent 52 a667998cedf1
child 54 8f6b3a6b77a8
unit test template
test/_test_template_cc
test/message_api_test.cc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/_test_template_cc	Sun Feb 08 13:42:23 2015 -0500
     1.3 @@ -0,0 +1,26 @@
     1.4 +#include <iostream>
     1.5 +#include <string>
     1.6 +#include <assert.h>
     1.7 +#include "MODULE.h"
     1.8 +
     1.9 +using namespace std;
    1.10 +
    1.11 +int main() {
    1.12 +    cout << "\n*** MODULE_test ***\n\n";
    1.13 +
    1.14 +    PEP_SESSION session;
    1.15 +    
    1.16 +    cout << "calling init()\n";
    1.17 +    PEP_STATUS status1 = init(&session);   
    1.18 +    assert(status1 == PEP_STATUS_OK);
    1.19 +    assert(session);
    1.20 +    cout << "init() completed.\n";
    1.21 +
    1.22 +    // MODULE test code
    1.23 +
    1.24 +
    1.25 +    cout << "calling release()\n";
    1.26 +    release(session);
    1.27 +    return 0;
    1.28 +}
    1.29 +
     2.1 --- a/test/message_api_test.cc	Sun Feb 08 13:29:20 2015 -0500
     2.2 +++ b/test/message_api_test.cc	Sun Feb 08 13:42:23 2015 -0500
     2.3 @@ -5,7 +5,7 @@
     2.4  using namespace std;
     2.5  
     2.6  int main() {
     2.7 -    cout << "*** message_api_test ***\n\n";
     2.8 +    cout << "\n*** message_api_test ***\n\n";
     2.9  
    2.10      PEP_SESSION session;
    2.11      
    2.12 @@ -15,6 +15,8 @@
    2.13      assert(session);
    2.14      cout << "init() completed.\n";
    2.15  
    2.16 +    // message_api test code
    2.17 +
    2.18      cout << "creating message…\n";
    2.19      pEp_identity * me = new_identity("outlooktest@dingens.org", NULL, "23", "Outlook Test");
    2.20      me->me = true;