summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libgq/gconf/run-test-gconf
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/libgq/gconf/run-test-gconf')
-rwxr-xr-xsrc/3rdparty/libgq/gconf/run-test-gconf49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/3rdparty/libgq/gconf/run-test-gconf b/src/3rdparty/libgq/gconf/run-test-gconf
new file mode 100755
index 0000000..67f9090
--- /dev/null
+++ b/src/3rdparty/libgq/gconf/run-test-gconf
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+# please make sure that the en_US.UTF-8 locale is available!
+# - apt-get install locales
+# - make sure /etc/locale.gen contains the line "en_US.UTF-8 UTF-8"
+# - run /usr/sbin/locale-gen
+LC_ALL=en_US.UTF-8
+export LC_ALL
+
+gconftool-2 -s -t bool /Test/Bool true
+VALUE=$(gconftool-2 -g /Test/Bool)
+if [ "$VALUE" != "true" ]; then
+ echo "GConf is not running, skipping all tests"
+ exit 77
+fi
+
+# Setup values expected by the external_values() test.
+
+gconftool-2 -s -t int /Test/Int 123
+gconftool-2 -s -t string /Test/String "Hello GConf"
+gconftool-2 -s -t float /Test/Double 3.5
+gconftool-2 -s -t list --list-type string /Test/StringList "[Hello,GConf,ÄÖÜ]"
+gconftool-2 -s -t list --list-type int /Test/IntList "[1,2,3,4]"
+gconftool-2 -s -t list --list-type float /Test/DoubleList "[3.5,3.5,3.5]"
+gconftool-2 -s -t list --list-type bool /Test/BoolList "[false,true,true,false]"
+gconftool-2 -u /Test/UnsetBefore
+gconftool-2 -s -t int /Test/UnsetAfter 100
+gconftool-2 -s -t int /Test/Dir/Entry 200
+
+./test-gconf $* || exit 1
+
+# Check what set_external() has left behind.
+
+compare() {
+ if [ "$1" != "$2" ]; then
+ echo "FAIL: '$1' != '$2'"
+ exit 1
+ fi
+}
+
+compare "`gconftool-2 -g /Test/Bool`" false
+compare "`gconftool-2 -g /Test/Int`" 54321
+compare "`gconftool-2 -g /Test/String`" "Good bye GConf"
+compare "`gconftool-2 -g /Test/Double`" -2.5
+compare "`gconftool-2 -g /Test/StringList`" "[Good,bye,GConf,äöü]"
+compare "`gconftool-2 -g /Test/IntList`" "[5,4,3,2,1]"
+compare "`gconftool-2 -g /Test/DoubleList`" "[-2.5,-2.5]"
+compare "`gconftool-2 -g /Test/BoolList`" "[false,false,true,true]"
+compare "`gconftool-2 -g /Test/UnsetAfter 2>&1`" 'No value set for `/Test/UnsetAfter'"'"