1 set test "sid configuration"
2 sid_config_component_test "base.conf" \
3 "load [sid_find_file libglue.la] glue_component_library" \
8 if [sid_start "base.conf"] then { pass $test } else { fail $test ; return }
10 set test "check initial attribute list"
11 set result [sid_cmd "sid::component::attribute_names $victim"]
12 if {$result == ""} then { pass $test } else { fail $test }
14 # prepare our copy of attribute table
17 set attr("a") {a b c d}
18 set attr("hello") "goodbye\0come back"
19 set attr(012345) 67890
21 # XXX: tcl system cannot seem to pass through empty strings!
24 set test "set testing attributes"
25 foreach name [array names attr] {
26 set value $attr($name)
27 set result [sid_cmd "sid::component::set_attribute_value $victim [list $name] [list $value]"]
28 if {$result != "ok"} then { fail $test ; return }
32 set test "check testing attribute list"
33 sid_assert_includes_all "sid::component::attribute_names $victim" [array names attr]
35 set test "retrieve testing attributes"
36 foreach name [array names attr] {
37 set value $attr($name)
38 set result [sid_cmd "sid::component::attribute_value $victim [list $name]"]
39 if {$result != $value} then { fail "$test - $result vs $value"; return }
43 set test "overwrite a few testing attributes"
44 set attr("hello") "nothing"
45 set attr(012345) "something"
46 set attr(new) "sushi swims"
47 foreach name {{"hello"} 012345 new} {
48 set value $attr($name)
49 set result [sid_cmd "sid::component::set_attribute_value $victim [list $name] [list $value]"]
50 if {$result != "ok"} then { fail $test ; return }
54 set test "check testing attribute list after overwrite"
55 sid_assert_includes_all "sid::component::attribute_names $victim" [array names attr]
57 set test "retrieve testing attributes after overwrite"
58 foreach name [array names attr] {
59 set value $attr($name)
60 set result [sid_cmd "sid::component::attribute_value $victim [list $name]"]
61 if {$result != $value} then { fail "$test - $result vs $value"; return }
67 if [sid_stop] then { pass $test } else { fail $test ; return }
70 # zap temp file if tests were successful
72 if {$exit_status == "0"} then { file delete "base.conf" }