OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / testsuite / sidcomp.consoles / stdioinv.exp
1 set test "sid configuration"
2 sid_config_component_etc_test_with_tracing "stdio1.conf" \
3     "load [sid_find_file libconsoles.la] console_component_library" \
4     "sid-io-stdio" \
5     "connect-pin main perform-activity -> wrapper poll"
6 pass $test
7
8 set test "sid start"
9 if {[sid_start "stdio1.conf"]} { pass $test } else { fail $test ; return }
10
11 set test "find pin that does not exist"
12 set pin [sid_cmd "sid::component::find_pin $victim pin"]
13 if {$pin == ""} then { pass $test } else { fail $test }
14
15 set test "connect to a pin that does not exist"
16 set pin [sid_cmd "sid::pin::new"] 
17 set status [sid_cmd "sid::component::connect_pin $victim input $pin"]
18 if {$status == "not_found"} then { pass $test } else { fail $test }
19
20 set test "check connected pins on a pin that does not exist"
21 set pin [sid_cmd "sid::component::connected_pins $victim input2"]
22 if {$pin == ""} then { pass $test } else { fail $test }
23
24 set test "check disconnecting pin on a pin that does not exist"
25 set pin [sid_cmd "sid::pin::new"] 
26 set status [sid_cmd "sid::component::disconnect_pin $victim input $pin"]
27 if {$status == "not_found"} then { pass $test } else { fail $test }
28
29 set test "find bus that does not exist"
30 set pin [sid_cmd "sid::component::find_bus $victim bus"]
31 if {$pin == ""} then { pass $test } else { fail $test }
32
33 set test "connect to an accessor that does not exist"
34 set bus [sid_cmd "sid::bus::new"] 
35 set status [sid_cmd "sid::component::connect_accessor $victim bus1 $bus"]
36 if {$status == "not_found"} then { pass $test } else { fail $test }
37
38 set test "check connected bus on a bus that does not exist"
39 set bus2 [sid_cmd "sid::component::connected_bus $victim bus2"]
40 if {$bus2 == ""} then { pass $test } else { fail $test }
41
42 set test "set relationships that does not exist"
43 set status [sid_cmd "sid::component::relate $victim any $victim"]
44 if {$status == "not_found"} then { pass $test } else { fail $test }
45
46 set test "set relationships to relate to a non existing component"
47 set status [sid_cmd "sid::component::relate $victim relationship $victim"]
48 if {$status == "not_found"} then { pass $test } else { fail $test }
49
50 set test "query relationships that does not exist"
51 set comps [sid_cmd "sid::component::related_components $victim rel"]
52 if {$comps == ""} then { pass $test } else { fail $test }
53
54 set test "set non existing attribute to -1"
55 set status [sid_cmd "sid::component::set_attribute_value $victim new -1" ]
56 if {$status == "not_found"} then { pass $test } else { fail $test }
57
58 set test "sid stop"
59 if [sid_stop] then { pass $test } else { fail $test ; return }
60
61
62 # zap temp file if tests were successful 
63 global exit_status
64 if {$exit_status == "0"} then { file delete "stdio1.conf" }