From 33783d9fa23904fa3fe9d6a3ffce7405053e2447 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Thu, 11 Apr 2019 12:01:55 +0200 Subject: [PATCH] tests/pthread_tls: allow negative key values On Hifive1, the created keys have a negative value. This commit adjusts the pexpect script to allow for that. --- tests/pthread_tls/tests/01-run.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pthread_tls/tests/01-run.py b/tests/pthread_tls/tests/01-run.py index fc49dd780e..919b4c3e10 100755 --- a/tests/pthread_tls/tests/01-run.py +++ b/tests/pthread_tls/tests/01-run.py @@ -8,7 +8,7 @@ def _check_test_output(child): child.expect('show tls values:') for i in range(20): if i != 5: - child.expect('key\[%d\]: \d+, val: %d' + child.expect('key\[%d\]: -?\d+, val: %d' % (i, i + 1 if i != 3 else 42)) @@ -17,7 +17,7 @@ def testfunc(child): child.expect('-= TEST 1 - create 20 tls with sequencial values 0...19 =-') _check_test_output(child) child.expect('-= TEST 2 - ' - 'delete deliberate key \(key\[5\]:\d+\) =-') + 'delete deliberate key \(key\[5\]:-?\d+\) =-') _check_test_output(child) child.expect('-= TEST 3 - create new tls =-') _check_test_output(child) @@ -26,10 +26,10 @@ def testfunc(child): child.expect('-= TEST 5 - try delete non-existing key =-') child.expect('try to delete returns: 0') child.expect('-= TEST 6 - add key and delete without a tls =-') - child.expect('created key: \d+') + child.expect('created key: -?\d+') child.expect('try to delete returns: 0') child.expect('-= TEST 7 - add key without tls =-') - child.expect('created key: \d+') + child.expect('created key: -?\d+') child.expect('test_7_val: (0|\(nil\))') child.expect('tls tests finished.') child.expect('SUCCESS')