mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 23:11:19 +01:00
tests: accept %p printing in uppercase and without leading 0x
the output of the specifier %p is implementation defined, and mpaland-printf gives something different than newlib
This commit is contained in:
parent
e49b7fd3a4
commit
ede39c6c45
@ -46,7 +46,7 @@ def expect_content(child, counter):
|
||||
else:
|
||||
child.expect(r'type: 0x0000, content: 0 \((0x)?0+\)')
|
||||
else:
|
||||
child.expect_exact(f'type: 0x{counter:04x}, content: {counter} (0x{counter:x})')
|
||||
child.expect(f'type: 0x{counter:04x}, content: {counter} \((0x)?0*{counter:x}\)')
|
||||
|
||||
|
||||
def testfunc(child):
|
||||
|
||||
@ -31,10 +31,11 @@ def testfunc(child):
|
||||
child.expect(r"00000020 55 44 33 FF FE 22 11 00 54 B8 59 AF 3A B4 5C 85")
|
||||
child.expect(r"00000030 1E CE E2 EB 05 4E A3 85")
|
||||
child.sendline("pktbuf")
|
||||
child.expect(r"packet buffer: first byte: (0x[0-9a-fA-F]+), "
|
||||
r"last byte: 0x[0-9a-fA-F]+ \(size: (\d+)\)")
|
||||
child.expect(r"packet buffer: first byte: ((0x)?[0-9a-fA-F]+), "
|
||||
r"last byte: (0x)?[0-9a-fA-F]+ \(size: (\d+)\)")
|
||||
start_addr = child.match.group(1)
|
||||
size = child.match.group(2)
|
||||
size = child.match.group(4)
|
||||
print(start_addr, size)
|
||||
child.expect(r" position of last byte used: \d+")
|
||||
child.expect(r"~ unused: {} \(next: (\(nil\)|0(x0+)?), size: +{}\) ~"
|
||||
.format(start_addr, size))
|
||||
|
||||
@ -66,9 +66,9 @@ class RiotbootDevice:
|
||||
# Ask for data of all slots
|
||||
child.expect_exact('>')
|
||||
child.sendline("dumpaddrs")
|
||||
child.expect(r"slot 0: metadata: 0x[0-9a-fA-F]{1,8} "
|
||||
child.expect(r"slot 0: metadata: (0x)?[0-9a-fA-F]{1,8} "
|
||||
r"image: 0x[0-9a-fA-F]{8}\r\n")
|
||||
child.expect(r"slot 1: metadata: 0x[0-9a-fA-F]{1,8} "
|
||||
child.expect(r"slot 1: metadata: (0x)?[0-9a-fA-F]{1,8} "
|
||||
r"image: 0x[0-9a-fA-F]{8}\r\n")
|
||||
child.expect_exact('>')
|
||||
|
||||
|
||||
@ -17,14 +17,14 @@ def testfunc(child):
|
||||
if ret == 1:
|
||||
return
|
||||
child.sendline('malloc 100')
|
||||
child.expect('allocated 0x')
|
||||
child.expect('allocated (0x)?')
|
||||
addr = child.readline()
|
||||
addr = addr[:-2]
|
||||
child.expect_exact('> ')
|
||||
child.sendline('heap')
|
||||
child.expect(r'heap: \d+ \(used \d+, free \d+\) \[bytes\]')
|
||||
child.sendline('free 0x' + addr)
|
||||
child.expect('freeing 0x' + addr)
|
||||
child.expect('freeing (0x)?' + addr)
|
||||
child.expect_exact('>')
|
||||
child.sendline('heap')
|
||||
child.expect(r'heap: \d+ \(used \d+, free \d+\) \[bytes\]')
|
||||
|
||||
@ -22,7 +22,7 @@ def testfunc(child):
|
||||
number_of_tests = int(child.match.group(1))
|
||||
initial_allocations = 0
|
||||
for _ in range(number_of_tests):
|
||||
child.expect(r"Allocated {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n"
|
||||
child.expect(r"Allocated {} Bytes at (0x)?[a-z0-9]+, total [a-z0-9]+\r\n"
|
||||
.format(chunk_size))
|
||||
child.expect(r'Allocations count: (\d+)\r\n',
|
||||
timeout=ALLOCATION_TIMEOUT)
|
||||
@ -31,7 +31,7 @@ def testfunc(child):
|
||||
if initial_allocations == 0:
|
||||
initial_allocations = allocations
|
||||
assert initial_allocations == allocations
|
||||
child.expect(r"Free {} Bytes at 0x[a-z0-9]+, total [a-z0-9]+\r\n"
|
||||
child.expect(r"Free {} Bytes at (0x)?[a-z0-9]+, total [a-z0-9]+\r\n"
|
||||
.format(chunk_size))
|
||||
child.expect(r'Free count: (\d+)\r\n', timeout=FREE_TIMEOUT)
|
||||
freed = int(child.match.group(1))
|
||||
|
||||
@ -22,10 +22,10 @@ def testfunc(child):
|
||||
for test in range(number_of_tests):
|
||||
child.expect_exact("TEST #{}:".format(test + 1))
|
||||
for i in range(max_number_blocks):
|
||||
child.expect(r'\({}, @@@@@@@\) Allocated \d+ Bytes at 0x[a-z0-9]+,'
|
||||
child.expect(r'\({}, @@@@@@@\) Allocated \d+ Bytes at (0x)?[a-zA-Z0-9]+,'
|
||||
r' total [0-9]+\r\n'.format(i))
|
||||
for i in range(max_number_blocks):
|
||||
child.expect(r'Free \({}\) \d+ Bytes at 0x[a-z0-9]+,'
|
||||
child.expect(r'Free \({}\) \d+ Bytes at (0x)?[a-zA-Z0-9]+,'
|
||||
' total [0-9]+\r\n'.format(i))
|
||||
|
||||
child.expect_exact("Extend and reduce tests")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user