test/src/engine_tests/CrashdumpTests.cc
author Krista Bennett <krista@pep-project.org>
Mon, 17 Dec 2018 09:56:27 +0100
branchENGINE-474
changeset 3193 b15d10a898cd
parent 3121 f33a2ae77177
permissions -rw-r--r--
ENGINE-474: better status msg in Crashdump Tests
vb@1517
     1
// This file is under GNU General Public License 3.0
vb@1517
     2
// see LICENSE.txt
vb@1517
     3
krista@2654
     4
#include <stdlib.h>
vb@452
     5
#include <string>
krista@2654
     6
vb@452
     7
#include "pEpEngine.h"
vb@452
     8
krista@2654
     9
#include "EngineTestSessionSuite.h"
krista@2654
    10
#include "CrashdumpTests.h"
krista@3193
    11
#include "test_util.h"
krista@2654
    12
vb@452
    13
using namespace std;
vb@452
    14
krista@2654
    15
CrashdumpTests::CrashdumpTests(string suitename, string test_home_dir) :
krista@2654
    16
    EngineTestSessionSuite::EngineTestSessionSuite(suitename, test_home_dir) {
krista@3121
    17
    add_test_to_suite(std::pair<std::string, void (Test::Suite::*)()>(string("CrashdumpTests::check_crashdump"),
krista@3121
    18
                                                                      static_cast<Func>(&CrashdumpTests::check_crashdump)));
krista@2654
    19
}
vb@452
    20
krista@2654
    21
void CrashdumpTests::check_crashdump() {
vb@452
    22
    // MODULE test code
vb@452
    23
    char *text;
krista@3193
    24
    PEP_STATUS status = get_crashdump_log(session, 0, &text);
krista@3193
    25
    TEST_ASSERT_MSG((status == PEP_STATUS_OK), tl_status_string(status));
krista@3193
    26
    cout << text << endl;
krista@3193
    27
    free(text);
vb@452
    28
}