rice 4.3.3 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +86 -26
  3. data/CMakeLists.txt +31 -0
  4. data/CMakePresets.json +75 -0
  5. data/COPYING +3 -2
  6. data/FindRuby.cmake +437 -0
  7. data/README.md +7 -2
  8. data/Rakefile +12 -5
  9. data/include/rice/rice.hpp +9522 -4426
  10. data/include/rice/stl.hpp +2831 -1198
  11. data/lib/make_rice_headers.rb +79 -0
  12. data/lib/mkmf-rice.rb +40 -94
  13. data/lib/rice/version.rb +3 -0
  14. data/lib/rice.rb +1 -0
  15. data/lib/rubygems/builder.rb +11 -0
  16. data/lib/rubygems/cmake_builder.rb +113 -0
  17. data/lib/rubygems_plugin.rb +9 -0
  18. data/rice/Address_Registration_Guard.hpp +72 -3
  19. data/rice/Arg.hpp +26 -6
  20. data/rice/Arg.ipp +35 -2
  21. data/rice/Buffer.hpp +123 -0
  22. data/rice/Buffer.ipp +599 -0
  23. data/rice/Callback.hpp +21 -0
  24. data/rice/Callback.ipp +13 -0
  25. data/rice/Constructor.hpp +4 -27
  26. data/rice/Constructor.ipp +79 -0
  27. data/rice/Data_Object.hpp +73 -3
  28. data/rice/Data_Object.ipp +388 -96
  29. data/rice/Data_Type.hpp +214 -3
  30. data/rice/Data_Type.ipp +144 -67
  31. data/rice/Director.hpp +0 -2
  32. data/rice/Enum.hpp +4 -7
  33. data/rice/Enum.ipp +102 -55
  34. data/rice/Exception.hpp +62 -2
  35. data/rice/Exception.ipp +7 -12
  36. data/rice/Init.hpp +8 -0
  37. data/rice/Init.ipp +8 -0
  38. data/rice/JumpException.hpp +44 -0
  39. data/rice/JumpException.ipp +48 -0
  40. data/rice/MemoryView.hpp +11 -0
  41. data/rice/MemoryView.ipp +3 -0
  42. data/rice/Return.hpp +7 -27
  43. data/rice/Return.ipp +13 -13
  44. data/rice/cpp_api/Array.hpp +209 -0
  45. data/rice/cpp_api/Array.ipp +304 -0
  46. data/rice/cpp_api/Builtin_Object.hpp +31 -0
  47. data/rice/cpp_api/Builtin_Object.ipp +37 -0
  48. data/rice/cpp_api/Class.hpp +70 -0
  49. data/rice/cpp_api/Class.ipp +97 -0
  50. data/rice/cpp_api/Encoding.hpp +32 -0
  51. data/rice/cpp_api/Encoding.ipp +59 -0
  52. data/rice/cpp_api/Hash.hpp +194 -0
  53. data/rice/cpp_api/Hash.ipp +257 -0
  54. data/rice/{Identifier.hpp → cpp_api/Identifier.hpp} +2 -6
  55. data/rice/{Identifier.ipp → cpp_api/Identifier.ipp} +4 -2
  56. data/rice/cpp_api/Module.hpp +72 -0
  57. data/rice/cpp_api/Module.ipp +101 -0
  58. data/rice/cpp_api/Object.hpp +272 -0
  59. data/rice/cpp_api/Object.ipp +235 -0
  60. data/rice/cpp_api/String.hpp +74 -0
  61. data/rice/cpp_api/String.ipp +120 -0
  62. data/rice/cpp_api/Struct.hpp +113 -0
  63. data/rice/cpp_api/Struct.ipp +92 -0
  64. data/rice/cpp_api/Symbol.hpp +46 -0
  65. data/rice/cpp_api/Symbol.ipp +93 -0
  66. data/rice/cpp_api/shared_methods.hpp +134 -0
  67. data/rice/detail/DefaultHandler.hpp +12 -0
  68. data/rice/detail/DefaultHandler.ipp +8 -0
  69. data/rice/detail/HandlerRegistry.hpp +5 -35
  70. data/rice/detail/HandlerRegistry.ipp +7 -11
  71. data/rice/detail/InstanceRegistry.hpp +1 -4
  72. data/rice/detail/MethodInfo.hpp +12 -10
  73. data/rice/detail/MethodInfo.ipp +26 -21
  74. data/rice/detail/Native.hpp +33 -0
  75. data/rice/detail/Native.ipp +157 -0
  76. data/rice/detail/NativeAttributeGet.hpp +52 -0
  77. data/rice/detail/NativeAttributeGet.ipp +57 -0
  78. data/rice/detail/NativeAttributeSet.hpp +44 -0
  79. data/rice/detail/NativeAttributeSet.ipp +88 -0
  80. data/rice/detail/NativeCallbackFFI.hpp +55 -0
  81. data/rice/detail/NativeCallbackFFI.ipp +151 -0
  82. data/rice/detail/NativeCallbackSimple.hpp +30 -0
  83. data/rice/detail/NativeCallbackSimple.ipp +29 -0
  84. data/rice/detail/NativeFunction.hpp +33 -23
  85. data/rice/detail/NativeFunction.ipp +309 -70
  86. data/rice/detail/NativeIterator.hpp +9 -11
  87. data/rice/detail/NativeIterator.ipp +33 -31
  88. data/rice/detail/NativeRegistry.hpp +24 -15
  89. data/rice/detail/NativeRegistry.ipp +23 -48
  90. data/rice/detail/Proc.hpp +4 -0
  91. data/rice/detail/Proc.ipp +85 -0
  92. data/rice/detail/Registries.hpp +0 -7
  93. data/rice/detail/Registries.ipp +0 -18
  94. data/rice/detail/RubyFunction.hpp +0 -3
  95. data/rice/detail/RubyFunction.ipp +4 -8
  96. data/rice/detail/RubyType.hpp +16 -0
  97. data/rice/detail/RubyType.ipp +232 -0
  98. data/rice/detail/Type.hpp +7 -6
  99. data/rice/detail/Type.ipp +192 -45
  100. data/rice/detail/TypeRegistry.hpp +15 -7
  101. data/rice/detail/TypeRegistry.ipp +105 -12
  102. data/rice/detail/Wrapper.hpp +68 -32
  103. data/rice/detail/Wrapper.ipp +121 -109
  104. data/rice/detail/cpp_protect.hpp +5 -6
  105. data/rice/detail/default_allocation_func.ipp +0 -2
  106. data/rice/detail/from_ruby.hpp +38 -3
  107. data/rice/detail/from_ruby.ipp +1321 -492
  108. data/rice/detail/ruby.hpp +18 -0
  109. data/rice/detail/to_ruby.hpp +41 -3
  110. data/rice/detail/to_ruby.ipp +1424 -194
  111. data/rice/global_function.hpp +0 -4
  112. data/rice/global_function.ipp +0 -1
  113. data/rice/libc/file.hpp +11 -0
  114. data/rice/libc/file.ipp +32 -0
  115. data/rice/rice.hpp +116 -26
  116. data/rice/ruby_mark.hpp +4 -3
  117. data/rice/stl/complex.hpp +6 -0
  118. data/rice/stl/complex.ipp +93 -0
  119. data/rice/stl/exception.hpp +11 -0
  120. data/rice/stl/exception.ipp +29 -0
  121. data/rice/stl/exception_ptr.hpp +6 -0
  122. data/rice/stl/exception_ptr.ipp +27 -0
  123. data/rice/stl/map.hpp +12 -0
  124. data/rice/stl/map.ipp +469 -0
  125. data/rice/stl/monostate.hpp +6 -0
  126. data/rice/stl/monostate.ipp +80 -0
  127. data/rice/stl/multimap.hpp +14 -0
  128. data/rice/stl/multimap.ipp +448 -0
  129. data/rice/stl/optional.hpp +6 -0
  130. data/rice/stl/optional.ipp +118 -0
  131. data/rice/stl/pair.hpp +13 -0
  132. data/rice/stl/pair.ipp +155 -0
  133. data/rice/stl/reference_wrapper.hpp +6 -0
  134. data/rice/stl/reference_wrapper.ipp +41 -0
  135. data/rice/stl/set.hpp +12 -0
  136. data/rice/stl/set.ipp +495 -0
  137. data/rice/stl/shared_ptr.hpp +28 -0
  138. data/rice/stl/shared_ptr.ipp +224 -0
  139. data/rice/stl/string.hpp +6 -0
  140. data/rice/stl/string.ipp +158 -0
  141. data/rice/stl/string_view.hpp +6 -0
  142. data/rice/stl/string_view.ipp +65 -0
  143. data/rice/stl/tuple.hpp +6 -0
  144. data/rice/stl/tuple.ipp +128 -0
  145. data/rice/stl/type_index.hpp +6 -0
  146. data/rice/stl/type_index.ipp +30 -0
  147. data/rice/stl/type_info.hpp +6 -0
  148. data/rice/stl/type_info.ipp +29 -0
  149. data/rice/stl/unique_ptr.hpp +22 -0
  150. data/rice/stl/unique_ptr.ipp +139 -0
  151. data/rice/stl/unordered_map.hpp +12 -0
  152. data/rice/stl/unordered_map.ipp +469 -0
  153. data/rice/stl/variant.hpp +6 -0
  154. data/rice/stl/variant.ipp +242 -0
  155. data/rice/stl/vector.hpp +12 -0
  156. data/rice/stl/vector.ipp +590 -0
  157. data/rice/stl.hpp +11 -3
  158. data/rice/traits/attribute_traits.hpp +26 -0
  159. data/rice/traits/function_traits.hpp +95 -0
  160. data/rice/traits/method_traits.hpp +47 -0
  161. data/rice/traits/rice_traits.hpp +160 -0
  162. data/rice.gemspec +85 -0
  163. data/test/embed_ruby.cpp +7 -1
  164. data/test/extconf.rb +2 -0
  165. data/test/test_Address_Registration_Guard.cpp +5 -0
  166. data/test/test_Array.cpp +18 -4
  167. data/test/test_Attribute.cpp +136 -21
  168. data/test/test_Buffer.cpp +285 -0
  169. data/test/test_Builtin_Object.cpp +5 -0
  170. data/test/test_Callback.cpp +230 -0
  171. data/test/test_Class.cpp +5 -31
  172. data/test/test_Constructor.cpp +69 -6
  173. data/test/test_Data_Object.cpp +97 -38
  174. data/test/test_Data_Type.cpp +470 -65
  175. data/test/test_Director.cpp +17 -8
  176. data/test/test_Enum.cpp +155 -40
  177. data/test/test_Exception.cpp +235 -0
  178. data/test/test_File.cpp +70 -0
  179. data/test/test_From_Ruby.cpp +609 -0
  180. data/test/test_Hash.cpp +5 -0
  181. data/test/test_Identifier.cpp +5 -0
  182. data/test/test_Inheritance.cpp +6 -1
  183. data/test/test_Iterator.cpp +6 -1
  184. data/test/test_Jump_Exception.cpp +23 -0
  185. data/test/test_Keep_Alive.cpp +13 -19
  186. data/test/test_Keep_Alive_No_Wrapper.cpp +5 -1
  187. data/test/test_Memory_Management.cpp +5 -0
  188. data/test/test_Module.cpp +128 -67
  189. data/test/test_Native_Registry.cpp +2 -34
  190. data/test/test_Object.cpp +5 -0
  191. data/test/test_Overloads.cpp +806 -0
  192. data/test/test_Ownership.cpp +160 -54
  193. data/test/test_Proc.cpp +44 -0
  194. data/test/test_Self.cpp +9 -4
  195. data/test/test_Stl_Exception.cpp +109 -0
  196. data/test/test_Stl_Map.cpp +54 -42
  197. data/test/test_Stl_Multimap.cpp +693 -0
  198. data/test/test_Stl_Optional.cpp +5 -0
  199. data/test/test_Stl_Pair.cpp +14 -9
  200. data/test/test_Stl_Reference_Wrapper.cpp +9 -2
  201. data/test/test_Stl_Set.cpp +790 -0
  202. data/test/test_Stl_SharedPtr.cpp +458 -0
  203. data/test/test_Stl_String.cpp +5 -0
  204. data/test/test_Stl_String_View.cpp +5 -0
  205. data/test/test_Stl_Tuple.cpp +116 -0
  206. data/test/test_Stl_Type.cpp +147 -0
  207. data/test/test_Stl_UniquePtr.cpp +202 -0
  208. data/test/test_Stl_Unordered_Map.cpp +43 -38
  209. data/test/test_Stl_Variant.cpp +217 -84
  210. data/test/test_Stl_Vector.cpp +306 -58
  211. data/test/test_String.cpp +5 -0
  212. data/test/test_Struct.cpp +5 -0
  213. data/test/test_Symbol.cpp +5 -0
  214. data/test/test_Template.cpp +192 -0
  215. data/test/test_To_Ruby.cpp +524 -0
  216. data/test/test_Tracking.cpp +1 -0
  217. data/test/test_Type.cpp +171 -0
  218. data/test/test_global_functions.cpp +67 -7
  219. data/test/unittest.cpp +8 -0
  220. metadata +127 -26
  221. data/lib/version.rb +0 -3
  222. data/rice/Address_Registration_Guard_defn.hpp +0 -79
  223. data/rice/Data_Object_defn.hpp +0 -84
  224. data/rice/Data_Type_defn.hpp +0 -190
  225. data/rice/Exception_defn.hpp +0 -68
  226. data/rice/HandlerRegistration.hpp +0 -15
  227. data/rice/detail/ExceptionHandler.hpp +0 -8
  228. data/rice/detail/ExceptionHandler.ipp +0 -28
  229. data/rice/detail/ExceptionHandler_defn.hpp +0 -77
  230. data/rice/detail/Jump_Tag.hpp +0 -21
  231. data/rice/detail/NativeAttribute.hpp +0 -64
  232. data/rice/detail/NativeAttribute.ipp +0 -112
  233. data/rice/detail/from_ruby_defn.hpp +0 -38
  234. data/rice/detail/to_ruby_defn.hpp +0 -48
  235. data/test/test_Jump_Tag.cpp +0 -17
  236. data/test/test_Stl_SmartPointer.cpp +0 -283
  237. data/test/test_To_From_Ruby.cpp +0 -399
