vb@69: #include vb@69: #include vb@69: #include vb@69: #include "mime.h" vb@69: vb@69: using namespace std; vb@69: vb@69: int main() { vb@69: cout << "\n*** mime_test ***\n\n"; vb@69: vb@69: PEP_SESSION session; vb@69: vb@69: cout << "calling init()\n"; vb@69: PEP_STATUS status1 = init(&session); vb@69: assert(status1 == PEP_STATUS_OK); vb@69: assert(session); vb@69: cout << "init() completed.\n"; vb@69: vb@69: // mime test code vb@69: vb@69: // testing plain vb@69: vb@69: string bla2 = "my message to yöu"; vb@69: cout << "encoding message…\n"; vb@69: char *result2; vb@69: PEP_STATUS status2 = mime_encode_text(bla2.c_str(), NULL, NULL, &result2); vb@69: assert(result2); vb@69: assert(status2 == PEP_STATUS_OK); vb@69: vb@69: cout << "result:\n"; vb@69: cout << result2 << "\n"; vb@69: vb@69: free(result2); vb@69: vb@69: // testing multipart/alternative vb@69: vb@69: string bla3 = "my message to yöu"; vb@69: string html3 = "

my message to you

"; vb@69: vb@69: cout << "encoding message…\n"; vb@69: char *result3; vb@69: PEP_STATUS status3 = mime_encode_text(bla3.c_str(), html3.c_str(), NULL, &result3); vb@69: assert(result3); vb@69: assert(status3 == PEP_STATUS_OK); vb@69: vb@69: cout << "result:\n"; vb@69: cout << result3 << "\n"; vb@69: vb@69: free(result3); vb@69: vb@69: cout << "calling release()\n"; vb@69: release(session); vb@69: return 0; vb@69: } vb@69: