rice 4.5.0 → 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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/CMakeLists.txt +31 -0
- data/CMakePresets.json +75 -0
- data/COPYING +3 -2
- data/FindRuby.cmake +437 -0
- data/Rakefile +5 -4
- data/include/rice/rice.hpp +5436 -3201
- data/include/rice/stl.hpp +2355 -1269
- data/lib/make_rice_headers.rb +79 -0
- data/lib/mkmf-rice.rb +4 -0
- data/lib/rice/version.rb +3 -0
- data/lib/rice.rb +1 -0
- data/lib/rubygems/builder.rb +11 -0
- data/lib/rubygems/cmake_builder.rb +113 -0
- data/lib/rubygems_plugin.rb +9 -0
- data/rice/Arg.hpp +7 -1
- data/rice/Arg.ipp +11 -2
- data/rice/Buffer.hpp +123 -0
- data/rice/Buffer.ipp +599 -0
- data/rice/Constructor.ipp +3 -3
- data/rice/Data_Object.hpp +2 -3
- data/rice/Data_Object.ipp +188 -188
- data/rice/Data_Type.hpp +4 -5
- data/rice/Data_Type.ipp +42 -26
- data/rice/Enum.hpp +0 -1
- data/rice/Enum.ipp +26 -23
- data/rice/Init.hpp +8 -0
- data/rice/Init.ipp +8 -0
- data/rice/MemoryView.ipp +1 -41
- data/rice/Return.hpp +1 -1
- data/rice/Return.ipp +6 -0
- data/rice/cpp_api/Array.hpp +209 -0
- data/rice/cpp_api/Array.ipp +304 -0
- data/rice/cpp_api/Builtin_Object.hpp +31 -0
- data/rice/cpp_api/Builtin_Object.ipp +37 -0
- data/rice/cpp_api/Class.hpp +70 -0
- data/rice/cpp_api/Class.ipp +97 -0
- data/rice/cpp_api/Encoding.hpp +32 -0
- data/rice/cpp_api/Encoding.ipp +59 -0
- data/rice/cpp_api/Hash.hpp +194 -0
- data/rice/cpp_api/Hash.ipp +257 -0
- data/rice/cpp_api/Identifier.hpp +46 -0
- data/rice/cpp_api/Identifier.ipp +31 -0
- data/rice/cpp_api/Module.hpp +72 -0
- data/rice/cpp_api/Module.ipp +101 -0
- data/rice/cpp_api/Object.hpp +272 -0
- data/rice/cpp_api/Object.ipp +235 -0
- data/rice/cpp_api/String.hpp +74 -0
- data/rice/cpp_api/String.ipp +120 -0
- data/rice/cpp_api/Struct.hpp +113 -0
- data/rice/cpp_api/Struct.ipp +92 -0
- data/rice/cpp_api/Symbol.hpp +46 -0
- data/rice/cpp_api/Symbol.ipp +93 -0
- data/rice/cpp_api/shared_methods.hpp +134 -0
- data/rice/detail/MethodInfo.hpp +1 -9
- data/rice/detail/MethodInfo.ipp +5 -72
- data/rice/detail/Native.hpp +3 -2
- data/rice/detail/Native.ipp +32 -4
- data/rice/detail/NativeAttributeGet.hpp +3 -2
- data/rice/detail/NativeAttributeGet.ipp +8 -2
- data/rice/detail/NativeAttributeSet.hpp +3 -2
- data/rice/detail/NativeAttributeSet.ipp +8 -2
- data/rice/detail/NativeCallbackFFI.ipp +1 -1
- data/rice/detail/NativeFunction.hpp +17 -6
- data/rice/detail/NativeFunction.ipp +168 -64
- data/rice/detail/NativeIterator.hpp +3 -2
- data/rice/detail/NativeIterator.ipp +8 -2
- data/rice/detail/RubyType.hpp +2 -5
- data/rice/detail/RubyType.ipp +50 -5
- data/rice/detail/Type.hpp +3 -1
- data/rice/detail/Type.ipp +61 -31
- data/rice/detail/Wrapper.hpp +68 -33
- data/rice/detail/Wrapper.ipp +103 -113
- data/rice/detail/from_ruby.hpp +5 -4
- data/rice/detail/from_ruby.ipp +737 -365
- data/rice/detail/to_ruby.ipp +1092 -186
- data/rice/global_function.ipp +1 -1
- data/rice/libc/file.hpp +11 -0
- data/rice/libc/file.ipp +32 -0
- data/rice/rice.hpp +23 -16
- data/rice/stl/complex.hpp +6 -0
- data/rice/stl/complex.ipp +93 -0
- data/rice/stl/exception.hpp +11 -0
- data/rice/stl/exception.ipp +29 -0
- data/rice/stl/exception_ptr.hpp +6 -0
- data/rice/stl/exception_ptr.ipp +27 -0
- data/rice/stl/map.hpp +12 -0
- data/rice/stl/map.ipp +469 -0
- data/rice/stl/monostate.hpp +6 -0
- data/rice/stl/monostate.ipp +80 -0
- data/rice/stl/multimap.hpp +14 -0
- data/rice/stl/multimap.ipp +448 -0
- data/rice/stl/optional.hpp +6 -0
- data/rice/stl/optional.ipp +118 -0
- data/rice/stl/pair.hpp +13 -0
- data/rice/stl/pair.ipp +155 -0
- data/rice/stl/reference_wrapper.hpp +6 -0
- data/rice/stl/reference_wrapper.ipp +41 -0
- data/rice/stl/set.hpp +12 -0
- data/rice/stl/set.ipp +495 -0
- data/rice/stl/shared_ptr.hpp +28 -0
- data/rice/stl/shared_ptr.ipp +224 -0
- data/rice/stl/string.hpp +6 -0
- data/rice/stl/string.ipp +158 -0
- data/rice/stl/string_view.hpp +6 -0
- data/rice/stl/string_view.ipp +65 -0
- data/rice/stl/tuple.hpp +6 -0
- data/rice/stl/tuple.ipp +128 -0
- data/rice/stl/type_index.hpp +6 -0
- data/rice/stl/type_index.ipp +30 -0
- data/rice/stl/type_info.hpp +6 -0
- data/rice/stl/type_info.ipp +29 -0
- data/rice/stl/unique_ptr.hpp +22 -0
- data/rice/stl/unique_ptr.ipp +139 -0
- data/rice/stl/unordered_map.hpp +12 -0
- data/rice/stl/unordered_map.ipp +469 -0
- data/rice/stl/variant.hpp +6 -0
- data/rice/stl/variant.ipp +242 -0
- data/rice/stl/vector.hpp +12 -0
- data/rice/stl/vector.ipp +590 -0
- data/rice/stl.hpp +7 -3
- data/rice/traits/attribute_traits.hpp +26 -0
- data/rice/traits/function_traits.hpp +95 -0
- data/rice/traits/method_traits.hpp +47 -0
- data/rice/traits/rice_traits.hpp +160 -0
- data/rice.gemspec +85 -0
- data/test/embed_ruby.cpp +3 -0
- data/test/ruby/test_multiple_extensions_same_class.rb +14 -14
- data/test/test_Array.cpp +6 -3
- data/test/test_Attribute.cpp +34 -1
- data/test/test_Buffer.cpp +285 -0
- data/test/test_Callback.cpp +2 -3
- data/test/test_Data_Object.cpp +88 -34
- data/test/test_Data_Type.cpp +106 -65
- data/test/test_Director.cpp +7 -3
- data/test/test_Enum.cpp +5 -2
- data/test/test_File.cpp +1 -1
- data/test/test_From_Ruby.cpp +181 -114
- data/test/test_Iterator.cpp +1 -1
- data/test/{test_JumpException.cpp → test_Jump_Exception.cpp} +1 -0
- data/test/test_Keep_Alive.cpp +7 -18
- data/test/test_Keep_Alive_No_Wrapper.cpp +0 -1
- data/test/test_Module.cpp +13 -6
- data/test/test_Native_Registry.cpp +0 -1
- data/test/test_Overloads.cpp +180 -5
- data/test/test_Ownership.cpp +100 -57
- data/test/test_Proc.cpp +0 -1
- data/test/test_Self.cpp +4 -4
- data/test/test_Stl_Map.cpp +37 -39
- data/test/test_Stl_Multimap.cpp +693 -0
- data/test/test_Stl_Pair.cpp +8 -8
- data/test/test_Stl_Reference_Wrapper.cpp +4 -2
- data/test/test_Stl_Set.cpp +790 -0
- data/test/{test_Stl_SmartPointer.cpp → test_Stl_SharedPtr.cpp} +97 -127
- data/test/test_Stl_Tuple.cpp +116 -0
- data/test/test_Stl_Type.cpp +1 -1
- data/test/test_Stl_UniquePtr.cpp +202 -0
- data/test/test_Stl_Unordered_Map.cpp +28 -34
- data/test/test_Stl_Variant.cpp +217 -89
- data/test/test_Stl_Vector.cpp +209 -83
- data/test/test_To_Ruby.cpp +373 -1
- data/test/test_Type.cpp +85 -14
- data/test/test_global_functions.cpp +17 -4
- metadata +94 -10
- data/rice/detail/TupleIterator.hpp +0 -14
data/test/test_Data_Type.cpp
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#include <assert.h>
|
1
|
+
#include <assert.h>
|
2
2
|
|
3
3
|
#include "unittest.hpp"
|
4
4
|
#include "embed_ruby.hpp"
|
@@ -19,7 +19,7 @@ TEARDOWN(Data_Type)
|
|
19
19
|
Rice::detail::Registries::instance.types.clearUnverifiedTypes();
|
20
20
|
rb_gc_start();
|
21
21
|
}
|
22
|
-
|
22
|
+
|
23
23
|
namespace
|
24
24
|
{
|
25
25
|
class MyClass
|
@@ -77,7 +77,7 @@ namespace
|
|
77
77
|
std::to_string(f) + ", " + s + ", " + std::string(c) + ")";
|
78
78
|
}
|
79
79
|
};
|
80
|
-
}
|
80
|
+
}
|
81
81
|
|
82
82
|
TESTCASE(methods_with_member_pointers)
|
83
83
|
{
|
@@ -558,8 +558,6 @@ namespace
|
|
558
558
|
|
559
559
|
TESTCASE(pointers)
|
560
560
|
{
|
561
|
-
Class voidClass = define_class<void>("Void");
|
562
|
-
|
563
561
|
Class helperClass = define_class<Helper>("Helper")
|
564
562
|
.define_constructor(Constructor<Helper, int>())
|
565
563
|
.define_method("value", &Helper::value);
|
@@ -593,9 +591,9 @@ TESTCASE(pointers)
|
|
593
591
|
value = result.call("value");
|
594
592
|
ASSERT_EQUAL(5, detail::From_Ruby<int>().convert(value));
|
595
593
|
|
596
|
-
|
597
|
-
|
598
|
-
|
594
|
+
helper = object.call("return_void_helper");
|
595
|
+
result = object.call("check_void_helper", helper);
|
596
|
+
ASSERT_EQUAL(Qtrue, result.value());
|
599
597
|
}
|
600
598
|
|
601
599
|
namespace
|
@@ -618,7 +616,7 @@ namespace
|
|
618
616
|
{
|
619
617
|
BigObject** result = new BigObject*[size];
|
620
618
|
|
621
|
-
for (
|
619
|
+
for (size_t i = 0; i < size; ++i)
|
622
620
|
{
|
623
621
|
result[i] = new BigObject(i + 5);
|
624
622
|
}
|
@@ -629,7 +627,7 @@ namespace
|
|
629
627
|
{
|
630
628
|
int result = 0;
|
631
629
|
|
632
|
-
for (
|
630
|
+
for (size_t i = 0; i < size; i++)
|
633
631
|
{
|
634
632
|
result += bigObjects[i]->value;
|
635
633
|
}
|
@@ -640,7 +638,7 @@ namespace
|
|
640
638
|
{
|
641
639
|
int result = 0;
|
642
640
|
|
643
|
-
for (
|
641
|
+
for (size_t i = 0; i < size; i++)
|
644
642
|
{
|
645
643
|
result += bigObjects[i]->value;
|
646
644
|
}
|
@@ -655,23 +653,35 @@ namespace
|
|
655
653
|
|
656
654
|
TESTCASE(pointerToPointer)
|
657
655
|
{
|
656
|
+
define_buffer<BigObject*>();
|
657
|
+
|
658
|
+
Module m = define_module("DataTypePointerToPointer");
|
659
|
+
|
658
660
|
Class BigObjectClass = define_class<BigObject>("BigObject")
|
659
661
|
.define_attr("value", &BigObject::value);
|
660
662
|
|
661
663
|
Class ProcessorClass = define_class<Processor>("ProcessorClass")
|
662
664
|
.define_constructor(Constructor<Processor>())
|
663
665
|
.define_method("create", &Processor::createBigObjects)
|
664
|
-
.define_method("sum", &Processor::sumBigObjects
|
665
|
-
|
666
|
+
.define_method("sum", &Processor::sumBigObjects,
|
667
|
+
Arg("bigObjects").setArray(), Arg("size"))
|
668
|
+
.define_method("sum_const", &Processor::sumBigObjectsConst,
|
669
|
+
Arg("bigObjects").setArray(), Arg("size"));
|
666
670
|
|
667
|
-
|
668
|
-
|
669
|
-
|
671
|
+
std::string code = R"(count = 2
|
672
|
+
processor = ProcessorClass.new
|
673
|
+
big_objects = processor.create(count)
|
674
|
+
processor.sum(big_objects, count))";
|
670
675
|
|
671
|
-
Object result =
|
676
|
+
Object result = m.module_eval(code);
|
672
677
|
ASSERT_EQUAL(11, detail::From_Ruby<int>().convert(result));
|
673
678
|
|
674
|
-
|
679
|
+
code = R"(count = 2
|
680
|
+
processor = ProcessorClass.new
|
681
|
+
big_objects = processor.create(count)
|
682
|
+
processor.sum_const(big_objects, count))";
|
683
|
+
|
684
|
+
result = m.module_eval(code);
|
675
685
|
ASSERT_EQUAL(11, detail::From_Ruby<int>().convert(result));
|
676
686
|
}
|
677
687
|
|
@@ -743,7 +753,7 @@ TESTCASE(not_defined)
|
|
743
753
|
ASSERT_EQUAL(message, ex.what())
|
744
754
|
);
|
745
755
|
|
746
|
-
m.define_module_function<void(*)(UnknownClass)>("undefined_arg_reference", &undefinedArg);
|
756
|
+
m.define_module_function<void(*)(UnknownClass&)>("undefined_arg_reference", &undefinedArg);
|
747
757
|
|
748
758
|
ASSERT_EXCEPTION_CHECK(
|
749
759
|
Rice::Exception,
|
@@ -756,52 +766,52 @@ TESTCASE(not_defined)
|
|
756
766
|
// This actually works because we pass a nullptr
|
757
767
|
m.call("undefined_arg_pointer", nullptr);
|
758
768
|
}
|
759
|
-
|
760
|
-
namespace
|
769
|
+
|
770
|
+
namespace RangesTest
|
761
771
|
{
|
762
|
-
class
|
772
|
+
class RangeCustom
|
763
773
|
{
|
764
774
|
public:
|
765
|
-
|
775
|
+
RangeCustom(int x, int y) : x(x), y(y)
|
766
776
|
{
|
767
777
|
}
|
768
778
|
|
769
|
-
|
779
|
+
RangeCustom(const RangeCustom& other) = default;
|
770
780
|
|
771
781
|
int x;
|
772
782
|
int y;
|
773
783
|
};
|
774
784
|
|
775
|
-
int sumRangesArray(int size,
|
785
|
+
int sumRangesArray(int size, RangeCustom ranges[])
|
776
786
|
{
|
777
787
|
int result = 0;
|
778
788
|
for (int i = 0; i < size; i++)
|
779
789
|
{
|
780
|
-
const
|
790
|
+
const RangeCustom& range = ranges[i];
|
781
791
|
result += range.x + range.y;
|
782
792
|
}
|
783
793
|
|
784
794
|
return result;
|
785
795
|
}
|
786
796
|
|
787
|
-
int sumRanges(int size, const
|
797
|
+
int sumRanges(int size, const RangeCustom* ranges)
|
788
798
|
{
|
789
799
|
int result = 0;
|
790
800
|
for (int i = 0; i < size; i++)
|
791
801
|
{
|
792
|
-
const
|
802
|
+
const RangeCustom& range = ranges[i];
|
793
803
|
result += range.x + range.y;
|
794
804
|
}
|
795
805
|
|
796
806
|
return result;
|
797
807
|
}
|
798
808
|
|
799
|
-
int sumRanges(int size, const
|
809
|
+
int sumRanges(int size, const RangeCustom** ranges)
|
800
810
|
{
|
801
811
|
int result = 0;
|
802
812
|
for (int i = 0; i < size; i++)
|
803
813
|
{
|
804
|
-
const
|
814
|
+
const RangeCustom* range = ranges[i];
|
805
815
|
result += range->x + range->y;
|
806
816
|
}
|
807
817
|
|
@@ -811,22 +821,24 @@ namespace
|
|
811
821
|
|
812
822
|
TESTCASE(array_of_ranges)
|
813
823
|
{
|
814
|
-
|
815
|
-
|
816
|
-
Class c = define_class_under<Range>(m, "Range")
|
817
|
-
.define_constructor(Constructor<Range, int, int>())
|
818
|
-
.define_attr("x", &Range::x)
|
819
|
-
.define_attr("y", &Range::y);
|
824
|
+
define_buffer<RangesTest::RangeCustom>();
|
820
825
|
|
821
|
-
m
|
826
|
+
Module m = define_module("CustomRanges");
|
822
827
|
|
823
|
-
|
824
|
-
|
825
|
-
|
828
|
+
Class c = define_class_under<RangesTest::RangeCustom>(m, "RangeCustom")
|
829
|
+
.define_constructor(Constructor<RangesTest::RangeCustom, int, int>())
|
830
|
+
.define_attr("x", &RangesTest::RangeCustom::x)
|
831
|
+
.define_attr("y", &RangesTest::RangeCustom::y);
|
826
832
|
|
827
|
-
|
833
|
+
m.define_module_function("sum_ranges_array", RangesTest::sumRangesArray,
|
834
|
+
Arg("size"), Arg("ranges[]").setArray());
|
828
835
|
|
829
|
-
|
836
|
+
std::string code = R"(range1 = RangeCustom.new(1, 2)
|
837
|
+
range2 = RangeCustom.new(3, 4)
|
838
|
+
range3 = RangeCustom.new(5, 6)
|
839
|
+
|
840
|
+
buffer = Rice::Buffer≺RangesTest꞉꞉RangeCustom≻.new([range1, range2, range3])
|
841
|
+
sum_ranges_array(buffer.size, buffer))";
|
830
842
|
|
831
843
|
Object result = m.module_eval(code);
|
832
844
|
ASSERT_EQUAL(21, detail::From_Ruby<int>().convert(result));
|
@@ -834,45 +846,74 @@ TESTCASE(array_of_ranges)
|
|
834
846
|
|
835
847
|
TESTCASE(pointer_of_ranges)
|
836
848
|
{
|
837
|
-
|
849
|
+
define_buffer<RangesTest::RangeCustom>();
|
838
850
|
|
839
|
-
|
840
|
-
.define_constructor(Constructor<Range, int, int>())
|
841
|
-
.define_attr("x", &Range::x)
|
842
|
-
.define_attr("y", &Range::y);
|
851
|
+
Module m = define_module("CustomRanges");
|
843
852
|
|
844
|
-
|
853
|
+
Class c = define_class_under<RangesTest::RangeCustom>(m, "RangeCustom")
|
854
|
+
.define_constructor(Constructor<RangesTest::RangeCustom, int, int>())
|
855
|
+
.define_attr("x", &RangesTest::RangeCustom::x)
|
856
|
+
.define_attr("y", &RangesTest::RangeCustom::y);
|
845
857
|
|
846
|
-
|
847
|
-
|
848
|
-
range3 = Range.new(5, 6)
|
858
|
+
m.define_module_function<int(*)(int, const RangesTest::RangeCustom*)>("sum_ranges", RangesTest::sumRanges,
|
859
|
+
Arg("size"), Arg("ranges*").setArray());
|
849
860
|
|
850
|
-
|
861
|
+
std::string code = R"(range1 = RangeCustom.new(1, 2)
|
862
|
+
range2 = RangeCustom.new(3, 4)
|
863
|
+
range3 = RangeCustom.new(5, 6)
|
851
864
|
|
852
|
-
|
865
|
+
buffer = Rice::Buffer≺RangesTest꞉꞉RangeCustom≻.new([range1, range2, range3])
|
866
|
+
sum_ranges(buffer.size, buffer))";
|
853
867
|
|
854
868
|
Object result = m.module_eval(code);
|
855
869
|
ASSERT_EQUAL(21, detail::From_Ruby<int>().convert(result));
|
856
870
|
}
|
857
871
|
|
858
|
-
TESTCASE(
|
872
|
+
TESTCASE(pointer_of_ranges_wrong)
|
859
873
|
{
|
860
|
-
|
874
|
+
define_buffer<RangesTest::RangeCustom>();
|
861
875
|
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
.
|
876
|
+
Module m = define_module("CustomRanges");
|
877
|
+
|
878
|
+
Class c = define_class_under<RangesTest::RangeCustom>(m, "RangeCustom")
|
879
|
+
.define_constructor(Constructor<RangesTest::RangeCustom, int, int>())
|
880
|
+
.define_attr("x", &RangesTest::RangeCustom::x)
|
881
|
+
.define_attr("y", &RangesTest::RangeCustom::y);
|
882
|
+
|
883
|
+
m.define_module_function<int(*)(int, const RangesTest::RangeCustom*)>("sum_ranges_wrong", RangesTest::sumRanges);
|
884
|
+
|
885
|
+
std::string code = R"(range1 = RangeCustom.new(1, 2)
|
886
|
+
range2 = RangeCustom.new(3, 4)
|
887
|
+
range3 = RangeCustom.new(5, 6)
|
888
|
+
|
889
|
+
buffer = Rice::Buffer≺RangesTest꞉꞉RangeCustom≻.new([range1, range2, range3])
|
890
|
+
sum_ranges_wrong(buffer.size, buffer))";
|
891
|
+
|
892
|
+
ASSERT_EXCEPTION_CHECK(
|
893
|
+
Rice::Exception,
|
894
|
+
m.module_eval(code),
|
895
|
+
ASSERT_EQUAL("wrong argument type Rice::Buffer≺RangesTest꞉꞉RangeCustom≻ (expected CustomRanges::RangeCustom)", ex.what())
|
896
|
+
);
|
897
|
+
}
|
898
|
+
|
899
|
+
TESTCASE(pointer_of_pointer_ranges)
|
900
|
+
{
|
901
|
+
define_buffer<RangesTest::RangeCustom*>();
|
866
902
|
|
867
|
-
m
|
903
|
+
Module m = define_module("CustomRanges");
|
868
904
|
|
869
|
-
|
870
|
-
|
871
|
-
|
905
|
+
Class c = define_class_under<RangesTest::RangeCustom>(m, "RangeCustom")
|
906
|
+
.define_constructor(Constructor<RangesTest::RangeCustom, int, int>())
|
907
|
+
.define_attr("x", &RangesTest::RangeCustom::x)
|
908
|
+
.define_attr("y", &RangesTest::RangeCustom::y);
|
872
909
|
|
873
|
-
|
910
|
+
m.define_module_function<int(*)(int, const RangesTest::RangeCustom**)>("sum_ranges", RangesTest::sumRanges);
|
874
911
|
|
875
|
-
|
912
|
+
std::string code = R"(range1 = RangeCustom.new(1, 2)
|
913
|
+
range2 = RangeCustom.new(3, 4)
|
914
|
+
range3 = RangeCustom.new(5, 6)
|
915
|
+
buffer = Rice::Buffer≺RangesTest꞉꞉RangeCustom≻.new([range1, range2, range3])
|
916
|
+
sum_ranges(buffer.size, buffer))";
|
876
917
|
|
877
918
|
Object result = m.module_eval(code);
|
878
919
|
ASSERT_EQUAL(21, detail::From_Ruby<int>().convert(result));
|
data/test/test_Director.cpp
CHANGED
@@ -196,11 +196,15 @@ TESTCASE(polymorphic_calls_head_down_the_call_chain)
|
|
196
196
|
|
197
197
|
namespace {
|
198
198
|
|
199
|
-
class CallsSelf
|
199
|
+
class CallsSelf
|
200
|
+
{
|
200
201
|
public:
|
201
|
-
virtual ~CallsSelf()
|
202
|
+
virtual ~CallsSelf()
|
203
|
+
{
|
204
|
+
}
|
202
205
|
|
203
|
-
int doIt(int in)
|
206
|
+
int doIt(int in)
|
207
|
+
{
|
204
208
|
return doItImpl(in);
|
205
209
|
}
|
206
210
|
|
data/test/test_Enum.cpp
CHANGED
@@ -20,7 +20,6 @@ TEARDOWN(Enum)
|
|
20
20
|
rb_gc_start();
|
21
21
|
}
|
22
22
|
|
23
|
-
|
24
23
|
namespace
|
25
24
|
{
|
26
25
|
enum Color { RED, BLACK, GREEN };
|
@@ -164,7 +163,11 @@ TESTCASE(bitset_operators)
|
|
164
163
|
Object value = m.module_eval(code);
|
165
164
|
ASSERT_EQUAL(1, detail::From_Ruby<int>().convert(value));
|
166
165
|
|
167
|
-
code = R"(Season::
|
166
|
+
code = R"(Season::Spring | Season::Summer)";
|
167
|
+
value = m.module_eval(code);
|
168
|
+
ASSERT_EQUAL(1, detail::From_Ruby<int>().convert(value));
|
169
|
+
|
170
|
+
code = R"(Season::Spring | Season::Summer | Season::Fall)";
|
168
171
|
value = m.module_eval(code);
|
169
172
|
ASSERT_EQUAL(3, detail::From_Ruby<int>().convert(value));
|
170
173
|
|