Struct TargetDbTests

Inheritance Relationships

Base Type

Struct Documentation

struct TargetDbTests : public TestSuite

Public Functions

inline TargetDbTests()
inline virtual void init()

Virtual method for test suite initialization.

inline KxdbParser getParser()
inline Target getLts6181()
inline  TEST_METHOD (versionLts6181, "version, distro and release_name fields are correct in target db (lts-6.1.81)")
inline  TEST_METHOD (symbolsLts6181, "symbols are correct in target db (lts-6.1.81)")
inline  TEST_METHOD (ropActionsMetaLts6181, "rop actions metadata is correct (lts-6.1.81)")
inline  TEST_METHOD (ropActionsLts6181, "rop actions are correct (lts-6.1.81)")
inline  TEST_METHOD (ropChainLts6181, "rop chain generation is correct (lts-6.1.81)")
inline  TEST_METHOD (pivotsLts6181, "stack pivots are correct (lts-6.1.81)")
inline  TEST_METHOD (structLts6181, "structs are correct (lts-6.1.81)")
inline  TEST_METHOD (targetDbMergingWorks, "TargetDb can merge db with targets")
inline  TEST_METHOD (staticDbWorks, "TargetDb can work with only targets without a db")
virtual void deinit()

Virtual method for test suite deinitialization.

virtual void Log(const char *format, ...)

Logs a message using a format string.

Parameters:
  • format – The format string for the message.

  • ... – The arguments for the format string.

void Error(const char *format, ...)

Logs an error message and sets the had_errors flag.

Parameters:
  • format – The format string for the error message.

  • ... – The arguments for the format string.

Test &RegisterTest(Test test)

Registers a test case with the test suite.

Parameters:

test – The Test object to register.

Returns:

A reference to the registered Test object.

void AssertLogs(bool fail_if_no_expected = true)

Asserts that the logged output matches the expected results in a file.

Parameters:

fail_if_no_expected – If true, the test will fail if no expected results file is found.

void AssertNoErrors()

Asserts that no errors have occurred during the test execution.

Throws:

ExpKitError – if the had_errors flag is true.

Public Members

std::vector<uint8_t> kxdb_lts6181
const char *lts_6181_version = "Linux version 6.1.81 (runner@fv-az736-920) (gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #1 SMP PREEMPT_DYNAMIC Thu Mar  7 12:17:31 UTC 2024"
std::string class_name
std::string desc
std::vector<Test> tests
std::vector<std::string> logs
std::vector<std::string> errors
TestEnvironment *env
Test *current_test
bool had_errors = false