Add separate test to check if C++ programs work with Rizin (#1743)

This commit is contained in:
Riccardo Schirone 2021-09-24 10:15:59 +02:00 committed by GitHub
parent fa9146c6c8
commit 618ed4e0a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 0 deletions

View 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)