From fae4a4d444d99cecd00b7d6e4e6615d53be3b096 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Thu, 30 Sep 2021 16:27:04 +0100 Subject: [PATCH] Added unit test to explore the deallocation failure. --- unit-tests/memory.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 unit-tests/memory.sh diff --git a/unit-tests/memory.sh b/unit-tests/memory.sh new file mode 100644 index 0000000..1bb76f6 --- /dev/null +++ b/unit-tests/memory.sh @@ -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