aboutsummaryrefslogtreecommitdiff
blob: 4a2b6284e6e65475013bb1aee3300ac3ff55110b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
AT_SETUP(sb_printf)

AT_CHECK([dnl
sb_printf_tst | ${AWK} 'BEGIN { ret = 0 }
{
	if (G == "") {
		G = $0
		next
	}
	glibc = G
	G = ""

	# easy case -- glibc output matches our output
	if (glibc == $0)
		next
	# not so easy -- we format sandbox printf() the way we like

	# %x -- we prefix output with 0x
	if ($1 ~ /%[[luz#]]*[[xX]]/)
		gsub(/\<0x/, "")

	# %p -- we zero pad the output
	if ($1 ~ /%p/)
		gsub(/\<0x0+/, "0x")

	if (glibc == $0)
		next
	printf "FAIL:\nglibc:%s\nsandbox:%s\n", glibc, $0
	ret = 1
}
END { exit ret }'], [0])

AT_CLEANUP