summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libgq/gconf/run-test-gconf
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /src/3rdparty/libgq/gconf/run-test-gconf
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
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 0000000000..67f90907c0
--- /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'"'"