Added unit test to explore the deallocation failure.

This commit is contained in:
Simon Brooke 2021-09-30 16:27:04 +01:00
parent ea0d9a2629
commit fae4a4d444
No known key found for this signature in database
GPG key ID: A7A4F18D1D4DF987

14
unit-tests/memory.sh Normal file
View file

@ -0,0 +1,14 @@
#!/bin/bash
actual=`echo "" | target/psse 2>&1 | tail -2`
alloc=`echo $actual | sed 's/[[:punct:]]/ /g' | awk '{print $4}'`
dealloc=`echo $actual | sed 's/[[:punct:]]/ /g' | awk '{print $6}'`
if [ "${alloc}" = "${dealloc}" ]
then
echo "OK"
else
echo "Fail: expected '${alloc}', got '${dealloc}'"
exit 1
fi