Skip to content

Commit

Permalink
[sanitizer] Fix test on arm 32bit
Browse files Browse the repository at this point in the history
Make test values suitable for PC alignment arithmetic used
in StackTrace::Print().
  • Loading branch information
vitalybuka committed Nov 14, 2020
1 parent 9d62ef6 commit c8f4e06
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -72,17 +72,17 @@ TEST(SanitizerCommon, StackDepotSeveral) {
#define Maybe_StackDepotPrint StackDepotPrint
#endif
TEST(SanitizerCommon, Maybe_StackDepotPrint) {
uptr array1[] = {1, 2, 3, 4, 7};
uptr array1[] = {0x111, 0x222, 0x333, 0x444, 0x777};
StackTrace s1(array1, ARRAY_SIZE(array1));
u32 i1 = StackDepotPut(s1);
uptr array2[] = {1, 2, 3, 4, 8, 9};
uptr array2[] = {0x1111, 0x2222, 0x3333, 0x4444, 0x8888, 0x9999};
StackTrace s2(array2, ARRAY_SIZE(array2));
u32 i2 = StackDepotPut(s2);
EXPECT_NE(i1, i2);
EXPECT_EXIT(
(StackDepotPrintAll(), exit(0)), ::testing::ExitedWithCode(0),
"Stack for id .*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x6.*Stack for id "
".*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x7.*#5 0x8.*");
"Stack for id .*#0 0x1.*#1 0x2.*#2 0x3.*#3 0x4.*#4 0x7.*Stack for id "
".*#0 0x1.*#1 0x2.*#2 0x3.*#3 0x4.*#4 0x8.*#5 0x9.*");
}

TEST(SanitizerCommon, StackDepotReverseMap) {
Expand Down

0 comments on commit c8f4e06

Please sign in to comment.