mirror of
https://github.com/rizinorg/rizin
synced 2026-08-22 20:26:16 -04:00
Add separate test to check if C++ programs work with Rizin (#1743)
This commit is contained in:
parent
fa9146c6c8
commit
618ed4e0a8
3 changed files with 65 additions and 0 deletions
27
test/unit/cpp/test_cpp.cpp
Normal file
27
test/unit/cpp/test_cpp.cpp
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// SPDX-FileCopyrightText: 2021 Florian Märkl <info@florianmaerkl.de>
|
||||
// SPDX-License-Identifier: LGPL-3.0-only
|
||||
|
||||
#include <rz_core.h>
|
||||
#include <rz_util.h>
|
||||
|
||||
#include "../minunit.h"
|
||||
|
||||
/*
|
||||
* This is mostly just a test for ensuring all headers can be
|
||||
* compiled as C++.
|
||||
*/
|
||||
|
||||
bool test_cpp(void) {
|
||||
RzCore *core = rz_core_new();
|
||||
char *r = rz_core_cmd_str(core, "?e Hello from C++!");
|
||||
mu_assert_streq(r, "Hello from C++!\n", "cmd");
|
||||
rz_core_free(core);
|
||||
mu_end;
|
||||
}
|
||||
|
||||
bool all_tests() {
|
||||
mu_run_test(test_cpp);
|
||||
return tests_passed != tests_run;
|
||||
}
|
||||
|
||||
mu_main(all_tests)
|
||||
Loading…
Add table
Add a link
Reference in a new issue