Go to the documentation of this file.
27 fprintf(
stderr,
"[ ERROR ] --- Invalid file to setup\n");
36 if (size_params != 3) {
37 fprintf(
stderr,
"[ ERROR ] --- Invalid options ( arch, mode, option )\n");
43 if (!strcmp(list_params[0],
"CS_ARCH_ARM64"))
50 if (strstr(list_params[1],
modes[
i].
str)) {
69 fprintf(
stderr,
"[ ERROR ] --- Arch is not supported!\n");
76 fprintf(
stderr,
"[ ERROR ] --- Cannot initialize capstone\n");
84 fprintf(
stderr,
"[ ERROR ] --- Option is not supported for this arch/mode\n");
153 if (!strcmp(list_params[0],
"CS_ARCH_ARM64"))
160 if (strstr(list_params[1],
modes[
i].
str)) {
179 fprintf(
stderr,
"[ ERROR ] --- Arch is not supported!\n");
186 fprintf(
stderr,
"[ ERROR ] --- Cannot initialize capstone\n");
194 fprintf(
stderr,
"[ ERROR ] --- Option is not supported for this arch/mode\n");
202 fprintf(
stderr,
"[ ERROR ] --- Cannot get details\n");
256 struct CMUnitTest *
tests;
257 int issue_num, number_of_tests;
272 tests = (
struct CMUnitTest *)realloc(
tests,
sizeof(
struct CMUnitTest) * (number_of_tests + 1));
279 _cmocka_run_group_tests(
"Testing issues",
tests, number_of_tests, NULL, NULL);
287 tmp = (
char *)malloc(
sizeof(
char) * 100);
288 sprintf(
tmp,
"Line %d",
i+1);
289 tests = (
struct CMUnitTest *)realloc(
tests,
sizeof(
struct CMUnitTest) * (number_of_tests + 1));
296 _cmocka_run_group_tests(
"Testing MC",
tests, number_of_tests, NULL, NULL);
300 printf(
"[!] Noted:\n[ ERROR ] --- \"<capstone result>\" != \"<user result>\"\n");
320 int main(
int argc,
char *argv[])
327 while ((opt =
getopt(argc, argv,
"ef:d:")) > 0) {
341 printf(
"Usage: %s [-e] [-f <file_name.cs>] [-d <directory>]\n", argv[0]);
347 printf(
"Usage: %s [-e] [-f <file_name.cs>] [-d <directory>]\n", argv[0]);
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_close(csh *handle)
static void test_folder(const char *folder)
void test_single_issue(csh *handle, cs_mode mode, char *line, int detail)
void free_strs(char **list_str, int size)
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_open(cs_arch arch, cs_mode mode, csh *handle)
char * readfile(const char *filename)
static cs_mode issue_mode
int getopt(int nargc, char *const nargv[], const char *ostr)
static int setup_issue(void **state)
@ CS_MODE_16
16-bit mode (X86)
int set_function(int arch)
CAPSTONE_EXPORT cs_err CAPSTONE_API cs_option(csh ud, cs_opt_type type, size_t value)
@ CS_MODE_THUMB
ARM's Thumb mode, including Thumb-2.
static BloatyTestEntry tests[]
int get_value(single_dict d[], unsigned size, const char *str)
static void test_issue(void **state)
int main(int argc, char *argv[])
@ CS_MODE_64
64-bit mode (X86, PPC)
void listdir(const char *name, char ***files, int *num_files)
static int setup_MC(void **state)
static void test_MC(void **state)
static char ** list_lines
static void test_file(const char *filename)
static int teardown_MC(void **state)
static int teardown_issue(void **state)
void test_single_MC(csh *handle, int mc_mode, char *line)
static void split(const char *s, char ***ss, size_t *ns)
const char * get_filename_ext(const char *filename)
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:17