summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2017-12-18 20:05:44 +0900
committerAkira TAGOH <akira@tagoh.org>2017-12-18 20:05:44 +0900
commitc1e48b0c1439007b41887177ef7b34e4d75e3a31 (patch)
tree852670c20f2da6819b091cab33ef9f345124c9ec /test
parent8ab4d679959815feb0c383e1e17953fe1c46091f (diff)
Add a test case for uuid creation
Diffstat (limited to 'test')
-rw-r--r--test/run-test.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/run-test.sh b/test/run-test.sh
index be2cc921..4154dd3e 100644
--- a/test/run-test.sh
+++ b/test/run-test.sh
@@ -121,6 +121,49 @@ mkdir $FONTDIR/a
cp $FONT2 $FONTDIR/a
check
+dotest "Re-creating .uuid"
+prep
+cp $FONT1 $FONTDIR
+$FCCACHE $FONTDIR
+cat $FONTDIR/.uuid > out1
+$FCCACHE -f $FONTDIR
+cat $FONTDIR/.uuid > out2
+if cmp out1 out2 > /dev/null ; then : ; else
+ echo "*** Test failed: $TEST"
+ echo "*** .uuid was modified unexpectedly"
+ exit 1
+fi
+$FCCACHE -r $FONTDIR
+cat $FONTDIR/.uuid > out2
+if cmp out1 out2 > /dev/null ; then
+ echo "*** Test failed: $TEST"
+ echo "*** .uuid wasn't modified"
+ exit 1
+fi
+rm out1 out2
+
+dotest "Consistency between .uuid and cache name"
+prep
+cp $FONT1 $FONTDIR
+$FCCACHE $FONTDIR
+cat $FONTDIR/.uuid
+$FCCACHE -r $FONTDIR
+uuid=`cat $FONTDIR/.uuid`
+ls $CACHEDIR/$uuid*
+if [ $? != 0 ]; then
+ echo "*** Test failed: $TEST"
+ echo "No cache for $uuid"
+ ls $CACHEDIR
+ exit 1
+fi
+n=`ls -1 $CACHEDIR/*cache-* | wc -l`
+if [ $n != 1 ]; then
+ echo "*** Test failed: $TEST"
+ echo "Unexpected cache was created"
+ ls $CACHEDIR
+ exit 1
+fi
+
if [ x"$BWRAP" != "x" ]; then
dotest "Basic functionality with the bind-mounted cache dir"
prep