@@ -78,16 +78,13 @@ namespace rtl_bench
7878 void BenchMark::reflectedCall_noReturn (benchmark::State& state)
7979 {
8080 static rtl::Function sendMsg = cxx_mirror ().getFunction (" sendMessage" ).value ();
81-
8281 static auto _ = []() {
83- if (sendMsg.bind ().call (g_longStr).err == rtl::error::None) {
84- std::cout << " [rtl:0] call success.\n " ;
85- }
86- else {
87- std::cout << " [rtl:0] call failed.\n " ;
82+ auto err = sendMsg.bind ().call (g_longStr).err ;
83+ if (err != rtl::error::None) {
84+ std::cout << " [rtl:0] err: " << rtl::to_string (err)<<" \n " ;
8885 }
8986 return 0 ;
90- }();
87+ }();
9188
9289 for (auto _ : state)
9390 {
@@ -102,14 +99,12 @@ namespace rtl_bench
10299 static rtl::Method sendMsg = rNode.getMethod (" sendMessage" ).value ();
103100 static rtl::RObject robj = rNode.create <rtl::alloc::Stack>().rObject ;
104101 static auto _ = []() {
105- if (sendMsg.bind (robj).call (g_longStr).err == rtl::error::None) {
106- std::cout << " [rtl:1] call success.\n " ;
107- }
108- else {
109- std::cout << " [rtl:1] call failed.\n " ;
102+ auto err = sendMsg.bind (robj).call (g_longStr).err ;
103+ if (err != rtl::error::None) {
104+ std::cout << " [rtl:1] err: " << rtl::to_string (err) << " \n " ;
110105 }
111106 return 0 ;
112- }();
107+ }();
113108
114109 for (auto _ : state)
115110 {
@@ -122,11 +117,9 @@ namespace rtl_bench
122117 {
123118 static rtl::Function getMsg = cxx_mirror ().getFunction (" getMessage" ).value ();
124119 static auto _ = []() {
125- if (getMsg.bind ().call (g_longStr).err == rtl::error::None) {
126- std::cout << " [rtl:2] call success.\n " ;
127- }
128- else {
129- std::cout << " [rtl:2] call failed.\n " ;
120+ auto err = getMsg.bind ().call (g_longStr).err ;
121+ if (err != rtl::error::None) {
122+ std::cout << " [rtl:2] err: " << rtl::to_string (err) << " \n " ;
130123 }
131124 return 0 ;
132125 }();
@@ -144,11 +137,9 @@ namespace rtl_bench
144137 static rtl::Method getMsg = rNode.getMethod (" getMessage" ).value ();
145138 static rtl::RObject robj = rNode.create <rtl::alloc::Heap>().rObject ;
146139 static auto _ = []() {
147- if (getMsg.bind (robj).call (g_longStr).err == rtl::error::None) {
148- std::cout << " [rtl:3] call success.\n " ;
149- }
150- else {
151- std::cout << " [rtl:3] call failed.\n " ;
140+ auto err = getMsg.bind (robj).call (g_longStr).err ;
141+ if (err != rtl::error::None) {
142+ std::cout << " [rtl:3] err: " << rtl::to_string (err) << " \n " ;
152143 }
153144 return 0 ;
154145 }();
0 commit comments