@@ -5,6 +5,7 @@
5
5
  #include "embed_ruby.hpp"
6
6
  #include <rice/rice.hpp>
7
7
  #include <rice/stl.hpp>
8
+ #include <ruby/version.h>
8
9
 
9
10
  using namespace Rice;
10
11
 
@@ -15,9 +16,13 @@ SETUP(Map)
15
16
  embed_ruby();
16
17
  }
17
18
 
18
- namespace
19
+ TEARDOWN(Map)
19
20
  {
21
+ rb_gc_start();
22
+ }
20
23
 
24
+ namespace
25
+ {
21
26
  class MyClass
22
27
  {
23
28
  public:
@@ -42,9 +47,9 @@ TESTCASE(StringMap)
42
47
  {
43
48
  Module m = define_module("Testing");
44
49
 
45
- Class c = define_map<std::map<std::string, std::string>>("StringMap");
50
+ Class c = define_map<std::string, std::string>("StringMap");
46
51
 
47
- Object map = m.module_eval("$map = StringMap.new");
52
+ Object map = m.module_eval("$map = Std::StringMap.new");
48
53
  Object result = map.call("size");
49
54
  ASSERT_EQUAL(0, detail::From_Ruby<int32_t>().convert(result));
50
55
 
@@ -61,8 +66,8 @@ TESTCASE(WrongType)
61
66
  {
62
67
  Module m = define_module("Testing");
63
68
 
64
- Class c = define_map<std::map<std::string, std::string>>("StringMap");
65
- Object map = m.module_eval("$map = StringMap.new");
69
+ Class c = define_map<std::string, std::string>("StringMap");
70
+ Object map = m.module_eval("$map = Std::StringMap.new");
66
71
 
67
72
  ASSERT_EXCEPTION_CHECK(
68
73
  Exception,
@@ -79,7 +84,7 @@ TESTCASE(Empty)
79
84
  {
80
85
  Module m = define_module("Testing");
81
86
 
82
- Class c = define_map<std::map<std::string, std::int32_t>>("IntMap");
87
+ Class c = define_map<std::string, std::int32_t>("IntMap");
83
88
  Object map = c.call("new");
84
89
 
85
90
  Object result = map.call("size");
@@ -93,10 +98,14 @@ TESTCASE(Include)
93
98
  {
94
99
  Module m = define_module("Testing");
95
100
 
96
- Class c = define_map<std::map<std::string, std::int32_t>>("IntMap");
97
- Object map = c.call("new");
98
- map.call("[]=", "one", 1);
99
- map.call("[]=", "two", 2);
101
+ Class c = define_map<std::string, std::int32_t>("IntMap");
102
+
103
+ std::string code = R"(map = Std::IntMap.new
104
+ map["one"] = 1
105
+ map["two"] = 2
106
+ map)";
107
+
108
+ Object map = m.module_eval(code);
100
109
 
101
110
  Object result = map.call("include?", "two");
102
111
  ASSERT_EQUAL(Qtrue, result.value());
@@ -112,7 +121,7 @@ TESTCASE(Value)
112
121
  {
113
122
  Module m = define_module("Testing");
114
123
 
115
- Class c = define_map<std::map<std::string, std::int32_t>>("IntMap");
124
+ Class c = define_map<std::string, std::int32_t>("IntMap");
116
125
  Object map = c.call("new");
117
126
  map.call("[]=", "one", 1);
118
127
  map.call("[]=", "two", 2);
@@ -128,7 +137,7 @@ TESTCASE(ToString)
128
137
  {
129
138
  Module m = define_module("Testing");
130
139
 
131
- Class c = define_map<std::map<std::string, std::int32_t>>("IntMap");
140
+ Class c = define_map<std::string, std::int32_t>("IntMap");
132
141
  Object map = c.call("new");
133
142
  map.call("[]=", "one", 1);
134
143
  map.call("[]=", "two", 2);
@@ -146,7 +155,7 @@ TESTCASE(Update)
146
155
  {
147
156
  Module m = define_module("Testing");
148
157
 
149
- Class c = define_map<std::map<std::string, std::string>>("StringMap");
158
+ Class c = define_map<std::string, std::string>("StringMap");
150
159
  Object map = c.call("new");
151
160
  map.call("[]=", "one", "original 1");
152
161
  map.call("[]=", "two", "original 2");
@@ -168,7 +177,7 @@ TESTCASE(Modify)
168
177
  {
169
178
  Module m = define_module("Testing");
170
179
 
171
- Class c = define_map<std::map<std::string, int64_t>>("Int64Map");
180
+ Class c = define_map<std::string, int64_t>("Int64Map");
172
181
  Object map = c.call("new");
173
182
 
174
183
  Object result = map.call("[]=", "one", 3232323232);
@@ -187,7 +196,7 @@ TESTCASE(keysAndValues)
187
196
  {
188
197
  Module m = define_module("Testing");
189
198
 
190
- Class c = define_map<std::map<std::string, int32_t>>("Int32Map");
199
+ Class c = define_map<std::string, int32_t>("Int32Map");
191
200
  Object map = c.call("new");
192
201
 
193
202
  map.call("[]=", "one", 1);
@@ -215,7 +224,7 @@ TESTCASE(Copy)
215
224
  {
216
225
  Module m = define_module("Testing");
217
226
 
218
- Class c = define_map<std::map<std::string, double>>("DoubleMap");
227
+ Class c = define_map<std::string, double>("DoubleMap");
219
228
  Object object = c.call("new");
220
229
 
221
230
  object.call("[]=", "one", 11.1);
@@ -236,9 +245,9 @@ TESTCASE(Copy)
236
245
  TESTCASE(Iterate)
237
246
  {
238
247
  Module m = define_module("Testing");
239
- Class c = define_map<std::map<std::string, int>>("IntMap");
248
+ Class c = define_map<std::string, int>("IntMap");
240
249
 
241
- std::string code = R"(map = IntMap.new
250
+ std::string code = R"(map = Std::IntMap.new
242
251
  map["five"] = 5
243
252
  map["six"] = 6
244
253
  map["seven"] = 7
@@ -253,15 +262,19 @@ TESTCASE(Iterate)
253
262
  ASSERT_EQUAL(3u, result.size());
254
263
 
255
264
  std::string result_string = result.to_s().str();
265
+ #if RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR >= 4
266
+ ASSERT_EQUAL("{\"five\" => 10, \"seven\" => 14, \"six\" => 12}", result_string);
267
+ #else
256
268
  ASSERT_EQUAL("{\"five\"=>10, \"seven\"=>14, \"six\"=>12}", result_string);
269
+ #endif
257
270
  }
258
271
 
259
272
  TESTCASE(ToEnum)
260
273
  {
261
274
  Module m = define_module("Testing");
262
- Class c = define_map<std::map<std::string, int>>("IntMap");
275
+ Class c = define_map<std::string, int>("IntMap");
263
276
 
264
- std::string code = R"(map = IntMap.new
277
+ std::string code = R"(map = Std::IntMap.new
265
278
  map["five"] = 5
266
279
  map["six"] = 6
267
280
  map["seven"] = 7
@@ -276,15 +289,20 @@ TESTCASE(ToEnum)
276
289
  ASSERT_EQUAL(3u, result.size());
277
290
 
278
291
  std::string result_string = result.to_s().str();
292
+
293
+ #if RUBY_API_VERSION_MAJOR == 3 && RUBY_API_VERSION_MINOR >= 4
294
+ ASSERT_EQUAL("{\"five\" => 10, \"seven\" => 14, \"six\" => 12}", result_string);
295
+ #else
279
296
  ASSERT_EQUAL("{\"five\"=>10, \"seven\"=>14, \"six\"=>12}", result_string);
297
+ #endif
280
298
  }
281
299
 
282
300
  TESTCASE(ToEnumSize)
283
301
  {
284
302
  Module m = define_module("TestingModule");
285
- Class c = define_map<std::map<std::string, int>>("IntMap");
303
+ Class c = define_map<std::string, int>("IntMap");
286
304
 
287
- std::string code = R"(map = IntMap.new
305
+ std::string code = R"(map = Std::IntMap.new
288
306
  map["five"] = 5
289
307
  map["six"] = 6
290
308
  map["seven"] = 7
@@ -318,7 +336,7 @@ TESTCASE(NotComparable)
318
336
  define_class<NotComparable>("NotComparable").
319
337
  define_constructor(Constructor<NotComparable, uint32_t>());
320
338
 
321
- Class c = define_map<std::map<std::string, NotComparable>>("NotComparableMap");
339
+ Class c = define_map<std::string, NotComparable>("NotComparableMap");
322
340
 
323
341
  Object map = c.call("new");
324
342
  map.call("[]=", "one", NotComparable(1));
@@ -337,7 +355,7 @@ TESTCASE(NotPrintable)
337
355
  define_class<NotComparable>("NotComparable").
338
356
  define_constructor(Constructor<NotComparable, uint32_t>());
339
357
 
340
- Class c = define_map<std::map<std::string, NotComparable>>("NotComparableMap");
358
+ Class c = define_map<std::string, NotComparable>("NotComparableMap");
341
359
 
342
360
  Object map = c.call("new");
343
361
  map.call("[]=", "one", NotComparable(1));
@@ -358,7 +376,7 @@ namespace
358
376
  {
359
377
  };
360
378
 
361
- bool operator==(const Comparable& other)
379
+ bool operator==(const Comparable& other) const
362
380
  {
363
381
  return this->value_ == other.value_;
364
382
  }
@@ -378,7 +396,7 @@ TESTCASE(Comparable)
378
396
  define_class<Comparable>("IsComparable").
379
397
  define_constructor(Constructor<Comparable, uint32_t>());
380
398
 
381
- Class c = define_map<std::map<std::string, Comparable>>("ComparableMap");
399
+ Class c = define_map<std::string, Comparable>("ComparableMap");
382
400
 
383
401
  Object map = c.call("new");
384
402
 
@@ -395,7 +413,7 @@ TESTCASE(Printable)
395
413
  define_class<Comparable>("IsComparable").
396
414
  define_constructor(Constructor<Comparable, uint32_t>());
397
415
 
398
- Class c = define_map<std::map<std::string, Comparable>>("ComparableMap");
416
+ Class c = define_map<std::string, Comparable>("ComparableMap");
399
417
 
400
418
  Object map = c.call("new");
401
419
  map.call("[]=", "one", Comparable(1));
@@ -433,7 +451,7 @@ TESTCASE(AutoRegisterReturn)
433
451
 
434
452
  Module m = define_module("Testing");
435
453
  Object map = m.module_eval("return_complex_map");
436
- ASSERT_EQUAL("Rice::Std::Map__basic_string__char_char_traits__char___allocator__char_____complex__double___less__basic_string__char_char_traits__char___allocator__char_______allocator__pair__basic_string__char_char_traits__char___allocator__char____Const_complex__double________",
454
+ ASSERT_EQUAL("Std::Map≺string‚ complex≺double≻≻",
437
455
  map.class_name().str());
438
456
 
439
457
  std::string code = R"(map = return_complex_map
@@ -444,14 +462,8 @@ TESTCASE(AutoRegisterReturn)
444
462
  ASSERT_EQUAL(Qtrue, result.value());
445
463
 
446
464
  // Now register the map again
447
- define_map<std::map<std::string, std::complex<double>>>("ComplexMap");
448
- code = R"(map = ComplexMap.new)";
449
- result = m.module_eval(code);
450
- ASSERT(result.is_instance_of(map.class_of()));
451
-
452
- // And again in the module
453
- define_map_under<std::map<std::string, std::complex<double>>>(m, "ComplexMap2");
454
- code = R"(map = Testing::ComplexMap2.new)";
465
+ define_map<std::string, std::complex<double>>("ComplexMap");
466
+ code = R"(map = Std::ComplexMap.new)";
455
467
  result = m.module_eval(code);
456
468
  ASSERT(result.is_instance_of(map.class_of()));
457
469
  }
@@ -460,16 +472,16 @@ TESTCASE(AutoRegisterParameter)
460
472
  {
461
473
  define_global_function("pass_complex_map", &passComplexMap);
462
474
 
463
- std::string code = R"(map = Rice::Std::Map__basic_string__char_char_traits__char___allocator__char_____complex__double___less__basic_string__char_char_traits__char___allocator__char_______allocator__pair__basic_string__char_char_traits__char___allocator__char____Const_complex__double________.new
464
- map["four"] = Complex(4.0, 4.0)
465
- map["five"] = Complex(5.0, 5.0)
466
- pass_complex_map(map))";
475
+ std::string code = R"(map = Std::Map≺string‚ complex≺double≻≻.new
476
+ map["four"] = Complex(4.0, 4.0)
477
+ map["five"] = Complex(5.0, 5.0)
478
+ pass_complex_map(map))";
467
479
 
468
480
  Module m = define_module("Testing");
469
481
  Object map = m.module_eval(code);
470
482
 
471
483
  Object result = map.call("size");
472
- ASSERT_EQUAL("Rice::Std::Map__basic_string__char_char_traits__char___allocator__char_____complex__double___less__basic_string__char_char_traits__char___allocator__char_______allocator__pair__basic_string__char_char_traits__char___allocator__char____Const_complex__double________",
484
+ ASSERT_EQUAL("Std::Map≺string‚ complex≺double≻≻",
473
485
  map.class_name().str());
474
486
  ASSERT_EQUAL(2, detail::From_Ruby<int32_t>().convert(result));
475
487
 
@@ -488,7 +500,7 @@ namespace
488
500
 
489
501
  TESTCASE(DefaultValue)
490
502
  {
491
- define_map<std::map<std::string, std::string>>("StringMap");
503
+ define_map<std::string, std::string>("StringMap");
492
504
  define_global_function("default_map", &defaultMap, Arg("strings") = std::map<std::string, std::string>{ {"one", "value 1"}, {"two", "value 2"}, {"three", "value 3"} });
493
505
 
494
506
  Module m = define_module("Testing");