Skip to content

Commit 51fd09d

Browse files
committed
Add .rdata exclusion for testing on macOS
1 parent 3bc5c29 commit 51fd09d

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/tests/Process.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ TEST(ProcessTest, ProcessModuleMatchesEmptyStr) {
77

88
TEST(ProcessTest, ProcessModuleHasDefaultSegments) {
99
bool rx = false; // .text
10+
#ifdef LIBHAT_MAC
11+
bool r = true; // only __TEXT and __DATA are expected
12+
#else
1013
bool r = false; // .rdata
14+
#endif
1115
bool rw = false; // .data
1216
hat::process::get_process_module().for_each_segment([&](auto, auto prot) {
1317
if (prot == (hat::protection::Read | hat::protection::Execute)) {
@@ -26,7 +30,11 @@ TEST(ProcessTest, ProcessModuleHasDefaultSegments) {
2630

2731
TEST(ProcessTest, ProcessModuleHasDefaultSections) {
2832
bool rx = false; // .text
33+
#ifdef LIBHAT_MAC
34+
bool r = true; // only __TEXT and __DATA are expected
35+
#else
2936
bool r = false; // .rdata
37+
#endif
3038
bool rw = false; // .data
3139
hat::process::get_process_module().for_each_section([&](auto, auto, auto prot) {
3240
if (prot == (hat::protection::Read | hat::protection::Execute)) {

0 commit comments

Comments
 (0)