test/message_api_test.cc
changeset 165 f0894860af4a
parent 116 e4d286e7b300
child 166 fefff48448e3
     1.1 --- a/test/message_api_test.cc	Mon Mar 30 07:35:11 2015 +0200
     1.2 +++ b/test/message_api_test.cc	Mon Mar 30 14:59:34 2015 +0200
     1.3 @@ -1,4 +1,6 @@
     1.4 +#include "platform.h"
     1.5  #include <iostream>
     1.6 +#include <fstream>
     1.7  #include <assert.h>
     1.8  #include "message_api.h"
     1.9  
    1.10 @@ -53,10 +55,16 @@
    1.11      message *msg3;
    1.12      PEP_STATUS status3 = mime_decode_message(text2, &msg3);
    1.13      assert(status3 == PEP_STATUS_OK);
    1.14 +    string string3 = text2;
    1.15 +    free(text2);
    1.16 +
    1.17 +    unlink("msg4.asc");
    1.18 +    ofstream outFile3("msg4.asc");
    1.19 +    outFile3.write(string3.c_str(), string3.size());
    1.20 +    outFile3.close();
    1.21  
    1.22      cout << "freeing messages…\n";
    1.23      free_message(msg3);
    1.24 -    free(text2);
    1.25      free_message(msg2);
    1.26      free_message(enc_msg2);
    1.27      cout << "done.\n";