Skip to content

Commit

Permalink
Add tests for rename macros. (#2202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 authored Nov 20, 2023
1 parent 975a4f1 commit dec87d6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_arm64.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Capstone Disassembler Engine */
/* By Nguyen Anh Quynh <[email protected]>, 2013-2019 */

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>

Expand Down Expand Up @@ -222,9 +223,27 @@ static void test()
}
}

void test_macros() {
assert(CS_AARCH64(_INS_BL) == ARM64_INS_BL);
assert(CS_AARCH64pre(CS_ARCH_) == CS_ARCH_ARM64);
assert(CS_AARCH64CC(_AL) == ARM64_CC_AL);
assert(CS_AARCH64_VL_(16B) == ARM64_VAS_16B);
cs_detail detail = { 0 };
CS_cs_aarch64() arm64_detail = { 0 };
detail.arm64 = arm64_detail;
CS_aarch64_op() op = { 0 };
detail.CS_aarch64().operands[0] = op;
CS_aarch64_reg() reg = 1;
CS_aarch64_cc() cc = ARM64_CC_AL;
CS_aarch64_extender() arm64_extender = ARM64_EXT_SXTB;
CS_aarch64_shifter() arm64_shifter = ARM64_SFT_LSL;
CS_aarch64_vas() arm64_vas = ARM64_VAS_16B;
}

int main()
{
test();
test_macros();

return 0;
}
Expand Down

0 comments on commit dec87d6

Please sign in to comment.