summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libgq/gconf/run-test-gconf
blob: 67f90907c0e2c0b23adc5d58ae6c21e73ea81e58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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'"'"