Skip to content

Commit 9447090

Browse files
author
Tatiana Azundris Nuernberg
committed
Bug#20642505:
Don't run unit test on 64 bit Windows (64 bit size_t, 32 bit long)
1 parent 5c99e66 commit 9447090

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

unittest/gunit/my_regex-t.cc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ TEST_F(RegexTest, Bug20642505)
9595
int err;
9696
size_t len= 684 * 1024 * 1024;
9797

98-
if ((sizeof(size_t) > 4) && (sizeof(long) > 4))
98+
/*
99+
We're testing on 32-bit/32-bit only. We could test e.g. with
100+
64-bit size_t, 32-bit long (for 64-bit Windows and such), but
101+
then we'd have to allocate twice as much memory, and it's a
102+
bit heavy as it is. (In 32/32, we exceed the size_t parameter
103+
to malloc() as new_ssize exceeds UINT32 / 4, whereas in 64/32,
104+
new_ssize would exceed LONG_MAX at UINT32 / 2. (64/32 verified
105+
in debugger.)
106+
*/
107+
if ((sizeof(size_t) > 4) || (sizeof(long) > 4))
99108
return;
100109

101110
/* set up an empty C string as pattern as regcomp() will strlen() this */

0 commit comments

Comments
 (0)