51{
52
53 Property p;
54 p.put("device","skinWrapper");
55 p.put("robotName","fakeiCub");
56 p.put("name","/testSkinWrapper");
57 p.put("period",20);
58 p.put("total_taxels",10);
59 p.put("subdevice","fakeAnalogSensor");
60 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Opening the skinWrapper with one port");
61 ROBOTTESTINGFRAMEWORK_TEST_CHECK(dd1.open(p),"Unable to open the device!");
62
63 BufferedPort<Bottle> port,portrpc;
64 portrpc.open("/fakeiCub2/skin/rpc:i");
65 port.open("/fakeiCub2/skin");
66 p.unput("robotName");
67 p.put("robotName","fakeiCub2");
68 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Opening the skinWrapper with one port (address conflict case)");
69 ROBOTTESTINGFRAMEWORK_TEST_CHECK(!dd2.open(p),"Unable to open the device as expected");
70 portrpc.close();
71 port.close();
72
73 Property p2;
74 p2.put("device","skinWrapper");
75 p2.put("robotName","fakeiCub3");
76 p2.put("name","/testSkinWrapperMultip");
77 p2.put("period",20);
78 p2.put("total_taxels",3);
79 p2.put("subdevice","fakeAnalogSensor");
80 p2.fromString("(ports (left_hand left_forearm left_arm)) (left_hand 0 0 0 0) (left_forearm 0 0 0 0) (left_arm 0 0 0 0)", false);
81 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Opening the skinWrapper with multiple ports");
82 ROBOTTESTINGFRAMEWORK_TEST_CHECK(dd3.open(p2),"Unable to open the device!");
83
84 port.open("/fakeiCub4/skin/left_hand");
85 portrpc.open("/fakeiCub4/skin/left_forearm/rpc:i");
86 p2.unput("robotName");
87 p2.put("robotName","fakeiCub4");
88 ROBOTTESTINGFRAMEWORK_TEST_REPORT("Opening the skinWrapper with multiple ports (address conflict case)");
89 ROBOTTESTINGFRAMEWORK_TEST_CHECK(!dd4.open(p2),"Unable to open the device as expected");
90
91 port.close();
92 portrpc.close();
93 return true;
94}