mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 15:10:53 +00:00
5206c636f5
* put console in noflush mode in r_core_cmd_str to avoid flushing the console buffer when the output of the executed commands is retreived as a string. * add in_cmdstr field to struct r_core_t which is internally used in r_core_cmd_str * Add a unit test
20 lines
429 B
C
20 lines
429 B
C
#include <r_core.h>
|
|
#include "minunit.h"
|
|
|
|
bool test_cmd_str_issue_18799() {
|
|
RCore *core = r_core_new ();
|
|
char *output = r_core_cmd_str (core, "pd 1 @e:asm.hints=false");
|
|
mu_assert ("command output leaked to stdout", strlen (output) > 0);
|
|
r_core_free (core);
|
|
mu_end;
|
|
}
|
|
|
|
int all_tests() {
|
|
mu_run_test (test_cmd_str_issue_18799);
|
|
return tests_passed != tests_run;
|
|
}
|
|
|
|
int main(int argc, char **argv) {
|
|
return all_tests ();
|
|
}
|