From 2391e879a9d94936deb1cae8bb291e09cfeb25b1 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Fri, 26 May 2017 15:23:10 +0100
Subject: [PATCH] Added extra test to generate random particle smoothing
 lengths.

---
 tests/test27cells.sh.in | 33 +++++++++++++++++++++++++++++++--
 1 file changed, 31 insertions(+), 2 deletions(-)

diff --git a/tests/test27cells.sh.in b/tests/test27cells.sh.in
index 4312ce55e1..d0bae2a51e 100755
--- a/tests/test27cells.sh.in
+++ b/tests/test27cells.sh.in
@@ -1,13 +1,42 @@
 #!/bin/bash
 
+# Test for particles with the same smoothing length
 for v in {0..3}
 do
     echo ""
 	
     rm -f brute_force_27_standard.dat swift_dopair_27_standard.dat
 
-    echo "Running ./test27cells -n 6 -r 1 -d 0 -f standard -v $v -a 1e-4"
-    ./test27cells -n 6 -r 1 -d 0 -f standard -v $v -a 1e-4
+    echo "Running ./test27cells -n 6 -r 1 -d 0 -f standard -v $v"
+    ./test27cells -n 6 -r 1 -d 0 -f standard -v $v
+
+    if [ -e brute_force_27_standard.dat ]
+    then
+	if python @srcdir@/difffloat.py brute_force_27_standard.dat swift_dopair_27_standard.dat @srcdir@/tolerance_27_normal.dat 6
+	then
+	    echo "Accuracy test passed"
+	else
+	    echo "Accuracy test failed"
+	    exit 1
+	fi
+    else
+	echo "Error Missing test output file"
+	exit 1
+    fi
+
+    echo "------------"
+    
+done
+
+# Test for particles with random smoothing lengths
+for v in {0..3}
+do
+    echo ""
+	
+    rm -f brute_force_27_standard.dat swift_dopair_27_standard.dat
+
+    echo "Running ./test27cells -n 6 -r 1 -d 0 -f standard -v $v -p 1.1"
+    ./test27cells -n 6 -r 1 -d 0 -f standard -v $v -p 1.1
 
     if [ -e brute_force_27_standard.dat ]
     then
-- 
GitLab