src/3rdparty/libgq/gconf/run-test-gconf
changeset 37 758a864f9613
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
       
     1 #!/bin/sh
       
     2 
       
     3 # please make sure that the en_US.UTF-8 locale is available!
       
     4 #   - apt-get install locales
       
     5 #   - make sure /etc/locale.gen contains the line "en_US.UTF-8 UTF-8"
       
     6 #   - run /usr/sbin/locale-gen
       
     7 LC_ALL=en_US.UTF-8
       
     8 export LC_ALL
       
     9 
       
    10 gconftool-2 -s -t bool /Test/Bool true
       
    11 VALUE=$(gconftool-2 -g /Test/Bool)
       
    12 if [ "$VALUE" != "true" ]; then
       
    13     echo "GConf is not running, skipping all tests"
       
    14     exit 77
       
    15 fi
       
    16 
       
    17 # Setup values expected by the external_values() test.
       
    18 
       
    19 gconftool-2 -s -t int /Test/Int 123
       
    20 gconftool-2 -s -t string /Test/String "Hello GConf"
       
    21 gconftool-2 -s -t float /Test/Double 3.5
       
    22 gconftool-2 -s -t list --list-type string /Test/StringList "[Hello,GConf,ÄÖÜ]"
       
    23 gconftool-2 -s -t list --list-type int /Test/IntList "[1,2,3,4]"
       
    24 gconftool-2 -s -t list --list-type float /Test/DoubleList "[3.5,3.5,3.5]"
       
    25 gconftool-2 -s -t list --list-type bool /Test/BoolList "[false,true,true,false]"
       
    26 gconftool-2 -u /Test/UnsetBefore
       
    27 gconftool-2 -s -t int /Test/UnsetAfter 100
       
    28 gconftool-2 -s -t int /Test/Dir/Entry 200
       
    29 
       
    30 ./test-gconf $* || exit 1
       
    31 
       
    32 # Check what set_external() has left behind.
       
    33 
       
    34 compare() {
       
    35   if [ "$1" != "$2" ]; then
       
    36     echo "FAIL: '$1' != '$2'"
       
    37     exit 1
       
    38   fi
       
    39 }
       
    40 
       
    41 compare "`gconftool-2 -g /Test/Bool`" false
       
    42 compare "`gconftool-2 -g /Test/Int`" 54321
       
    43 compare "`gconftool-2 -g /Test/String`" "Good bye GConf"
       
    44 compare "`gconftool-2 -g /Test/Double`" -2.5
       
    45 compare "`gconftool-2 -g /Test/StringList`" "[Good,bye,GConf,äöü]"
       
    46 compare "`gconftool-2 -g /Test/IntList`" "[5,4,3,2,1]"
       
    47 compare "`gconftool-2 -g /Test/DoubleList`" "[-2.5,-2.5]"
       
    48 compare "`gconftool-2 -g /Test/BoolList`" "[false,false,true,true]"
       
    49 compare "`gconftool-2 -g /Test/UnsetAfter 2>&1`" 'No value set for `/Test/UnsetAfter'"'"