Skip to content

Commit

Permalink
[test] add test154.jnc, test154.jnc for the bw-or & bw-xor on bitflag…
Browse files Browse the repository at this point in the history
… enums
  • Loading branch information
vovkos committed Nov 20, 2024
1 parent 75fe948 commit bd48e2e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/jnc/test154.jnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// this test was used when debugging the bitflag enum bw-or & bw-xor issue

//..............................................................................

SerialTapProStatusLines g_lines = 0;

int main() {
uint8_t c = (SerialTapProStatusLines)0x12;
SerialTapProStatusLines lines = (SerialTapProStatusLines)c;
uint8_t mask = lines ^ g_lines;
printf("lines: 0x%x, mask: 0x%x\n", lines, mask);
assert(lines == 0x12 && mask == 0x12);
g_lines = lines;
return 0;
}

bitflag enum SerialTapProStatusLines: int8_t {
Cts,
Dsr,
Ring,
Dcd,
Rts,
Dtr,
}
24 changes: 24 additions & 0 deletions test/jnc/test155.jnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// this test was used when debugging the bitflag enum bw-or & bw-xor issue

//..............................................................................

SerialTapProStatusLines g_lines = 0;

int main() {
uint8_t c = (SerialTapProStatusLines)0x12;
SerialTapProStatusLines lines = (SerialTapProStatusLines)c;
uint8_t mask = lines ^ g_lines;
printf("lines: 0x%x, mask: 0x%x\n", lines, mask);
assert(lines == 0x12 && mask == 0x12);
g_lines = lines;
return 0;
}

bitflag enum SerialTapProStatusLines: uint8_t {
Cts,
Dsr,
Ring,
Dcd,
Rts,
Dtr,
}

0 comments on commit bd48e2e

Please sign in to comment.