YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#include <yarp/os/all.h>
7#include <Demo.h>
8#include <DemoStructList.h>
9#include <DemoStructMap.h>
10#include <DemoStructExt.h>
11#include <SurfaceMeshWithBoundingBox.h>
12#include <Wrapping.h>
13#include <TestAnnotatedTypes.h>
14#include <TestSomeMoreTypes.h>
15#include <TestSomeLists.h>
16#include <TestSomeMaps.h>
17#if defined(THRIFT_INCLUDE_PREFIX) && defined(THRIFT_NO_NAMESPACE_PREFIX)
18# include <sub/directory/ClockServer.h>
19#elif defined(THRIFT_INCLUDE_PREFIX)
20# include <sub/directory/testing/ClockServer.h>
21#elif defined(THRIFT_NO_NAMESPACE_PREFIX)
22# include <ClockServer.h>
23#else
24# include <testing/ClockServer.h>
25#endif
26#include <Settings.h>
27
28#include <catch2/catch_amalgamated.hpp>
29
30using namespace yarp::os;
31using namespace yarp::os::impl;
32
33
34class Server : public Demo
35{
36private:
37 bool running;
38 bool closing;
39public:
41 running = false;
42 closing = false;
43 }
44
45 int32_t get_answer() override {
46 return 42;
47 }
48
49 int32_t add_one(const int32_t x) override {
50 INFO("adding 1 to " << x);
51 return x+1;
52 }
53
54 int32_t add_pair(const int32_t x, const int32_t y) override {
55 INFO("adding " << x << " and " << y);
56 return x+y;
57 }
58
59 void test_void(const int32_t x) override {
60 INFO("test void with " << x);
61 }
62
63 void test_1way(const int32_t x) override {
64 INFO("test oneway with " << x);
65 }
66
67 bool test_defaults(const int32_t x) override {
68 INFO("test defaults with " << x);
69 return (x==42);
70 }
71
72 std::vector<DemoEnum> test_enum_vector(const std::vector<DemoEnum> & x) override {
73 INFO("test_enum_vector");
74 std::vector<DemoEnum> result = x;
75 result.push_back(ENUM1);
76 return result;
77 }
78
80 const std::vector<int32_t> & lst,
81 const int32_t y) override {
82 INFO("test_partial with " << x << " and " << y);
83 YARP_UNUSED(lst);
84 return x+y;
85 }
86
88 if (x==ENUM1) {
89 return 42;
90 }
91 return 999;
92 }
93
94 int32_t test_longer_tail_defaults(const int32_t ignore, const DemoEnum _enum, const int32_t _int, const std::string& _string) override {
96 if (_enum==ENUM2 && _int==42 && _string=="Space Monkey from the Planet: Space") {
97 return 999;
98 }
99 return _int;
100 }
101
102
103
104 void do_start_a_service() override {
105 running = true;
106 while (!closing) {
107 INFO("Operating...");
108 Time::delay(0.1);
109 }
110 running = false;
111 }
112
113 bool do_check_for_service() override {
114 return running;
115 }
116
117 void do_stop_a_service() override {
118 closing = true;
119 while (running) {
120 Time::delay(0.1);
121 }
122 closing = false;
123 }
124
127 demoStructMap.mapValues["map_0"] = {0, 10};
128 demoStructMap.mapValues["map_1"] = {1, 11};
129 demoStructMap.mapValues["map_2"] = {2, 12};
130 demoStructMap.mapValues["map_3"] = {3, 13};
131 return demoStructMap;
132 }
133
134 bool this_is_a_const_method() const override {
135 return true;
136 }
137};
138
139
140class BrokenServer : public Demo
141{
142public:
143 int32_t get_answer() override {
144 return 42;
145 }
146};
147
148
149class WrappingServer : public Wrapping
150{
151public:
152 int32_t check(const yarp::os::Value& param) override {
153 if (param.isInt32()) {
154 return param.asInt32()+1;
155 }
156 if (param.asString()=="6*7") {
157 return 42;
158 }
159 return 9;
160 }
161
162 Bottle getBottle() override {
163 Bottle b("this is a test (bottle)");
164 return b;
165 }
166};
167
168class DemoStructCallbacks : public DemoStruct::Editor
169{
170public:
171 int wsx, dsx, wsy, dsy;
172
174 wsx = dsx = wsy = dsy = 0;
175 }
176
177 bool will_set_x() override {
178 INFO("will_set_x called, x is " << get_x());
179 wsx = get_x();
180 return true;
181 }
182 bool will_set_y() override {
183 INFO("will_set_y called, y is " << get_y());
184 wsy = get_y();
185 return true;
186 }
187 bool did_set_x() override {
188 INFO("did_set_x called, x is " << get_x());
189 dsx = get_x();
190 return true;
191 }
192 bool did_set_y() override {
193 INFO("did_set_y called, y is " << get_y());
194 dsy = get_y();
195 return true;
196 }
197};
198
199class ClientPeek : public PortReader
200{
201public:
202 bool read(ConnectionReader& con) override {
203 Bottle bot;
204 bot.read(con);
205 INFO("Got " << bot.toString());
206 return true;
207 }
208};
209
210class SettingsReceiver : public Settings::Editor
211{
212public:
215
217 reset();
218 }
219
220 void reset() {
221 called_will_set_id = false;
222 called_did_set_id = false;
223 }
224
225 bool will_set_id() override {
226 called_will_set_id = true;
227 return false;
228 }
229
230 bool did_set_id() override {
231 called_did_set_id = true;
232 return false;
233 }
234};
235
236
237
238TEST_CASE("IdlThriftTest", "[yarp::idl::thrift]")
239{
241
242 SECTION("add one")
243 {
245 Demo client;
246 client.yarp().attachAsClient(client_peek);
247 client.add_one(14);
248
250 Bottle bot("[add] [one] 14");
251 DummyConnector con;
252 bot.write(con.getWriter());
253 server.read(con.getReader());
254 bot.read(con.getReader());
255 INFO("Result is " << bot.toString());
256 CHECK(bot.get(0).asInt32() == 15);
257
258 bot.fromString("[add] [one] 15");
260 bot.write(con2.getWriter());
261 server.read(con2.getReader());
262 bot.read(con2.getReader());
263 INFO("Result is " << bot.toString());
264
265 CHECK(bot.get(0).asInt32() == 16);
266 }
267
268 SECTION("test void")
269 {
271 Demo client;
272 client.yarp().attachAsClient(client_peek);
273 client.test_void(14);
274 client.test_1way(14);
275
277 Bottle bot("[test] [void] 14");
278 DummyConnector con;
279 bot.write(con.getWriter());
280 server.read(con.getReader());
281 bot.read(con.getReader());
282 INFO("Result is " << bot.toString() << " (should be blank)");
283
284 CHECK(bot.size() == 0);
285 CHECK(!bot.isNull());
286 }
287
288 SECTION("test live")
289 {
290 Demo client;
292
295 REQUIRE(client_port.open("/client"));
296 REQUIRE(server_port.open("/server"));
299
300 int x = 0;
301 client.yarp().attachAsClient(client_port);
302 server.yarp().attachAsServer(server_port);
303 x = client.add_one(99);
304 INFO("Result " << x);
305 client.test_void(200);
306 client.test_void(201);
307 x = client.add_one(100);
308 INFO("Result " << x);
309 client.test_1way(200);
310 client.test_1way(201);
311 x = client.add_one(101);
312 INFO("Result " << x);
313
314 CHECK(x == 102);
315 }
316
317 SECTION("test live rpc")
318 {
319 Demo client;
321
324 REQUIRE(client_port.open("/client"));
325 REQUIRE(server_port.open("/server"));
328
329 client.yarp().attachAsClient(client_port);
330 server.yarp().attachAsServer(server_port);
331
332 // Check regular RPC works, even with oneways
333
334 Bottle cmd;
335 Bottle reply;
336
337 cmd.fromString("[add] [one] 5");
338 reply.clear();
339 client_port.write(cmd,reply);
340 INFO("cmd " << cmd.toString() << " reply " << reply.toString());
341
342 CHECK(reply.get(0).asInt32() == 6);
343
344 cmd.fromString("[test] [void] 5");
345 reply.clear();
346 client_port.write(cmd,reply);
347 INFO("cmd " << cmd.toString() << " reply " << reply.toString());
348
349 cmd.fromString("[add] [one] 6");
350 reply.clear();
351 client_port.write(cmd,reply);
352 INFO("cmd " << cmd.toString() << " reply " << reply.toString());
353
354 CHECK(reply.get(0).asInt32() == 7);
355
356 cmd.fromString("[test] [1way] 5");
357 reply.clear();
358 client_port.write(cmd,reply);
359 INFO("cmd " << cmd.toString() << " reply " << reply.toString() << " (reply will be empty)");
360
361 cmd.fromString("[add] [one] 7");
362 reply.clear();
363 client_port.write(cmd,reply);
364 INFO("cmd " << cmd.toString() << " reply " << reply.toString());
365
366 CHECK(reply.get(0).asInt32() == 8);
367 }
368
369 SECTION("test enums")
370 {
371 Demo client;
373
376 REQUIRE(client_port.open("/client"));
377 REQUIRE(server_port.open("/server"));
380 client.yarp().attachAsClient(client_port);
381 server.yarp().attachAsServer(server_port);
382
383 std::vector<DemoEnum> lst1;
384 lst1.push_back(ENUM1);
385 lst1.push_back(ENUM2);
386 std::vector<DemoEnum> lst2 = client.test_enum_vector(lst1);
387 INFO("lst1 " << lst1.size() << " lst2 " << lst2.size());
388
389 CHECK(lst2.size() == 3);
390 CHECK(lst1[0] == lst2[0]);
391 CHECK(lst1[1] == lst2[1]);
392 }
393
394 SECTION("test defaults")
395 {
396 Demo client;
398
401 client_port.open("/client");
402 REQUIRE(server_port.open("/server"));
405 client.yarp().attachAsClient(client_port);
406 server.yarp().attachAsServer(server_port);
407
408 CHECK(client.test_defaults());
409 CHECK_FALSE(client.test_defaults(14));
410 }
411
412 SECTION("test partial")
413 {
415
418 CHECK(client_port.open("/client"));
419 REQUIRE(server_port.open("/server"));
422 server.yarp().attachAsServer(server_port);
423
424 Bottle msg;
425 Bottle reply;
426 msg.fromString("add pair 4 3");
427 client_port.write(msg,reply);
428 INFO(msg.toString() << " -> " << reply.toString());
429
430 CHECK(reply.get(0).asInt32() == 7);
431
432 msg.fromString("add pair 4");
433 client_port.write(msg,reply);
434 INFO("(incomplete) " << msg.toString() << " -> " << reply.toString());
435 CHECK(reply.get(0).asVocab32() == yarp::os::createVocab32('f','a','i','l'));
436
437 msg.fromString("add pair");
438 reply.fromString("0");
439 client_port.write(msg,reply);
440 INFO("(incomplete) " << msg.toString() << " -> " << reply.toString());
441 CHECK(reply.get(0).asVocab32() == yarp::os::createVocab32('f','a','i','l'));
442
443 msg.fromString("add");
444 reply.fromString("0");
445 client_port.write(msg,reply);
446 INFO("(incomplete) " << msg.toString() << " -> " << reply.toString());
447 CHECK(reply.get(0).asVocab32() == yarp::os::createVocab32('f','a','i','l'));
448
449 msg.fromString("");
450 reply.fromString("0");
451 client_port.write(msg,reply);
452 INFO("(incomplete) " << msg.toString() << " -> " << reply.toString());
453 CHECK(reply.get(0).asVocab32() == yarp::os::createVocab32('f','a','i','l'));
454
455 msg.fromString("add pair 10 20");
456 reply.fromString("0");
457 client_port.write(msg,reply);
458 INFO(msg.toString() << " -> " << reply.toString());
459 CHECK(reply.get(0).asInt32() == 30);
460
461 msg.fromString("test partial 10 (40 50 60) 5");
462 reply.fromString("0");
463 client_port.write(msg,reply);
464 INFO(msg.toString() << " -> " << reply.toString());
465 CHECK(reply.get(0).asInt32() == 15);
466
467 msg.fromString("test partial 10 (40 50)");
468 reply.fromString("0");
469 client_port.write(msg,reply);
470 INFO(msg.toString() << " -> " << reply.toString());
471 CHECK(reply.get(0).asVocab32() == yarp::os::createVocab32('f','a','i','l'));
472 }
473
474 SECTION("test defaults with rpc")
475 {
477
480 REQUIRE(client_port.open("/client"));
481 REQUIRE(server_port.open("/server"));
484 server.yarp().attachAsServer(server_port);
485
486 Bottle msg;
487 Bottle reply;
488 msg.fromString("test_tail_defaults");
489 client_port.write(msg,reply);
490 INFO(msg.toString() << " -> " << reply.toString());
491 CHECK(reply.get(0).asInt32() == 42);
492
493 msg.fromString("test_tail_defaults 55");
494 client_port.write(msg,reply);
495 INFO(msg.toString() << " -> " << reply.toString());
496 CHECK(reply.get(0).asInt32() == 999);
497
498 msg.fromString("test longer tail defaults");
499 client_port.write(msg,reply);
500 INFO(msg.toString() << " -> " << reply.toString());
501 CHECK(reply.get(0).asVocab32() == yarp::os::createVocab32('f','a','i','l'));
502
503 msg.fromString("test longer tail defaults 888");
504 client_port.write(msg,reply);
505 INFO(msg.toString() << " -> " << reply.toString());
506 CHECK(reply.get(0).asInt32() == 999);
507
508 msg.fromString("test longer tail defaults 888 ENUM2 47");
509 client_port.write(msg,reply);
510 INFO(msg.toString() << " -> " << reply.toString());
511 CHECK(reply.get(0).asInt32() == 47);
512 }
513
514 SECTION("test names with spaces")
515 {
517
520 REQUIRE(client_port.open("/client"));
521 REQUIRE(server_port.open("/server"));
524 server.yarp().attachAsServer(server_port);
525
526 Bottle msg;
527 Bottle reply;
528 msg.fromString("add_one 42");
529 client_port.write(msg,reply);
530 INFO(msg.toString() << " -> " << reply.toString());
531 CHECK(reply.get(0).asInt32() == 43);
532
533 msg.fromString("add one 52");
534 client_port.write(msg,reply);
535 INFO(msg.toString() << " -> " << reply.toString());
536 CHECK(reply.get(0).asInt32() == 53);
537
538 msg.fromString("get_answer");
539 client_port.write(msg,reply);
540 INFO(msg.toString() << " -> " << reply.toString());
541 CHECK(reply.get(0).asInt32() == 42);
542
543 msg.fromString("get answer");
544 client_port.write(msg,reply);
545 INFO(msg.toString() << " -> " << reply.toString());
546 CHECK(reply.get(0).asInt32() == 42);
547 }
548
549 SECTION("test surface mesh")
550 {
552 Box3D bb;
553 mesh.meshName = "testing";
554 bb.corners.push_back(PointXYZ(1,2,3));
556
557 Bottle bot;
558 bot.read(obj);
559
561 bot.write(obj2);
562 Bottle bot2;
563 bot2.read(obj2);
564
565 INFO("mesh copy: " << bot.toString() << " -> " << bot2.toString());
566
567 CHECK(obj2.mesh.meshName == obj.mesh.meshName);
568 CHECK(obj2.boundingBox.corners.size() == obj.boundingBox.corners.size());
569 CHECK(bot == bot2);
570 }
571
572 SECTION("test wrapping")
573 {
574 Wrapping client;
576
579 REQUIRE(client_port.open("/client"));
580 REQUIRE(server_port.open("/server"));
583
584 int x = 0;
585 client.yarp().attachAsClient(client_port);
586 server.yarp().attachAsServer(server_port);
587 x = client.check(Value(99));
588 INFO("Result " << x);
589 CHECK(x == 100);
590 x = client.check(Value("6*7"));
591 INFO("Result " << x);
592 CHECK(x == 42);
593 x = client.check(Value("test"));
594 INFO("Result " << x);
595 CHECK(x == 9);
596
597 Bottle b = client.getBottle();
598 INFO("Bottle is " << b.toString());
599 CHECK(b.size() == 5);
600
601 Bottle cmd;
602 Bottle reply;
603 cmd.fromString("getBottle");
604 client_port.write(cmd,reply);
605 INFO("Bottle is " << reply.get(0).toString());
606 CHECK(reply.size() == 5);
607 }
608
609 SECTION("test_missing_method")
610 {
611 Demo client;
613
616 REQUIRE(client_port.open("/client"));
617 REQUIRE(server_port.open("/server"));
620
621 int x = 0;
622 client.yarp().attachAsClient(client_port);
623 server.yarp().attachAsServer(server_port);
624 x = client.get_answer();
625 INFO("Answer " << x);
626 CHECK(x == 42);
627
628 x = client.add_one(88);
629 INFO("AddOne gives " << x);
630 CHECK(x != 89);
631 }
632
633 SECTION("test unwrap")
634 {
636 s.lst.push_back(DemoStruct(5,10));
637 s.lst.push_back(DemoStruct(9,900));
638 Bottle b;
639 b.read(s);
640 INFO("Wrapped: " << b.toString());
641 CHECK(b.size() == 1);
642
643 DemoStructList::unwrapped s2;
644 s2.content.lst = s.lst;
645 b.read(s2);
646 INFO("Wrapped: " << b.toString());
647 CHECK(b.size() == 2);
648 }
649
650 SECTION("test tostring")
651 {
653 s.lst.push_back(DemoStruct(5,10));
654 s.lst.push_back(DemoStruct(9,900));
655 INFO("String: " << s.toString());
656 CHECK(s.toString() == "((5 10) (9 900))");
657
658 DemoStruct d;
659 d.x = 10;
660 d.y = 20;
661 INFO("String: " << d.toString());
662 CHECK(d.toString() == "10 20");
663 }
664
665 SECTION("test editor")
666 {
667 DemoStruct d;
668 d.x = 0;
669 d.y = 0;
670 DemoStruct::Editor e;
671 e.edit(d,false);
672 e.set_x(15);
673 Bottle b;
674 b.read(e);
675 INFO(">>> set_x -> " << b.toString());
676 CHECK(b.size() == 2);
677 REQUIRE(b.get(1).asList() != nullptr);
678 CHECK(b.get(1).asList()->get(0).asString() == "set");
679 CHECK(b.get(1).asList()->get(1).asString() == "x");
680 CHECK(b.get(1).asList()->get(2).asInt32() == 15);
681
682 e.clean();
683 e.set_y(30);
684 b.read(e);
685 INFO(">>> set_y -> " << b.toString());
686 CHECK(b.size() == 2);
687 REQUIRE(b.get(1).asList() != nullptr);
688 CHECK(b.get(1).asList()->get(1).asString() == "y");
689 CHECK(b.get(1).asList()->get(2).asInt32() ==30);
690
691 e.clean();
692 e.set_x(1);
693 e.set_y(2);
694 b.read(e);
695 INFO(">>> set_x set_y -> " << b.toString());
696 CHECK(b.size() == 3);
697 REQUIRE(b.get(1).asList() != nullptr);
698 REQUIRE(b.get(2).asList() != nullptr);
699 CHECK(b.get(1).asList()->get(1).asString() == "x");
700 CHECK(b.get(1).asList()->get(2).asInt32() == 1);
701 CHECK(b.get(2).asList()->get(1).asString() == "y");
702 CHECK(b.get(2).asList()->get(2).asInt32() == 2);
703
704 DemoStruct d2;
705 DemoStruct::Editor e2;
706 e2.edit(d2,false);
707 d2.x = 99;
708 d2.y = 99;
709 e.clean();
710 e.set_y(30);
712 CHECK(d2.x == 99);
713 CHECK(d2.y == 30);
714
716 c.edit(d2,false);
717 d2.x = 99;
718 d2.y = 99;
719 c.clean();
720 c.set_y(30);
721 CHECK(c.wsy == 99);
722 CHECK(c.dsy == 30);
723
724 DemoStruct d3;
725 d3.x = 0;
726 d3.y = 0;
728 c2.edit(d3,false);
730 CHECK(c2.wsy == 0);
731 CHECK(c2.dsy == 30);
732 }
733
734
735 SECTION("test list editor")
736 {
738 d.int_list.resize(5);
739 DemoStructExt::Editor e;
740 e.edit(d,false);
741 e.set_int_list(4,15);
742 Bottle b;
743 b.read(e);
744 INFO(">>> set_int_list -> " << b.toString());
745 CHECK(b.size() == 2);
746 REQUIRE(b.get(1).asList() != nullptr);
747 CHECK(b.get(1).asList()->get(1).asString() == "int_list");
748 REQUIRE(b.get(1).asList()->get(2).asList() != nullptr);
749 CHECK(b.get(1).asList()->get(2).asList()->get(4).asInt32() == 15);
750 }
751
752 SECTION("test general help")
753 {
755 Bottle bot("[help]");
756 DummyConnector con;
757 bot.write(con.getWriter());
758 server.read(con.getReader());
759 bot.read(con.getReader());
760 INFO("Service general help is " << bot.toString());
761 std::string help = bot.toString();
762 CHECK(help.find("get_answer") != std::string::npos);
763 }
764
765 SECTION("test specific help")
766 {
768 Bottle bot("[help] get_answer");
769 DummyConnector con;
770 bot.write(con.getWriter());
771 server.read(con.getReader());
772 bot.read(con.getReader());
773 INFO("Service specific help is " << bot.toString());
774 std::string help = bot.toString();
775 CHECK(help.find("gets the answer") != std::string::npos);
776 }
777
778 SECTION("test structure general help")
779 {
780 DemoStruct d;
781 DemoStruct::Editor e;
782 e.edit(d,false);
783 Bottle bot("help");
784 DummyConnector con;
785
786 bot.write(con.getWriter());
787 e.read(con.getReader());
788 bot.read(con.getReader());
789 INFO("Structure general help is " << bot.toString());
790 std::string help = bot.toString();
791 CHECK(help.find('x') != std::string::npos);
792 }
793
794 SECTION("test structure specific help")
795 {
796 DemoStruct d;
797 DemoStruct::Editor e;
798 e.edit(d,false);
799 Bottle bot("help x");
800 DummyConnector con;
801
802 bot.write(con.getWriter());
803 e.read(con.getReader());
804 bot.read(con.getReader());
805 INFO("Structure specific help is " << bot.toString());
806 std::string help = bot.toString();
807 CHECK(help.find("this is the \\\"x\\\" part") != std::string::npos);
808 }
809
810 SECTION("test primitives")
811 {
814 Bottle tmp;
815 a.a_bool = true;
816 a.a_i8 = 8;
817 a.a_i16 = 16;
818 a.a_i32 = 32;
819 a.a_i64 = 64;
820 a.a_double = 0.64;
821 a.a_string = "A string";
822
823 REQUIRE(tmp.read(a));
824 REQUIRE(tmp.write(b));
825
826 CHECK(a.a_bool == b.a_bool);
827 CHECK(a.a_i16 == b.a_i16);
828 CHECK(a.a_i32 == b.a_i32);
829 CHECK(a.a_i64 == b.a_i64);
830 CHECK(a.a_double == b.a_double);
831 CHECK(a.a_string == b.a_string);
832
833 }
834
835 SECTION("test lists")
836 {
839 Bottle tmp;
840
841 a.a_list_of_bool = std::vector<bool>({true, false});
842 a.a_list_of_i8 = std::vector<std::int8_t>({-8, 8});
843 a.a_list_of_i16 = std::vector<std::int16_t>({-16, 16});
844 a.a_list_of_i32 = std::vector<std::int32_t>({-32, 32});
845 a.a_list_of_i64 = std::vector<std::int64_t>({-64, 64});
846 a.a_list_of_double = std::vector<double>({-0.64, 0.64});
847 a.a_list_of_string = std::vector<std::string>({"A string", "Another string"});
848 a.a_list_of_binary.resize(2);
849 a.a_list_of_binary[0].resize(6);
850 memset(a.a_list_of_binary[0].data(), 0, a.a_list_of_binary[0].size());
851 a.a_list_of_binary[0][a.a_list_of_binary[0].size() - 1] = 'C';
852 a.a_list_of_binary[1].resize(12);
853 memset(a.a_list_of_binary[1].data(), 0, a.a_list_of_binary[1].size());
854 a.a_list_of_binary[1][a.a_list_of_binary[1].size() - 1] = 'D';
855
856 a.a_list_of_list_of_double.resize(2);
857 a.a_list_of_list_of_double[0] = std::vector<double>({-0.64, 0.64});
858 a.a_list_of_list_of_double[1] = std::vector<double>({-0.32, 0.32});
859
860 REQUIRE(tmp.read(a));
861 REQUIRE(tmp.write(b));
862
863 CHECK(b.a_list_of_bool.size() == a.a_list_of_bool.size());
864 CHECK(b.a_list_of_bool[0] == a.a_list_of_bool[0]);
865 CHECK(b.a_list_of_bool[1] == a.a_list_of_bool[1]);
866 CHECK(b.a_list_of_i8.size() == a.a_list_of_i8.size());
867 CHECK(b.a_list_of_i8[0] == a.a_list_of_i8[0]);
868 CHECK(b.a_list_of_i8[1] == a.a_list_of_i8[1]);
869 CHECK(b.a_list_of_i16.size() == a.a_list_of_i16.size());
870 CHECK(b.a_list_of_i16[0] == a.a_list_of_i16[0]);
871 CHECK(b.a_list_of_i16[1] == a.a_list_of_i16[1]);
872 CHECK(b.a_list_of_i32.size() == a.a_list_of_i32.size());
873 CHECK(b.a_list_of_i32[0] == a.a_list_of_i32[0]);
874 CHECK(b.a_list_of_i32[1] == a.a_list_of_i32[1]);
875 CHECK(b.a_list_of_i64.size() == a.a_list_of_i64.size());
876 CHECK(b.a_list_of_i64[0] == a.a_list_of_i64[0]);
877 CHECK(b.a_list_of_i64[1] == a.a_list_of_i64[1]);
878 CHECK(b.a_list_of_double.size() == a.a_list_of_double.size());
879 CHECK(b.a_list_of_double[0] == a.a_list_of_double[0]);
880 CHECK(b.a_list_of_double[1] == a.a_list_of_double[1]);
881 CHECK(b.a_list_of_string.size() == a.a_list_of_string.size());
882 CHECK(b.a_list_of_string[0] == a.a_list_of_string[0]);
883 CHECK(b.a_list_of_string[1] == a.a_list_of_string[1]);
884 CHECK(b.a_list_of_binary.size() == a.a_list_of_binary.size());
885 CHECK(b.a_list_of_binary[0].size() == 6);
886 CHECK(b.a_list_of_binary[1].size() == 12);
887 CHECK(b.a_list_of_binary[0][5] == 'C');
888 CHECK(b.a_list_of_binary[1][11] == 'D');
889
890 CHECK(b.a_list_of_list_of_double.size() == a.a_list_of_list_of_double.size());
891 CHECK(b.a_list_of_list_of_double[0].size() == a.a_list_of_list_of_double[0].size());
892 CHECK(b.a_list_of_list_of_double[0][0] == a.a_list_of_list_of_double[0][0]);
893 CHECK(b.a_list_of_list_of_double[0][1] == a.a_list_of_list_of_double[0][1]);
894 CHECK(b.a_list_of_list_of_double[1].size() == a.a_list_of_list_of_double[1].size());
895 CHECK(b.a_list_of_list_of_double[1][0] == a.a_list_of_list_of_double[1][0]);
896 CHECK(b.a_list_of_list_of_double[1][1] == a.a_list_of_list_of_double[1][1]);
897 }
898
899 SECTION("test some maps")
900 {
901 TestSomeMaps a;
902 TestSomeMaps b;
903 Bottle tmp;
904
905 a.a_map_of_list_of_double["first"] = std::vector<double>({-0.64, 0.64});
906 a.a_map_of_list_of_double["second"] = std::vector<double>({-0.32, 0.32});
907 a.a_map_of_list_of_list_of_double["first"].push_back(std::vector<double>({-0.16, 0.16}));
908 a.a_map_of_list_of_list_of_double["first"].push_back(std::vector<double>({-0.08, 0.08}));
909 a.a_map_of_list_of_list_of_double["second"].push_back(std::vector<double>({-0.04, 0.04}));
910 a.a_map_of_list_of_list_of_double["second"].push_back(std::vector<double>({-0.02, 0.02}));
911
912 a.a_list_of_maps_of_doubles.push_back(std::map<std::string, double>({{"0first", 0.1}, {"0second", 0.2}}));
913 a.a_list_of_maps_of_doubles.push_back(std::map<std::string, double>({{"1first", 1.1}, {"1second", 1.2}}));
914
915 REQUIRE(tmp.read(a));
916 REQUIRE(tmp.write(b));
917
918 CHECK(b.a_map_of_list_of_double.size() == a.a_map_of_list_of_double.size());
919 CHECK(b.a_map_of_list_of_double["first"].size() == a.a_map_of_list_of_double["first"].size());
920 CHECK(b.a_map_of_list_of_double["first"][0] == a.a_map_of_list_of_double["first"][0]);
921 CHECK(b.a_map_of_list_of_double["first"][1] == a.a_map_of_list_of_double["first"][1]);
922 CHECK(b.a_map_of_list_of_double["second"].size() == a.a_map_of_list_of_double["second"].size());
923 CHECK(b.a_map_of_list_of_double["second"][0] == a.a_map_of_list_of_double["second"][0]);
924 CHECK(b.a_map_of_list_of_double["second"][1] == a.a_map_of_list_of_double["second"][1]);
925
926 CHECK(b.a_map_of_list_of_list_of_double.size() == a.a_map_of_list_of_list_of_double.size());
927 CHECK(b.a_map_of_list_of_list_of_double["first"].size() == a.a_map_of_list_of_list_of_double["first"].size());
928 CHECK(b.a_map_of_list_of_list_of_double["first"][0].size() == a.a_map_of_list_of_list_of_double["first"][0].size());
929 CHECK(b.a_map_of_list_of_list_of_double["first"][0][0] == a.a_map_of_list_of_list_of_double["first"][0][0]);
930 CHECK(b.a_map_of_list_of_list_of_double["first"][0][1] == a.a_map_of_list_of_list_of_double["first"][0][1]);
931 CHECK(b.a_map_of_list_of_list_of_double["first"][1].size() == a.a_map_of_list_of_list_of_double["first"][1].size());
932 CHECK(b.a_map_of_list_of_list_of_double["first"][1][0] == a.a_map_of_list_of_list_of_double["first"][1][0]);
933 CHECK(b.a_map_of_list_of_list_of_double["first"][1][1] == a.a_map_of_list_of_list_of_double["first"][1][1]);
934 CHECK(b.a_map_of_list_of_list_of_double["second"].size() == a.a_map_of_list_of_list_of_double["second"].size());
935 CHECK(b.a_map_of_list_of_list_of_double["second"][0].size() == a.a_map_of_list_of_list_of_double["second"][0].size());
936 CHECK(b.a_map_of_list_of_list_of_double["second"][0][0] == a.a_map_of_list_of_list_of_double["second"][0][0]);
937 CHECK(b.a_map_of_list_of_list_of_double["second"][0][1] == a.a_map_of_list_of_list_of_double["second"][0][1]);
938 CHECK(b.a_map_of_list_of_list_of_double["second"][1].size() == a.a_map_of_list_of_list_of_double["second"][1].size());
939 CHECK(b.a_map_of_list_of_list_of_double["second"][1][0] == a.a_map_of_list_of_list_of_double["second"][1][0]);
940 CHECK(b.a_map_of_list_of_list_of_double["second"][1][1] == a.a_map_of_list_of_list_of_double["second"][1][1]);
941
942 CHECK(b.a_list_of_maps_of_doubles.size() == a.a_list_of_maps_of_doubles.size());
943 CHECK(b.a_list_of_maps_of_doubles[0]["0first"] == a.a_list_of_maps_of_doubles[0]["0first"]);
944 CHECK(b.a_list_of_maps_of_doubles[0]["0second"] == a.a_list_of_maps_of_doubles[0]["0second"]);
945 CHECK(b.a_list_of_maps_of_doubles[1]["1first"] == a.a_list_of_maps_of_doubles[1]["1first"]);
946 CHECK(b.a_list_of_maps_of_doubles[1]["1second"] == a.a_list_of_maps_of_doubles[1]["1second"]);
947 }
948
949 SECTION("test lists with previous data")
950 {
953 Bottle tmp;
954
955 a.a_list_of_bool = std::vector<bool>({true, false});
956 a.a_list_of_i8 = std::vector<std::int8_t>({-8, 8});
957 a.a_list_of_i16 = std::vector<std::int16_t>({-16, 16});
958 a.a_list_of_i32 = std::vector<std::int32_t>({-32, 32});
959 a.a_list_of_i64 = std::vector<std::int64_t>({-64, 64});
960 a.a_list_of_double = std::vector<double>({-0.64, 0.64});
961 a.a_list_of_string = std::vector<std::string>({"A string", "Another string"});
962 a.a_list_of_binary.resize(2);
963 a.a_list_of_binary[0].resize(6);
964 memset(a.a_list_of_binary[0].data(), 0, a.a_list_of_binary[0].size());
965 a.a_list_of_binary[0][a.a_list_of_binary[0].size() - 1] = 'C';
966 a.a_list_of_binary[1].resize(12);
967 memset(a.a_list_of_binary[1].data(), 0, a.a_list_of_binary[1].size());
968 a.a_list_of_binary[1][a.a_list_of_binary[1].size() - 1] = 'D';
969
970 b.a_list_of_bool = std::vector<bool>({false, true, false});
971 b.a_list_of_i8 = std::vector<std::int8_t>({8, -8, 8});
972 b.a_list_of_i16 = std::vector<std::int16_t>({16, -16, 16});
973 b.a_list_of_i32 = std::vector<std::int32_t>({32, -32, 32});
974 b.a_list_of_i64 = std::vector<std::int64_t>({64, -64, 64});
975 b.a_list_of_double = std::vector<double>({0.64, -0.64, 0.64});
976 b.a_list_of_string = std::vector<std::string>({"The string", "A string", "Another string"});
977 b.a_list_of_binary.resize(3);
978 b.a_list_of_binary[0].resize(12);
979 memset(b.a_list_of_binary[0].data(), 0, b.a_list_of_binary[0].size());
980 b.a_list_of_binary[0][b.a_list_of_binary[0].size() - 1] = 'E';
981 b.a_list_of_binary[1].resize(6);
982 memset(b.a_list_of_binary[1].data(), 0, b.a_list_of_binary[1].size());
983 b.a_list_of_binary[1][b.a_list_of_binary[1].size() - 1] = 'F';
984 b.a_list_of_binary[2].resize(12);
985 memset(b.a_list_of_binary[2].data(), 0, b.a_list_of_binary[2].size());
986 b.a_list_of_binary[2][b.a_list_of_binary[2].size() - 1] = 'G';
987
988 REQUIRE(tmp.read(a));
989 REQUIRE(tmp.write(b));
990
991 CHECK(b.a_list_of_bool.size() == a.a_list_of_bool.size());
992 CHECK(b.a_list_of_bool[0] == a.a_list_of_bool[0]);
993 CHECK(b.a_list_of_bool[1] == a.a_list_of_bool[1]);
994 CHECK(b.a_list_of_i8.size() == a.a_list_of_i8.size());
995 CHECK(b.a_list_of_i8[0] == a.a_list_of_i8[0]);
996 CHECK(b.a_list_of_i8[1] == a.a_list_of_i8[1]);
997 CHECK(b.a_list_of_i16.size() == a.a_list_of_i16.size());
998 CHECK(b.a_list_of_i16[0] == a.a_list_of_i16[0]);
999 CHECK(b.a_list_of_i16[1] == a.a_list_of_i16[1]);
1000 CHECK(b.a_list_of_i32.size() == a.a_list_of_i32.size());
1001 CHECK(b.a_list_of_i32[0] == a.a_list_of_i32[0]);
1002 CHECK(b.a_list_of_i32[1] == a.a_list_of_i32[1]);
1003 CHECK(b.a_list_of_i64.size() == a.a_list_of_i64.size());
1004 CHECK(b.a_list_of_i64[0] == a.a_list_of_i64[0]);
1005 CHECK(b.a_list_of_i64[1] == a.a_list_of_i64[1]);
1006 CHECK(b.a_list_of_double.size() == a.a_list_of_double.size());
1007 CHECK(b.a_list_of_double[0] == a.a_list_of_double[0]);
1008 CHECK(b.a_list_of_double[1] == a.a_list_of_double[1]);
1009 CHECK(b.a_list_of_string.size() == a.a_list_of_string.size());
1010 CHECK(b.a_list_of_string[0] == a.a_list_of_string[0]);
1011 CHECK(b.a_list_of_string[1] == a.a_list_of_string[1]);
1012 CHECK(b.a_list_of_binary.size() == a.a_list_of_binary.size());
1013 CHECK(b.a_list_of_binary[0].size() == 6);
1014 CHECK(b.a_list_of_binary[1].size() == 12);
1015 CHECK(b.a_list_of_binary[0][5] == 'C');
1016 CHECK(b.a_list_of_binary[1][11] == 'D');
1017 }
1018
1019 SECTION("test empty lists")
1020 {
1021 TestSomeLists a;
1022 TestSomeLists b;
1023 Bottle tmp;
1024
1025 // Fill b with random stuff
1026 b.a_list_of_bool = std::vector<bool>({true, false});
1027 b.a_list_of_i8 = std::vector<std::int8_t>({-8, 8});
1028 b.a_list_of_i16 = std::vector<std::int16_t>({-16, 16});
1029 b.a_list_of_i32 = std::vector<std::int32_t>({-32, 32});
1030 b.a_list_of_i64 = std::vector<std::int64_t>({-64, 64});
1031 b.a_list_of_double = std::vector<double>({-0.64, 0.64});
1032 b.a_list_of_string = std::vector<std::string>({"A string", "Another string"});
1033 b.a_list_of_binary.resize(2);
1034 b.a_list_of_binary[0].resize(6);
1035 memset(b.a_list_of_binary[0].data(), 0, b.a_list_of_binary[0].size());
1036 b.a_list_of_binary[0][b.a_list_of_binary[0].size() - 1] = 'C';
1037 b.a_list_of_binary[1].resize(12);
1038 memset(b.a_list_of_binary[1].data(), 0, b.a_list_of_binary[1].size());
1039 b.a_list_of_binary[1][b.a_list_of_binary[1].size() - 1] = 'D';
1040
1041 REQUIRE(tmp.read(a));
1042 REQUIRE(tmp.write(b));
1043
1044 CHECK(b.a_list_of_bool.empty());
1045 CHECK(b.a_list_of_i8.empty());
1046 CHECK(b.a_list_of_i16.empty());
1047 CHECK(b.a_list_of_i32.empty());
1048 CHECK(b.a_list_of_i64.empty());
1049 CHECK(b.a_list_of_double.empty());
1050 CHECK(b.a_list_of_string.empty());
1051 CHECK(b.a_list_of_binary.empty());
1052 }
1053
1054 SECTION("test annotated types")
1055 {
1058 Bottle tmp;
1059 a.a_vocab = yarp::os::createVocab32('d', 'e', 'm', 'o');
1060 a.a_ui8 = 0xff;
1061 a.a_ui16 = 0xffff;
1062 a.a_ui32 = 0xffffffff;
1063 a.a_ui64 = 0xffffffffffffffff;
1064 a.a_float32 = 0.32;
1065 a.a_float64 = 0.64;
1066 a.a_size = sizeof(TestAnnotatedTypes);
1067
1068 REQUIRE(tmp.read(a));
1069 REQUIRE(tmp.write(b));
1070
1071 CHECK(a.a_vocab == b.a_vocab);
1072 CHECK(a.a_ui8 == b.a_ui8);
1073 CHECK(a.a_ui16 == b.a_ui16);
1074 CHECK(a.a_ui32 == b.a_ui32);
1075 CHECK(a.a_ui64 == b.a_ui64);
1076 CHECK(a.a_float32 == b.a_float32);
1077 CHECK(a.a_float64 == b.a_float64);
1078 }
1079
1080 SECTION("test settings")
1081 {
1082 Settings::Editor settings;
1083 SettingsReceiver receiver;
1084
1087
1088 settings.yarp().attachAsClient(sender_port);
1089 receiver.yarp().attachAsServer(receiver_port);
1090
1091 REQUIRE(sender_port.open("/sender"));
1092 REQUIRE(receiver_port.open("/receiver"));
1094 REQUIRE(b_conn);
1095
1096 settings.set_id(5);
1097 CHECK(receiver.state().id == 5); // int assignment
1098
1099 settings.set_name("hello");
1100 CHECK(receiver.state().name == "hello"); // string assignment
1101
1102 settings.start_editing();
1103 settings.set_id(6);
1104 CHECK(receiver.state().id == 5); // not too early
1105
1106 settings.set_name("world");
1107 CHECK(receiver.state().name == "hello"); // string not too early
1108 settings.stop_editing();
1109 CHECK(receiver.state().id == 6); // int group
1110 CHECK(receiver.state().name == "world"); // string group
1111
1112 yarp::os::Bottle cmd;
1113 yarp::os::Bottle reply;
1114 cmd.fromString("patch (set id 3) (set name frog)");
1115 sender_port.write(cmd,reply);
1116 CHECK(reply.toString() == "[ok]"); // return on success
1117 CHECK(receiver.state().id == 3); // id ok
1118 CHECK(receiver.state().name == "frog"); // name ok
1119
1120 cmd.fromString("set id 9");
1121 reply.clear();
1122 sender_port.write(cmd,reply);
1123 CHECK(receiver.state().id == 9); // set id ok
1124
1125 cmd.fromString("set id 99 name \"Space Monkey\"");
1126 reply.clear();
1127 sender_port.write(cmd,reply);
1128 CHECK(receiver.state().id == 99); // multi set ok
1129 CHECK(receiver.state().name == "Space Monkey"); // multi set ok
1130
1131 cmd.fromString("set id 99 name \"Space Monkey\" id 101");
1132 reply.clear();
1133 sender_port.write(cmd,reply);
1134 CHECK(receiver.state().id == 101); // triple set ok
1135 }
1136
1137 SECTION("test start/stop")
1138 {
1139 Demo client;
1140 Server server;
1143 REQUIRE(client_port.open("/client"));
1144 REQUIRE(server_port.open("/server"));
1146 REQUIRE(b_conn);
1147 client.yarp().attachAsClient(client_port);
1148 server.yarp().attachAsServer(server_port);
1149
1150 INFO("Starting a long operation");
1151 client.do_start_a_service();
1152 Time::delay(1);
1153 INFO("Stopping a long operation");
1154 client.do_stop_a_service();
1155 }
1156
1157 SECTION("test map types")
1158 {
1159 Demo client;
1160 Server server;
1163 REQUIRE(client_port.open("/client"));
1164 REQUIRE(server_port.open("/server"));
1166 REQUIRE(b_conn);
1167 client.yarp().attachAsClient(client_port);
1168 server.yarp().attachAsServer(server_port);
1169
1170 INFO("Requesting a map type");
1171 DemoStructMap demoStructMap = client.get_demo_map_struct();
1172 CHECK(demoStructMap.mapValues.size() == 4);
1173 CHECK(demoStructMap.mapValues["map_0"].x == 0);
1174 CHECK(demoStructMap.mapValues["map_0"].y == 10);
1175 CHECK(demoStructMap.mapValues["map_1"].x == 1);
1176 CHECK(demoStructMap.mapValues["map_1"].y == 11);
1177 CHECK(demoStructMap.mapValues["map_2"].x == 2);
1178 CHECK(demoStructMap.mapValues["map_2"].y == 12);
1179 CHECK(demoStructMap.mapValues["map_3"].x == 3);
1180 CHECK(demoStructMap.mapValues["map_3"].y == 13);
1181 }
1182
1183 SECTION("test const")
1184 {
1185 Demo client;
1186 Server server;
1189 REQUIRE(client_port.open("/client"));
1190 REQUIRE(server_port.open("/server"));
1192 REQUIRE(b_conn);
1193 client.yarp().attachAsClient(client_port);
1194 server.yarp().attachAsServer(server_port);
1195
1196 INFO("calling a const method");
1197 CHECK(const_cast<const Demo&>(client).this_is_a_const_method());
1198 }
1199
1201}
1202
1203int main(int argc, char* argv[])
1204{
1205 Network yarp;
1206 return Catch::Session().run(argc, argv);
1207}
int32_t get_answer() override
Definition main.cpp:143
bool read(ConnectionReader &con) override
Read this object from a network connection.
Definition main.cpp:202
bool will_set_y() override
Definition main.cpp:182
bool did_set_y() override
Definition main.cpp:192
bool will_set_x() override
Definition main.cpp:177
bool did_set_x() override
Definition main.cpp:187
int32_t get_answer() override
Definition main.cpp:45
void do_stop_a_service() override
Definition main.cpp:117
int32_t add_one(const int32_t x) override
Definition main.cpp:49
bool do_check_for_service() override
Definition main.cpp:113
void do_start_a_service() override
Definition main.cpp:104
void test_void(const int32_t x) override
Definition main.cpp:59
void test_1way(const int32_t x) override
Definition main.cpp:63
int32_t test_tail_defaults(const DemoEnum x) override
Definition main.cpp:87
bool this_is_a_const_method() const override
Definition main.cpp:134
int32_t add_pair(const int32_t x, const int32_t y) override
Definition main.cpp:54
Server()
Definition main.cpp:40
int32_t test_longer_tail_defaults(const int32_t ignore, const DemoEnum _enum, const int32_t _int, const std::string &_string) override
Definition main.cpp:94
DemoStructMap get_demo_map_struct() override
Definition main.cpp:125
std::vector< DemoEnum > test_enum_vector(const std::vector< DemoEnum > &x) override
Definition main.cpp:72
bool test_defaults(const int32_t x) override
Definition main.cpp:67
int32_t test_partial(const int32_t x, const std::vector< int32_t > &lst, const int32_t y) override
Definition main.cpp:79
bool will_set_id() override
Definition main.cpp:225
bool called_did_set_id
Definition main.cpp:214
bool called_will_set_id
Definition main.cpp:213
bool did_set_id() override
Definition main.cpp:230
Bottle getBottle() override
Definition main.cpp:162
int32_t check(const yarp::os::Value &param) override
Definition main.cpp:152
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:65
void fromString(const std::string &text)
Initializes bottle from a string.
Definition Bottle.cpp:210
size_type size() const
Gets the number of elements in the bottle.
Definition Bottle.cpp:257
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Definition Bottle.cpp:246
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Definition Bottle.cpp:252
void clear()
Empties the bottle of any objects it contains.
Definition Bottle.cpp:121
bool write(ConnectionWriter &writer) const override
Output a representation of the bottle to a network connection.
Definition Bottle.cpp:236
bool isNull() const override
Checks if the object is invalid.
Definition Bottle.cpp:349
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition Bottle.cpp:217
A mini-server for performing network communication in the background.
std::string getName() const override
Get name of port.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
T * read(bool shouldWait=true) override
Read an available object from the port.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
An interface for reading from a network connection.
A dummy connection to test yarp::os::Portable implementations.
ConnectionWriter & getWriter()
Get the dummy ConnectionWriter loaded with whatever was written the ConnectionWriter since it was las...
ConnectionReader & getReader(ConnectionWriter *replyWriter=nullptr)
Get the dummy ConnectionReader loaded with whatever was written the ConnectionWriter since it was las...
static bool connect(const std::string &src, const std::string &dest, const std::string &carrier="", bool quiet=true)
Request that an output port connect to an input port.
Definition Network.cpp:751
static bool setLocalMode(bool flag)
Chooses whether communication is process-local.
Definition Network.cpp:1118
Utilities for manipulating the YARP network, including initialization and shutdown.
Definition Network.h:718
Interface implemented by all objects that can read themselves from the network, such as Bottle object...
Definition PortReader.h:24
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
Definition Portable.cpp:16
A port that is specialized as an RPC client.
Definition RpcClient.h:22
A port that is specialized as an RPC server.
Definition RpcServer.h:23
A single value (typically within a Bottle).
Definition Value.h:44
virtual yarp::conf::vocab32_t asVocab32() const
Get 32 bit vocabulary identifier as an integer.
Definition Value.cpp:234
virtual std::int32_t asInt32() const
Get 32-bit integer value.
Definition Value.cpp:210
virtual Bottle * asList() const
Get list value.
Definition Value.cpp:252
std::string toString() const override
Return a standard text representation of the content of the object.
Definition Value.cpp:368
virtual bool isInt32() const
Checks if value is a 32-bit integer.
Definition Value.cpp:132
virtual std::string asString() const
Get string value.
Definition Value.cpp:246
int main(int argc, char *argv[])
Definition main.cpp:1203
TEST_CASE("IdlThriftTest", "[yarp::idl::thrift]")
Definition main.cpp:238
void delay(double seconds)
Wait for a certain number of seconds.
Definition Time.cpp:111
The components from which ports and connections are built.
An interface to the operating system, including Port based communication.
Definition OSTestMsg.cpp:13
constexpr yarp::conf::vocab32_t createVocab32(char a, char b=0, char c=0, char d=0)
Create a vocab from chars.
Definition Vocab32.h:27
The main, catch-all namespace for YARP.
Definition dirs.h:16
#define YARP_UNUSED(var)
Definition api.h:162
std::string INFO
Definition ymanager.cpp:54