1. Pypy
  2. Untitled project
  3. pypy

Commits

wlav  committed 32c47c1

consolidate all data types test cases across PyPy/cppyy and CPython/cppyy and add missing features (long double, enums, etc.)

  • Participants
  • Parent commits dc53bab
  • Branches reflex-support

Comments (0)

Files changed (17)

File pypy/module/cppyy/__init__.py

View file
         '_set_function_generator': 'interp_cppyy.set_function_generator',
         '_register_class'        : 'interp_cppyy.register_class',
         '_is_static'             : 'interp_cppyy.is_static',
+        '_is_enum'               : 'interp_cppyy.is_enum',
         '_get_nullptr'           : 'interp_cppyy.get_nullptr',
         'CPPInstanceBase'        : 'interp_cppyy.W_CPPInstance',
         'addressof'              : 'interp_cppyy.addressof',

File pypy/module/cppyy/capi/builtin_capi.py

View file
     compilation_info=backend.eci)
 def c_call_d(space, cppmethod, cppobject, nargs, args):
     return _c_call_d(cppmethod, cppobject, nargs, args)
+_c_call_ld = rffi.llexternal(
+    "cppyy_call_ld",
+    [C_METHOD, C_OBJECT, rffi.INT, rffi.VOIDP], rffi.LONGDOUBLE,
+    releasegil=ts_call,
+    compilation_info=backend.eci)
+def c_call_ld(space, cppmethod, cppobject, nargs, args):
+    return _c_call_ld(cppmethod, cppobject, nargs, args)
 
 _c_call_r = rffi.llexternal(
     "cppyy_call_r",

File pypy/module/cppyy/capi/loadable_capi.py

View file
         c_method = c_opaque_ptr
         c_index  = nt.new_primitive_type(space, 'long')
 
-        c_void   = nt.new_void_type(space)
-        c_char   = nt.new_primitive_type(space, 'char')
-        c_uchar  = nt.new_primitive_type(space, 'unsigned char')
-        c_short  = nt.new_primitive_type(space, 'short')
-        c_int    = nt.new_primitive_type(space, 'int')
-        c_long   = nt.new_primitive_type(space, 'long')
-        c_llong  = nt.new_primitive_type(space, 'long long')
-        c_ullong = nt.new_primitive_type(space, 'unsigned long long')
-        c_float  = nt.new_primitive_type(space, 'float')
-        c_double = nt.new_primitive_type(space, 'double')
+        c_void    = nt.new_void_type(space)
+        c_char    = nt.new_primitive_type(space, 'char')
+        c_uchar   = nt.new_primitive_type(space, 'unsigned char')
+        c_short   = nt.new_primitive_type(space, 'short')
+        c_int     = nt.new_primitive_type(space, 'int')
+        c_long    = nt.new_primitive_type(space, 'long')
+        c_llong   = nt.new_primitive_type(space, 'long long')
+        c_ullong  = nt.new_primitive_type(space, 'unsigned long long')
+        c_float   = nt.new_primitive_type(space, 'float')
+        c_double  = nt.new_primitive_type(space, 'double')
+        c_ldouble = nt.new_primitive_type(space, 'long double')
 
-        c_ccharp = nt.new_pointer_type(space, c_char)
+        c_ccharp  = nt.new_pointer_type(space, c_char)
         c_index_array = nt.new_pointer_type(space, c_void)
 
         c_voidp  = nt.new_pointer_type(space, c_void)
             'call_ll'      : ([c_method, c_object, c_int, c_voidp],   c_llong),
             'call_f'       : ([c_method, c_object, c_int, c_voidp],   c_float),
             'call_d'       : ([c_method, c_object, c_int, c_voidp],   c_double),
+            'call_ld'      : ([c_method, c_object, c_int, c_voidp],   c_ldouble),
 
             'call_r'       : ([c_method, c_object, c_int, c_voidp],   c_voidp),
             'call_s'       : ([c_method, c_object, c_int, c_voidp],   c_ccharp),
 def c_call_d(space, cppmethod, cppobject, nargs, cargs):
     args = [_Arg(h=cppmethod), _Arg(h=cppobject), _Arg(l=nargs), _Arg(vp=cargs)]
     return rffi.cast(rffi.DOUBLE, space.float_w(call_capi(space, 'call_d', args)))
+def c_call_ld(space, cppmethod, cppobject, nargs, cargs):
+    args = [_Arg(h=cppmethod), _Arg(h=cppobject), _Arg(l=nargs), _Arg(vp=cargs)]
+    return rffi.cast(rffi.LONGDOUBLE, space.float_w(call_capi(space, 'call_ld', args)))
 
 def c_call_r(space, cppmethod, cppobject, nargs, cargs):
     args = [_Arg(h=cppmethod), _Arg(h=cppobject), _Arg(l=nargs), _Arg(vp=cargs)]

File pypy/module/cppyy/converter.py

View file
         return fieldptr
 
     def _is_abstract(self, space):
-        raise OperationError(space.w_TypeError, space.wrap("no converter available for '%s'" % self.name))
+        raise OperationError(space.w_TypeError,
+                             space.wrap("no converter available for '%s'" % self.name))
 
     def convert_argument(self, space, w_obj, address, call_local):
         self._is_abstract(space)
 
     def convert_argument_libffi(self, space, w_obj, address, call_local):
         assert rffi.sizeof(self.c_type) <= 2*rffi.sizeof(rffi.VOIDP)  # see interp_cppyy.py
-        obj = self._unwrap_object(space, w_obj)
         typed_buf = rffi.cast(self.c_ptrtype, call_local)
-        typed_buf[0] = obj
+        typed_buf[0] = self._unwrap_object(space, w_obj)
         x = rffi.cast(rffi.VOIDPP, address)
         x[0] = call_local
 
         else:
             address[0] = '\x00'
 
-class CharConverter(ffitypes.typeid(rffi.CHAR), TypeConverter):
+
+class CharTypeConverterMixin(NumericTypeConverterMixin):
+    _mixin_ = True
+
+    def __init__(self, space, default):
+        if default:
+            cval = default[0]
+        else:
+            cval = '\x00'
+        self.default = cval
+
+class CharConverter(ffitypes.typeid(rffi.CHAR), CharTypeConverterMixin, TypeConverter):
+    _immutable_ = True
+
     def convert_argument(self, space, w_obj, address, call_local):
         x = rffi.cast(rffi.CCHARP, address)
         x[0] = self._unwrap_object(space, w_obj)
 
-    def convert_argument_libffi(self, space, w_obj, address, call_local):
-        x = rffi.cast(self.c_ptrtype, address)
+
+class ConstRefCharTypeConverterMixin(ConstRefNumericTypeConverterMixin):
+    _mixin_ = True
+
+    def __init__(self, space, default):
+        if default:
+            cval = default[0]
+        else:
+            cval = '\x00'
+        self.default = cval
+
+class ConstRefCharConverter(ffitypes.typeid(rffi.CHAR),
+                            ConstRefCharTypeConverterMixin, TypeConverter):
+    _immuteable_ = True
+    uses_local = True
+    libffitype = jit_libffi.types.pointer
+
+    def convert_argument(self, space, w_obj, address, call_local):
+        x = rffi.cast(rffi.CCHARP, address)
         x[0] = self._unwrap_object(space, w_obj)
 
-    def from_memory(self, space, w_obj, w_pycppclass, offset):
-        address = rffi.cast(rffi.CCHARP, self._get_raw_address(space, w_obj, offset))
-        return space.wrap(address[0])
+class SCharConverter(ffitypes.typeid(rffi.SIGNEDCHAR), CharTypeConverterMixin, TypeConverter):
+    _immutable_ = True
 
-    def to_memory(self, space, w_obj, w_value, offset):
-        address = rffi.cast(rffi.CCHARP, self._get_raw_address(space, w_obj, offset))
-        address[0] = self._unwrap_object(space, w_value)
+    def convert_argument(self, space, w_obj, address, call_local):
+        x = rffi.cast(rffi.CCHARP, address)
+        x[0] = self._unwrap_object(space, w_obj)
+
+class ConstRefSCharConverter(ffitypes.typeid(rffi.SIGNEDCHAR),
+                             ConstRefCharTypeConverterMixin, TypeConverter):
+    _immuteable_ = True
+    uses_local = True
+    libffitype = jit_libffi.types.pointer
+
+    def convert_argument(self, space, w_obj, address, call_local):
+        x = rffi.cast(rffi.CCHARP, address)
+        x[0] = self._unwrap_object(space, w_obj)
 
 class FloatConverter(ffitypes.typeid(rffi.FLOAT), FloatTypeConverterMixin, TypeConverter):
     _immutable_fields_ = ['default']
     typecode = 'D'
 
 
+class LongDoubleConverter(ffitypes.typeid(rffi.LONGDOUBLE), FloatTypeConverterMixin, TypeConverter):
+    _immutable_fields_ = ['default']
+    typecode = '?'
+
+    def __init__(self, space, default):
+        if default:
+            self.default = rffi.cast(self.c_type, rfloat.rstring_to_float(default))
+        else:
+            self.default = rffi.cast(self.c_type, 0.)
+
+    def default_argument_libffi(self, space, address):
+        # suppress: "[jitcodewriter:WARNING] type LongFloat is too large, ignoring graph"
+        from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+        raise FastCallNotPossible
+
+    def from_memory(self, space, w_obj, w_pycppclass, offset):
+        address = self._get_raw_address(space, w_obj, offset)
+        rffiptr = rffi.cast(self.c_ptrtype, address)
+        # TODO: this looses precision
+        return space.wrap(float(rffiptr[0]))
+
+class ConstLongDoubleRefConverter(ConstRefNumericTypeConverterMixin, LongDoubleConverter):
+    _immutable_fields_ = ['libffitype', 'typecode']
+    libffitype = jit_libffi.types.pointer
+
+    def default_argument_libffi(self, space, address):
+        # suppress: "[jitcodewriter:WARNING] type LongFloat is too large, ignoring graph"
+        from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+        raise FastCallNotPossible
+
 class CStringConverter(TypeConverter):
     def convert_argument(self, space, w_obj, address, call_local):
         x = rffi.cast(rffi.LONGP, address)
         elif compound == "":
             return InstanceConverter(space, cppclass)
     elif capi.c_is_enum(space, clean_name):
-        return _converters['unsigned'](space, default)
+        # TODO: this is missing several cases
+        if compound == "&":
+            return _converters['const unsigned int&'](space, default)
+        return _converters['unsigned int'+compound](space, default)
 
     #   5) void converter, which fails on use
     #
 
 _converters["bool"]                     = BoolConverter
 _converters["char"]                     = CharConverter
+_converters["const char&"]              = ConstRefCharConverter
+_converters["signed char"]              = SCharConverter
+_converters["const signed char&"]       = ConstRefSCharConverter
 _converters["float"]                    = FloatConverter
 _converters["const float&"]             = ConstFloatRefConverter
 _converters["double"]                   = DoubleConverter
 _converters["const double&"]            = ConstDoubleRefConverter
+_converters["long double"]              = LongDoubleConverter
+_converters["const long double&"]       = ConstLongDoubleRefConverter
 _converters["const char*"]              = CStringConverter
 _converters["void*"]                    = VoidPtrConverter
 _converters["void**"]                   = VoidPtrPtrConverter
     "NOT_RPYTHON"
     aliases = (
         ("char",                            "unsigned char"),
+        ("const char&",                     "const unsigned char&"),
         ("const char*",                     "char*"),
 
+        ("long long",                       "Long64_t"),
+        ("unsigned long long",              "ULong64_t"),
+
         ("std::basic_string<char>",         "string"),
         ("const std::basic_string<char>&",  "const string&"),
         ("std::basic_string<char>&",        "string&"),

File pypy/module/cppyy/executor.py

View file
 from pypy.interpreter.error import OperationError
 
 from rpython.rtyper.lltypesystem import rffi, lltype
-from rpython.rlib import jit_libffi
+from rpython.rlib import jit, jit_libffi
 
 from pypy.module._rawffi.interp_rawffi import unpack_simple_shape
 from pypy.module._rawffi.array import W_Array, W_ArrayInstance
             rffi.cast(self.c_ptrtype, rffi.cast(rffi.VOIDPP, result)[0]))
 
 
+class LongDoubleExecutor(ffitypes.typeid(rffi.LONGDOUBLE), NumericExecutorMixin, FunctionExecutor):
+    # exists to suppress: "[jitcodewriter:WARNING] type LongFloat is too large, ignoring graph"
+    _immutable_ = True
+    c_stubcall  = staticmethod(capi.c_call_ld)
+
+    @jit.dont_look_inside
+    def execute(self, space, cppmethod, cppthis, num_args, args):
+        result = self.c_stubcall(space, cppmethod, cppthis, num_args, args)
+        return self._wrap_object(space, rffi.cast(self.c_type, result))
+
+    def execute_libffi(self, space, cif_descr, funcaddr, buffer):
+        from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+        raise FastCallNotPossible
+
+class LongDoubleRefExecutor(ffitypes.typeid(rffi.LONGDOUBLE),
+                            NumericRefExecutorMixin, FunctionExecutor):
+    # exists to suppress: "[jitcodewriter:WARNING] type LongFloat is too large, ignoring graph"
+    _immutable_fields_ = ['libffitype']
+    libffitype = jit_libffi.types.pointer
+
+    @jit.dont_look_inside
+    def execute(self, space, cppmethod, cppthis, num_args, args):
+        result = capi.c_call_r(space, cppmethod, cppthis, num_args, args)
+        return self._wrap_reference(space, rffi.cast(self.c_ptrtype, result))
+
+    def execute_libffi(self, space, cif_descr, funcaddr, buffer):
+        from pypy.module.cppyy.interp_cppyy import FastCallNotPossible
+        raise FastCallNotPossible
+
+
 class CStringExecutor(FunctionExecutor):
 
     def execute(self, space, cppmethod, cppthis, num_args, args):
     type_info = (
         (bool,            capi.c_call_b,   ("bool",)),
         (rffi.CHAR,       capi.c_call_c,   ("char", "unsigned char")),
+        (rffi.SIGNEDCHAR, capi.c_call_c,   ("signed char",)),
         (rffi.SHORT,      capi.c_call_h,   ("short", "short int", "unsigned short", "unsigned short int")),
         (rffi.INT,        capi.c_call_i,   ("int",)),
         (rffi.UINT,       capi.c_call_l,   ("unsigned", "unsigned int")),
             _executors[name]              = BasicExecutor
             _executors[name+'&']          = BasicRefExecutor
             _executors['const '+name+'&'] = BasicRefExecutor     # no copy needed for builtins
+    # exists to suppress: "[jitcodewriter:WARNING] type LongFloat is too large, ignoring graph"
+    _executors["long double"]             = LongDoubleExecutor
+    _executors["long double&"]            = LongDoubleRefExecutor
+    _executors["const long double&"]      = LongDoubleRefExecutor
 _build_basic_executors()
 
 # create the pointer executors; all real work is in the PtrTypeExecutor, since

File pypy/module/cppyy/ffitypes.py

View file
 from pypy.interpreter.error import OperationError
 
 from rpython.rtyper.lltypesystem import rffi
-from rpython.rlib.rarithmetic import r_singlefloat
+from rpython.rlib.rarithmetic import r_singlefloat, r_longfloat
 from rpython.rlib import jit_libffi, rfloat
 
 # Mixins to share between converter and executor classes (in converter.py and
     _mixin_     = True
     _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
 
-    libffitype  = jit_libffi.types.schar
+    libffitype  = jit_libffi.types.uchar
     c_type      = rffi.CHAR
     c_ptrtype   = rffi.CCHARP           # there's no such thing as rffi.CHARP
 
                 raise OperationError(space.w_ValueError,
                                      space.wrap("char arg not in range(256)"))
 
-            value = rffi.cast(rffi.CHAR, space.c_int_w(w_value))
-        else:
-            value = space.str_w(w_value)
+            return rffi.cast(self.c_type, space.c_int_w(w_value))
+
+        # else string type
+        value = space.str_w(w_value)
 
         if len(value) != 1:  
-            raise OperationError(space.w_ValueError,
+            raise OperationError(space.w_TypeError,
                                  space.wrap("char expected, got string of size %d" % len(value)))
-        return value[0] # turn it into a "char" to the annotator
+        return rffi.cast(self.c_type, value[0])
+
+UCharTypeMixin = CharTypeMixin
+
+class SCharTypeMixin(object):
+    _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype']
+
+    # TODO: signed char is treated as an int type, figure out what's best
+    libffitype  = jit_libffi.types.schar
+    c_type      = rffi.CHAR
+    c_ptrtype   = rffi.CCHARP
+                
+    def _unwrap_object(self, space, w_value):
+        # allow int to pass to char and make sure that str is of length 1
+        if space.isinstance_w(w_value, space.w_int):
+            ival = space.c_int_w(w_value)
+            if ival < -128 or 128 <= ival:
+                raise OperationError(space.w_ValueError,
+                                     space.wrap("signed char arg not in range(-128, 128)"))
+        
+            return rffi.cast(self.c_type, space.c_int_w(w_value))
+
+        # else string type
+        value = space.str_w(w_value)
+    
+        if len(value) != 1:  
+            raise OperationError(space.w_TypeError,
+                                 space.wrap("signef char expected, got string of size %d" % len(value)))
+        return rffi.cast(self.c_type, value[0])
+
 
 class ShortTypeMixin(object):
     _mixin_     = True
     def _unwrap_object(self, space, w_obj):
         return space.float_w(w_obj)
 
+class LongDoubleTypeMixin(object):
+    _mixin_     = True
+    _immutable_fields_ = ['libffitype', 'c_type', 'c_ptrtype', 'typecode']
+
+    libffitype  = jit_libffi.types.longdouble
+    c_type      = rffi.LONGDOUBLE
+    c_ptrtype   = rffi.LONGDOUBLEP
+
+    def _unwrap_object(self, space, w_obj):
+        # TODO: this looses precision
+        return r_longfloat(space.float_w(w_obj))
+
+    def _wrap_object(self, space, obj):
+        # TODO: this looses precision
+        return space.wrap(float(obj))
+
 
 def typeid(c_type):
     "NOT_RPYTHON"
     if c_type == bool:            return BoolTypeMixin
     if c_type == rffi.CHAR:       return CharTypeMixin
+    if c_type == rffi.UCHAR:      return UCharTypeMixin
+    if c_type == rffi.SIGNEDCHAR: return SCharTypeMixin
     if c_type == rffi.SHORT:      return ShortTypeMixin
     if c_type == rffi.USHORT:     return UShortTypeMixin
     if c_type == rffi.INT:        return IntTypeMixin
     if c_type == rffi.ULONGLONG:  return ULongLongTypeMixin
     if c_type == rffi.FLOAT:      return FloatTypeMixin
     if c_type == rffi.DOUBLE:     return DoubleTypeMixin
+    if c_type == rffi.LONGDOUBLE: return LongDoubleTypeMixin
 
     # should never get here
     raise TypeError("unknown rffi type: %s" % c_type)

File pypy/module/cppyy/include/capi.h

View file
     long long cppyy_call_ll(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
     float  cppyy_call_f(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
     double cppyy_call_d(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
+    long double cppyy_call_ld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
 
     void*  cppyy_call_r(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);
     char*  cppyy_call_s(cppyy_method_t method, cppyy_object_t self, int nargs, void* args);

File pypy/module/cppyy/interp_cppyy.py

View file
     except Exception:
         return space.w_False
 
+@unwrap_spec(name=str)
+def is_enum(space, name):
+    return space.wrap(capi.c_is_enum(space, name))
+
 class W_CPPScope(W_Root):
     _attrs_ = ['space', 'name', 'handle', 'methods', 'datamembers']
     _immutable_fields_ = ['kind', 'name']

File pypy/module/cppyy/pythonify.py

View file
         else:
             pycppitem = make_pycppclass(scope, true_name, name, cppitem)
 
+    # enums (special case)
+    if not cppitem:
+        if cppyy._is_enum(full_name):
+            return getattr(cppyy.gbl, "unsigned int")
+
     # templates
     if not cppitem:
         cppitem = cppyy._template_byname(true_name)

File pypy/module/cppyy/src/dummy_backend.cxx

View file
 #include <stdlib.h>
 #include <string.h>
 
+#include <iostream>
+
 #pragma GCC diagnostic ignored "-Winvalid-offsetof"
 
 // add example01.cxx code
 
 #define PUBLIC_CPPYY_DATA(dmname, dmtype)                                     \
     data.push_back(Cppyy_PseudoDatambrInfo("m_"#dmname, #dmtype,              \
-        offsetof(dummy::cppyy_test_data, m_##dmname), false));                \
+        offsetof(dummy::CppyyTestData, m_##dmname), false));                  \
     argtypes.clear();                                                         \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
                          "get_"#dmname, argtypes, #dmtype));                  \
-    s_methods["cppyy_test_data::get_"#dmname] = s_method_id++;                \
+    s_methods["CppyyTestData::get_"#dmname] = s_method_id++;                  \
+    methods.push_back(Cppyy_PseudoMethodInfo(                                 \
+                         "get_"#dmname"_cr", argtypes, "const "#dmtype"&"));  \
+    s_methods["CppyyTestData::get_"#dmname"_cr"] = s_method_id++;             \
     argtypes.push_back(#dmtype);                                              \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
                          "set_"#dmname, argtypes, "void"));                   \
-    s_methods["cppyy_test_data::set_"#dmname] = s_method_id++;                \
+    s_methods["CppyyTestData::set_"#dmname] = s_method_id++;                  \
     argtypes.clear();                                                         \
     argtypes.push_back("const "#dmtype"&");                                   \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
-                         "set_"#dmname"_c", argtypes, "void"));               \
-    s_methods["cppyy_test_data::set_"#dmname"_c"] = s_method_id++
+                         "set_"#dmname"_cr", argtypes, "void"));              \
+    s_methods["CppyyTestData::set_"#dmname"_cr"] = s_method_id++
 
 #define PUBLIC_CPPYY_DATA2(dmname, dmtype)                                    \
     PUBLIC_CPPYY_DATA(dmname, dmtype);                                        \
     data.push_back(Cppyy_PseudoDatambrInfo("m_"#dmname"_array", #dmtype"[5]", \
-        offsetof(dummy::cppyy_test_data, m_##dmname##_array), false));        \
+        offsetof(dummy::CppyyTestData, m_##dmname##_array), false));          \
     data.push_back(Cppyy_PseudoDatambrInfo("m_"#dmname"_array2", #dmtype"*",  \
-        offsetof(dummy::cppyy_test_data, m_##dmname##_array2), false));       \
+        offsetof(dummy::CppyyTestData, m_##dmname##_array2), false));         \
     argtypes.clear();                                                         \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
                          "get_"#dmname"_array", argtypes, #dmtype"*"));       \
-    s_methods["cppyy_test_data::get_"#dmname"_array"] = s_method_id++;        \
+    s_methods["CppyyTestData::get_"#dmname"_array"] = s_method_id++;          \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
                          "get_"#dmname"_array2", argtypes, #dmtype"*"));      \
-    s_methods["cppyy_test_data::get_"#dmname"_array2"] = s_method_id++
+    s_methods["CppyyTestData::get_"#dmname"_array2"] = s_method_id++
 
 #define PUBLIC_CPPYY_DATA3(dmname, dmtype, key)                               \
     PUBLIC_CPPYY_DATA2(dmname, dmtype);                                       \
     argtypes.push_back(#dmtype"*");                                           \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
                          "pass_array", argtypes, #dmtype"*"));                \
-    s_methods["cppyy_test_data::pass_array_"#dmname] = s_method_id++;         \
+    s_methods["CppyyTestData::pass_array_"#dmname] = s_method_id++;           \
     argtypes.clear(); argtypes.push_back("void*");                            \
     methods.push_back(Cppyy_PseudoMethodInfo(                                 \
                          "pass_void_array_"#key, argtypes, #dmtype"*"));      \
-    s_methods["cppyy_test_data::pass_void_array_"#key] = s_method_id++
+    s_methods["CppyyTestData::pass_void_array_"#key] = s_method_id++
 
 #define PUBLIC_CPPYY_STATIC_DATA(dmname, dmtype)                              \
     data.push_back(Cppyy_PseudoDatambrInfo("s_"#dmname, #dmtype,              \
-        (ptrdiff_t)&dummy::cppyy_test_data::s_##dmname, true))
+        (ptrdiff_t)&dummy::CppyyTestData::s_##dmname, true))
 
+static unsigned int g_kNothing   =   6;
+static unsigned int g_kSomething = 111;
+static unsigned int g_kLots      =  42;
 
 struct Cppyy_InitPseudoReflectionInfo {
     Cppyy_InitPseudoReflectionInfo() {
 
         //====================================================================
 
-        { // class cppyy_test_data --
-        s_handles["cppyy_test_data"] = (cppyy_scope_t)++s_scope_id;
+        { // class CppyyTestData --
+        s_handles["CppyyTestData"] = (cppyy_scope_t)++s_scope_id;
 
         std::vector<Cppyy_PseudoMethodInfo> methods;
 
-        // cppyy_test_data()
+        // CppyyTestData()
         std::vector<std::string> argtypes;
-        methods.push_back(Cppyy_PseudoMethodInfo("cppyy_test_data", argtypes, "constructor", kConstructor));
-        s_methods["cppyy_test_data::cppyy_test_data"] = s_method_id++;
+        methods.push_back(Cppyy_PseudoMethodInfo("CppyyTestData", argtypes, "constructor", kConstructor));
+        s_methods["CppyyTestData::CppyyTestData"] = s_method_id++;
 
         methods.push_back(Cppyy_PseudoMethodInfo("destroy_arrays", argtypes, "void"));
-        s_methods["cppyy_test_data::destroy_arrays"] = s_method_id++;
+        s_methods["CppyyTestData::destroy_arrays"] = s_method_id++;
 
         std::vector<Cppyy_PseudoDatambrInfo> data;
         PUBLIC_CPPYY_DATA2(bool,    bool);
         PUBLIC_CPPYY_DATA (char,    char);
+        PUBLIC_CPPYY_DATA (schar,   signed char);
         PUBLIC_CPPYY_DATA (uchar,   unsigned char);
         PUBLIC_CPPYY_DATA3(short,   short,              h);
         PUBLIC_CPPYY_DATA3(ushort,  unsigned short,     H);
         PUBLIC_CPPYY_DATA (ullong,  unsigned long long);
         PUBLIC_CPPYY_DATA3(float,   float,              f);
         PUBLIC_CPPYY_DATA3(double,  double,             d);
-        PUBLIC_CPPYY_DATA (enum,    cppyy_test_data::what);
+        PUBLIC_CPPYY_DATA (ldouble, long double);
+        PUBLIC_CPPYY_DATA (enum,    CppyyTestData::EWhat);
         PUBLIC_CPPYY_DATA (voidp,   void*);
 
+        PUBLIC_CPPYY_STATIC_DATA(bool,    bool);
         PUBLIC_CPPYY_STATIC_DATA(char,    char);
+        PUBLIC_CPPYY_STATIC_DATA(schar,   signed char);
         PUBLIC_CPPYY_STATIC_DATA(uchar,   unsigned char);
         PUBLIC_CPPYY_STATIC_DATA(short,   short);
         PUBLIC_CPPYY_STATIC_DATA(ushort,  unsigned short);
         PUBLIC_CPPYY_STATIC_DATA(ullong,  unsigned long long);
         PUBLIC_CPPYY_STATIC_DATA(float,   float);
         PUBLIC_CPPYY_STATIC_DATA(double,  double);
-        PUBLIC_CPPYY_STATIC_DATA(enum,    cppyy_test_data::what);
+        PUBLIC_CPPYY_STATIC_DATA(ldouble, long double);
+        PUBLIC_CPPYY_STATIC_DATA(enum,    CppyyTestData::EWhat);
         PUBLIC_CPPYY_STATIC_DATA(voidp,   void*);
 
+        data.push_back(Cppyy_PseudoDatambrInfo(
+            "kNothing",   "CppyyTestData::EWhat", (ptrdiff_t)&g_kNothing,   true));
+        data.push_back(Cppyy_PseudoDatambrInfo(
+            "kSomething", "CppyyTestData::EWhat", (ptrdiff_t)&g_kSomething, true));
+        data.push_back(Cppyy_PseudoDatambrInfo(
+            "kLots",      "CppyyTestData::EWhat", (ptrdiff_t)&g_kLots,      true));
+
         Cppyy_PseudoClassInfo info(methods, s_method_id - methods.size(), data);
         s_scopes[(cppyy_scope_t)s_scope_id] = info;
-        } // -- class cppyy_test_data
+        } // -- class CppyyTestData
 
     }
 } _init;
     } else if (idx == s_methods["example01::setPayload_payload*"]) {
         assert(self && nargs == 1);
         ((dummy::example01*)self)->setPayload((dummy::payload*)(*(long*)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::destroy_arrays"]) {
+    } else if (idx == s_methods["CppyyTestData::destroy_arrays"]) {
         assert(self && nargs == 0);
-        ((dummy::cppyy_test_data*)self)->destroy_arrays();
-    } else if (idx == s_methods["cppyy_test_data::set_bool"]) {
+        ((dummy::CppyyTestData*)self)->destroy_arrays();
+    } else if (idx == s_methods["CppyyTestData::set_bool"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_bool((bool)((CPPYY_G__value*)args)[0].obj.in);
-    } else if (idx == s_methods["cppyy_test_data::set_char"]) {
+        ((dummy::CppyyTestData*)self)->set_bool((bool)((CPPYY_G__value*)args)[0].obj.in);
+    } else if (idx == s_methods["CppyyTestData::set_char"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_char(((CPPYY_G__value*)args)[0].obj.ch);
-    } else if (idx == s_methods["cppyy_test_data::set_uchar"]) {
+        ((dummy::CppyyTestData*)self)->set_char(((CPPYY_G__value*)args)[0].obj.ch);
+    } else if (idx == s_methods["CppyyTestData::set_char_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_uchar(((CPPYY_G__value*)args)[0].obj.uch);
-    } else if (idx == s_methods["cppyy_test_data::set_short"]) {
+        ((dummy::CppyyTestData*)self)->set_char_cr(*(char*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_schar"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_short(((CPPYY_G__value*)args)[0].obj.sh);
-    } else if (idx == s_methods["cppyy_test_data::set_short_c"]) {
+        ((dummy::CppyyTestData*)self)->set_schar((signed char)((CPPYY_G__value*)args)[0].obj.ch);
+    } else if (idx == s_methods["CppyyTestData::set_schar_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_short_c(*(short*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_ushort"]) {
+        ((dummy::CppyyTestData*)self)->set_schar_cr(*(signed char*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_uchar"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_ushort(((CPPYY_G__value*)args)[0].obj.ush);
-    } else if (idx == s_methods["cppyy_test_data::set_ushort_c"]) {
+        ((dummy::CppyyTestData*)self)->set_uchar(((CPPYY_G__value*)args)[0].obj.uch);
+    }  else if (idx == s_methods["CppyyTestData::set_uchar_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_ushort_c(*(unsigned short*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_int"]) {
+        ((dummy::CppyyTestData*)self)->set_uchar_cr(*(unsigned char*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_short"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_int(((CPPYY_G__value*)args)[0].obj.in);
-    } else if (idx == s_methods["cppyy_test_data::set_int_c"]) {
+        ((dummy::CppyyTestData*)self)->set_short(((CPPYY_G__value*)args)[0].obj.sh);
+    } else if (idx == s_methods["CppyyTestData::set_short_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_int_c(*(int*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_uint"]) {
+        ((dummy::CppyyTestData*)self)->set_short_cr(*(short*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_ushort"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_uint(((CPPYY_G__value*)args)[0].obj.uin);
-    } else if (idx == s_methods["cppyy_test_data::set_uint_c"]) {
+        ((dummy::CppyyTestData*)self)->set_ushort(((CPPYY_G__value*)args)[0].obj.ush);
+    } else if (idx == s_methods["CppyyTestData::set_ushort_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_uint_c(*(unsigned int*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_long"]) {
+        ((dummy::CppyyTestData*)self)->set_ushort_cr(*(unsigned short*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_int"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_long(((CPPYY_G__value*)args)[0].obj.i);
-    } else if (idx == s_methods["cppyy_test_data::set_long_c"]) {
+        ((dummy::CppyyTestData*)self)->set_int(((CPPYY_G__value*)args)[0].obj.in);
+    } else if (idx == s_methods["CppyyTestData::set_int_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_long_c(*(long*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_ulong"]) {
+        ((dummy::CppyyTestData*)self)->set_int_cr(*(int*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_uint"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_ulong(((CPPYY_G__value*)args)[0].obj.ulo);
-    } else if (idx == s_methods["cppyy_test_data::set_ulong_c"]) {
+        ((dummy::CppyyTestData*)self)->set_uint(((CPPYY_G__value*)args)[0].obj.uin);
+    } else if (idx == s_methods["CppyyTestData::set_uint_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_ulong_c(*(unsigned long*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_llong"]) {
+        ((dummy::CppyyTestData*)self)->set_uint_cr(*(unsigned int*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_long"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_llong(((CPPYY_G__value*)args)[0].obj.ll);
-    } else if (idx == s_methods["cppyy_test_data::set_llong_c"]) {
+        ((dummy::CppyyTestData*)self)->set_long(((CPPYY_G__value*)args)[0].obj.i);
+    } else if (idx == s_methods["CppyyTestData::set_long_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_llong_c(*(long long*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_ullong"]) {
+        ((dummy::CppyyTestData*)self)->set_long_cr(*(long*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_ulong"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_ullong(((CPPYY_G__value*)args)[0].obj.ull);
-    } else if (idx == s_methods["cppyy_test_data::set_ullong_c"]) {
+        ((dummy::CppyyTestData*)self)->set_ulong(((CPPYY_G__value*)args)[0].obj.ulo);
+    } else if (idx == s_methods["CppyyTestData::set_ulong_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_ullong_c(*(unsigned long*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_float"]) {
+        ((dummy::CppyyTestData*)self)->set_ulong_cr(*(unsigned long*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_llong"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_float(((CPPYY_G__value*)args)[0].obj.fl);
-    } else if (idx == s_methods["cppyy_test_data::set_float_c"]) {
+        ((dummy::CppyyTestData*)self)->set_llong(((CPPYY_G__value*)args)[0].obj.ll);
+    } else if (idx == s_methods["CppyyTestData::set_llong_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_float_c(*(float*)&((CPPYY_G__value*)args)[0]);
-    } else if (idx == s_methods["cppyy_test_data::set_double"]) {
+        ((dummy::CppyyTestData*)self)->set_llong_cr(*(long long*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_ullong"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_double(((CPPYY_G__value*)args)[0].obj.d);
-    } else if (idx == s_methods["cppyy_test_data::set_double_c"]) {
+        ((dummy::CppyyTestData*)self)->set_ullong(((CPPYY_G__value*)args)[0].obj.ull);
+    } else if (idx == s_methods["CppyyTestData::set_ullong_cr"]) {
         assert(self && nargs == 1);
-        ((dummy::cppyy_test_data*)self)->set_double_c(*(double*)&((CPPYY_G__value*)args)[0]);
+        ((dummy::CppyyTestData*)self)->set_ullong_cr(*(unsigned long*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_float"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_float(((CPPYY_G__value*)args)[0].obj.fl);
+    } else if (idx == s_methods["CppyyTestData::set_float_cr"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_float_cr(*(float*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_double"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_double(((CPPYY_G__value*)args)[0].obj.d);
+    } else if (idx == s_methods["CppyyTestData::set_double_cr"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_double_cr(*(double*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_ldouble"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_ldouble(((CPPYY_G__value*)args)[0].obj.ld);
+    } else if (idx == s_methods["CppyyTestData::set_ldouble_cr"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_ldouble_cr(*(long double*)&((CPPYY_G__value*)args)[0]);
+    } else if (idx == s_methods["CppyyTestData::set_enum"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_enum(
+           (dummy::CppyyTestData::EWhat)((CPPYY_G__value*)args)[0].obj.uin);
+    } else if (idx == s_methods["CppyyTestData::set_enum_cr"]) {
+        assert(self && nargs == 1);
+        ((dummy::CppyyTestData*)self)->set_enum_cr(
+           *(dummy::CppyyTestData::EWhat*)&((CPPYY_G__value*)args)[0]);
     } else {
+       for (std::map<std::string, long>::iterator it = s_methods.begin();
+            it != s_methods.end(); ++it) {
+          if (it->second == idx) std::cout << "MISSING: " << it->first << std::endl;
+       }
         assert(!"method unknown in cppyy_call_v");
     }
 }
 unsigned char cppyy_call_b(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     unsigned char result = 0;
     const long idx = (long)method;
-    if (idx == s_methods["cppyy_test_data::get_bool"]) {
+    if (idx == s_methods["CppyyTestData::get_bool"]) {
         assert(self && nargs == 0);
-        result = (unsigned char)((dummy::cppyy_test_data*)self)->get_bool();
+        result = (unsigned char)((dummy::CppyyTestData*)self)->get_bool();
     } else {
         assert(!"method unknown in cppyy_call_b");
     }
 char cppyy_call_c(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     char result = 0;
     const long idx = (long)method;
-    if (idx == s_methods["cppyy_test_data::get_char"]) {
+    if (idx == s_methods["CppyyTestData::get_char"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_char();
-    } else if (idx == s_methods["cppyy_test_data::get_uchar"]) {
+        result = ((dummy::CppyyTestData*)self)->get_char();
+    } else if (idx == s_methods["CppyyTestData::get_schar"]) {
         assert(self && nargs == 0);
-        result = (char)((dummy::cppyy_test_data*)self)->get_uchar();
+        result = (char)((dummy::CppyyTestData*)self)->get_schar();
+    } else if (idx == s_methods["CppyyTestData::get_uchar"]) {
+        assert(self && nargs == 0);
+        result = (char)((dummy::CppyyTestData*)self)->get_uchar();
     } else {
         assert(!"method unknown in cppyy_call_c");
     } 
 short cppyy_call_h(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     short result = 0;
     const long idx = (long)method; 
-    if (idx == s_methods["cppyy_test_data::get_short"]) {
+    if (idx == s_methods["CppyyTestData::get_short"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_short();
-    } else if (idx == s_methods["cppyy_test_data::get_ushort"]) {
+        result = ((dummy::CppyyTestData*)self)->get_short();
+    } else if (idx == s_methods["CppyyTestData::get_ushort"]) {
         assert(self && nargs == 0);
-        result = (short)((dummy::cppyy_test_data*)self)->get_ushort();
+        result = (short)((dummy::CppyyTestData*)self)->get_ushort();
     } else {
         assert(!"method unknown in cppyy_call_h");
     }   
         assert(self && nargs == 1);
         result = ((dummy::example01*)self)->addDataToAtoi(
            (const char*)(*(long*)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::get_int"]) {
+    } else if (idx == s_methods["CppyyTestData::get_int"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_int();
+        result = ((dummy::CppyyTestData*)self)->get_int();
     } else {
         assert(!"method unknown in cppyy_call_i");
     }
         assert(self && nargs == 1);
         result = (long)((dummy::example01*)self)->cyclePayload(
            (dummy::payload*)(*(long*)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::get_uint"]) {
+    } else if (idx == s_methods["CppyyTestData::get_uint"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_uint();
-    } else if (idx == s_methods["cppyy_test_data::get_long"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_uint();
+    } else if (idx == s_methods["CppyyTestData::get_long"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_long();
-    } else if (idx == s_methods["cppyy_test_data::get_ulong"]) {
+        result = ((dummy::CppyyTestData*)self)->get_long();
+    } else if (idx == s_methods["CppyyTestData::get_ulong"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_ulong();
-    } else if (idx == s_methods["cppyy_test_data::get_bool_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_ulong();
+    } else if (idx == s_methods["CppyyTestData::get_enum"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_bool_array();
-    } else if (idx == s_methods["cppyy_test_data::get_bool_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_enum();
+    } else if (idx == s_methods["CppyyTestData::get_bool_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_bool_array2();
-    } else if (idx == s_methods["cppyy_test_data::get_short_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_bool_array();
+    } else if (idx == s_methods["CppyyTestData::get_bool_array2"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_short_array();
-    } else if (idx == s_methods["cppyy_test_data::get_short_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_bool_array2();
+    } else if (idx == s_methods["CppyyTestData::get_short_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_short_array2();
-    } else if (idx == s_methods["cppyy_test_data::get_ushort_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_short_array();
+    } else if (idx == s_methods["CppyyTestData::get_short_array2"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_ushort_array();
-    } else if (idx == s_methods["cppyy_test_data::get_ushort_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_short_array2();
+    } else if (idx == s_methods["CppyyTestData::get_ushort_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_ushort_array2();
-    } else if (idx == s_methods["cppyy_test_data::get_int_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_ushort_array();
+    } else if (idx == s_methods["CppyyTestData::get_ushort_array2"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_int_array();
-    } else if (idx == s_methods["cppyy_test_data::get_int_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_ushort_array2();
+    } else if (idx == s_methods["CppyyTestData::get_int_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_int_array2();
-    } else if (idx == s_methods["cppyy_test_data::get_uint_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_int_array();
+    } else if (idx == s_methods["CppyyTestData::get_int_array2"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_uint_array();
-    } else if (idx == s_methods["cppyy_test_data::get_uint_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_int_array2();
+    } else if (idx == s_methods["CppyyTestData::get_uint_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_uint_array2();
-    } else if (idx == s_methods["cppyy_test_data::get_long_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_uint_array();
+    } else if (idx == s_methods["CppyyTestData::get_uint_array2"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_long_array();
-    } else if (idx == s_methods["cppyy_test_data::get_long_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_uint_array2();
+    } else if (idx == s_methods["CppyyTestData::get_long_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_long_array2();
-    } else if (idx == s_methods["cppyy_test_data::get_ulong_array"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_long_array();
+    } else if (idx == s_methods["CppyyTestData::get_long_array2"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_ulong_array();
-    } else if (idx == s_methods["cppyy_test_data::get_ulong_array2"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_long_array2();
+    } else if (idx == s_methods["CppyyTestData::get_ulong_array"]) {
         assert(self && nargs == 0);
-        result = (long)((dummy::cppyy_test_data*)self)->get_ulong_array2();
-    } else if (idx == s_methods["cppyy_test_data::pass_array_short"]) {
+        result = (long)((dummy::CppyyTestData*)self)->get_ulong_array();
+    } else if (idx == s_methods["CppyyTestData::get_ulong_array2"]) {
+        assert(self && nargs == 0);
+        result = (long)((dummy::CppyyTestData*)self)->get_ulong_array2();
+    } else if (idx == s_methods["CppyyTestData::pass_array_short"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(short**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_h"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_h"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_h(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_h(
            (*(short**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_ushort"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_ushort"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(unsigned short**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_H"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_H"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_H(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_H(
            (*(unsigned short**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_int"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_int"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(int**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_i"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_i"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_i(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_i(
            (*(int**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_uint"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_uint"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(unsigned int**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_I"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_I"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_I(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_I(
            (*(unsigned int**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_long"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_long"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(long**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_l"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_l"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_l(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_l(
            (*(long**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_ulong"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_ulong"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(unsigned long**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_L"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_L"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_L(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_L(
            (*(unsigned long**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_float"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_float"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(float**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_f"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_f"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_f(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_f(
            (*(float**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_array_double"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_array_double"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_array(
+        result = (long)((dummy::CppyyTestData*)self)->pass_array(
            (*(double**)&((CPPYY_G__value*)args)[0]));
-    } else if (idx == s_methods["cppyy_test_data::pass_void_array_d"]) {
+    } else if (idx == s_methods["CppyyTestData::pass_void_array_d"]) {
         assert(self && nargs == 1);
-        result = (long)((dummy::cppyy_test_data*)self)->pass_void_array_d(
+        result = (long)((dummy::CppyyTestData*)self)->pass_void_array_d(
            (*(double**)&((CPPYY_G__value*)args)[0]));
     } else {
-        assert(!"method unknown in cppyy_call_l");
+       for (std::map<std::string, long>::iterator it = s_methods.begin();
+            it != s_methods.end(); ++it) {
+          if (it->second == idx) std::cout << "MISSING: " << it->first << std::endl;
+       }
+       assert(!"method unknown in cppyy_call_l");
     }
     return result;
 }
 long long cppyy_call_ll(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     long long result = 0;
     const long idx = (long)method;
-    if (idx == s_methods["cppyy_test_data::get_llong"]) {
+    if (idx == s_methods["CppyyTestData::get_llong"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_llong();
-    } else if (idx == s_methods["cppyy_test_data::get_ullong"]) {
+        result = ((dummy::CppyyTestData*)self)->get_llong();
+    } else if (idx == s_methods["CppyyTestData::get_ullong"]) {
         assert(self && nargs == 0);
-        result = (long long)((dummy::cppyy_test_data*)self)->get_ullong();
+        result = (long long)((dummy::CppyyTestData*)self)->get_ullong();
     } else {
         assert(!"method unknown in cppyy_call_ll");
     }
 float cppyy_call_f(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     float result = 0;
     const long idx = (long)method;
-    if (idx == s_methods["cppyy_test_data::get_float"]) {
+    if (idx == s_methods["CppyyTestData::get_float"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_float();
+        result = ((dummy::CppyyTestData*)self)->get_float();
     } else {
         assert(!"method unknown in cppyy_call_f");
     }
     } else if (idx == s_methods["payload::getData"]) {
         assert(self && nargs == 0);
         result = ((dummy::payload*)self)->getData();
-    } else if (idx == s_methods["cppyy_test_data::get_double"]) {
+    } else if (idx == s_methods["CppyyTestData::get_double"]) {
         assert(self && nargs == 0);
-        result = ((dummy::cppyy_test_data*)self)->get_double();
+        result = ((dummy::CppyyTestData*)self)->get_double();
     } else {
         assert(!"method unknown in cppyy_call_d");
     }
     return result;
 }
 
+long double cppyy_call_ld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
+    long double result = 0.l;
+    const long idx = (long)method;
+    if (idx == s_methods["CppyyTestData::get_ldouble"]) {
+        assert(self && nargs == 0);
+        result = ((dummy::CppyyTestData*)self)->get_ldouble();
+    } else {
+       assert(!"method unknown in cppyy_call_ld");
+    }
+    return result;
+}
+
+void* cppyy_call_r(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
+    void* result = 0;
+    const long idx = (long)method;
+    if (idx == s_methods["CppyyTestData::get_char_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_char_cr();
+    } else if (idx == s_methods["CppyyTestData::get_uchar_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_uchar_cr();
+    } else if (idx == s_methods["CppyyTestData::get_schar_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_schar_cr();
+    } else if (idx == s_methods["CppyyTestData::get_short_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_short_cr();
+    } else if (idx == s_methods["CppyyTestData::get_ushort_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_ushort_cr();
+    } else if (idx == s_methods["CppyyTestData::get_int_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_int_cr();
+    } else if (idx == s_methods["CppyyTestData::get_uint_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_uint_cr();
+    } else if (idx == s_methods["CppyyTestData::get_long_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_long_cr();
+    } else if (idx == s_methods["CppyyTestData::get_ulong_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_ulong_cr();
+    } else if (idx == s_methods["CppyyTestData::get_llong_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_llong_cr();
+    } else if (idx == s_methods["CppyyTestData::get_ullong_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_ullong_cr();
+    } else if (idx == s_methods["CppyyTestData::get_float_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_float_cr();
+    } else if (idx == s_methods["CppyyTestData::get_double_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_double_cr();
+    } else if (idx == s_methods["CppyyTestData::get_ldouble_cr"]) {
+        assert(self && nargs == 0);
+        result = (void*)&((dummy::CppyyTestData*)self)->get_ldouble_cr();
+    } else {
+       for (std::map<std::string, long>::iterator it = s_methods.begin();
+            it != s_methods.end(); ++it) {
+          if (it->second == idx) std::cout << "MISSING: " << it->first << std::endl;
+       }
+       assert(!"method unknown in cppyy_call_r");
+    }
+    return result;
+}
+
+
 char* cppyy_call_s(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     char* result = 0;
     const long idx = (long)method;
         assert(nargs == 0 || nargs == 1);
         if (nargs == 0) result = new dummy::payload;
         else if (nargs == 1) result = new dummy::payload(((CPPYY_G__value*)args)[0].obj.d);
-    } else if (idx == s_methods["cppyy_test_data::cppyy_test_data"]) {
+    } else if (idx == s_methods["CppyyTestData::CppyyTestData"]) {
         assert(nargs == 0);
-        result = new dummy::cppyy_test_data;
+        result = new dummy::CppyyTestData;
     } else {
         assert(!"method unknown in cppyy_constructor");
     }       
     return 0;
 }   
 
-int cppyy_is_enum(const char* /* type_name */) {
+int cppyy_is_enum(const char* type_name) {
+    if (strcmp(type_name, "CppyyTestData::EWhat") == 0)
+        return 1;
     return 0;
 }
     

File pypy/module/cppyy/src/reflexcwrapper.cxx

View file
 char* cppyy_resolve_name(const char* cppitem_name) {
     Reflex::Scope s = Reflex::Scope::ByName(cppitem_name);
     if (s.IsEnum())
-        return cppstring_to_cstring("unsigned int");
+        return cppstring_to_cstring(cppitem_name);
     const std::string& name = s.Name(Reflex::SCOPED|Reflex::QUALIFIED|Reflex::FINAL);
     if (name.empty())
         return cppstring_to_cstring(cppitem_name);
     return cppyy_call_T<double>(method, self, nargs, args);
 }
 
+long double cppyy_call_ld(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
+    return cppyy_call_T<long double>(method, self, nargs, args);
+}
+
 void* cppyy_call_r(cppyy_method_t method, cppyy_object_t self, int nargs, void* args) {
     return (void*)cppyy_call_T<long>(method, self, nargs, args);
 }

File pypy/module/cppyy/test/datatypes.cxx

View file
 
 
 //===========================================================================
-cppyy_test_data::cppyy_test_data() : m_owns_arrays(false)
+CppyyTestData::CppyyTestData() : m_owns_arrays(false)
 {
-    m_bool   = false;
-    m_char   = 'a';
-    m_uchar  = 'c';
-    m_short  = -11;
-    m_ushort =  11u;
-    m_int    = -22;
-    m_uint   =  22u;
-    m_long   = -33l;
-    m_ulong  =  33ul;
-    m_llong  = -44ll;
-    m_ullong =  55ull;
-    m_float  = -66.f;
-    m_double = -77.;
-    m_enum   = kNothing;
-    m_voidp  = (void*)0;
+    m_bool    = false;
+    m_char    = 'a';
+    m_schar   = 'b';
+    m_uchar   = 'c';
+    m_short   = -11;
+    m_ushort  =  11u;
+    m_int     = -22;
+    m_uint    =  22u;
+    m_long    = -33l;
+    m_ulong   =  33ul;
+    m_llong   = -44ll;
+    m_ullong  =  44ull;
+    m_float   = -66.f;
+    m_double  = -77.;
+    m_ldouble = -88.l;
+    m_enum    = kNothing;
+    m_voidp   = (void*)0;
 
     m_bool_array2   = new bool[N];
     m_short_array2  = new short[N];
     m_ppod = &m_pod;
 };
 
-cppyy_test_data::~cppyy_test_data()
+CppyyTestData::~CppyyTestData()
 {
     destroy_arrays();
 }
 
-void cppyy_test_data::destroy_arrays() {
+void CppyyTestData::destroy_arrays() {
     if (m_owns_arrays == true) {
         delete[] m_bool_array2;
         delete[] m_short_array2;
 }
 
 //- getters -----------------------------------------------------------------
-bool           cppyy_test_data::get_bool()   { return m_bool; }
-char           cppyy_test_data::get_char()   { return m_char; }
-unsigned char  cppyy_test_data::get_uchar()  { return m_uchar; }
-short          cppyy_test_data::get_short()  { return m_short; }
-unsigned short cppyy_test_data::get_ushort() { return m_ushort; }
-int            cppyy_test_data::get_int()    { return m_int; }
-unsigned int   cppyy_test_data::get_uint()   { return m_uint; }
-long           cppyy_test_data::get_long()   { return m_long; }
-unsigned long  cppyy_test_data::get_ulong()  { return m_ulong; }
-long long      cppyy_test_data::get_llong()  { return m_llong; }
-unsigned long long cppyy_test_data::get_ullong()  { return m_ullong; }
-float          cppyy_test_data::get_float()  { return m_float; }
-double         cppyy_test_data::get_double() { return m_double; }
-cppyy_test_data::what cppyy_test_data::get_enum() { return m_enum; }
-void*          cppyy_test_data::get_voidp()  { return m_voidp; }
+bool                 CppyyTestData::get_bool()    { return m_bool; }
+char                 CppyyTestData::get_char()    { return m_char; }
+signed char          CppyyTestData::get_schar()   { return m_schar; }
+unsigned char        CppyyTestData::get_uchar()   { return m_uchar; }
+short                CppyyTestData::get_short()   { return m_short; }
+unsigned short       CppyyTestData::get_ushort()  { return m_ushort; }
+int                  CppyyTestData::get_int()     { return m_int; }
+unsigned int         CppyyTestData::get_uint()    { return m_uint; }
+long                 CppyyTestData::get_long()    { return m_long; }
+unsigned long        CppyyTestData::get_ulong()   { return m_ulong; }
+long long            CppyyTestData::get_llong()   { return m_llong; }
+unsigned long long   CppyyTestData::get_ullong()  { return m_ullong; }
+float                CppyyTestData::get_float()   { return m_float; }
+double               CppyyTestData::get_double()  { return m_double; }
+long double          CppyyTestData::get_ldouble() { return m_ldouble; }
+CppyyTestData::EWhat CppyyTestData::get_enum()    { return m_enum; }
+void*                CppyyTestData::get_voidp()   { return m_voidp; }
 
-bool*           cppyy_test_data::get_bool_array()    { return m_bool_array; }
-bool*           cppyy_test_data::get_bool_array2()   { return m_bool_array2; }
-short*          cppyy_test_data::get_short_array()   { return m_short_array; }
-short*          cppyy_test_data::get_short_array2()  { return m_short_array2; }
-unsigned short* cppyy_test_data::get_ushort_array()  { return m_ushort_array; }
-unsigned short* cppyy_test_data::get_ushort_array2() { return m_ushort_array2; }
-int*            cppyy_test_data::get_int_array()     { return m_int_array; }
-int*            cppyy_test_data::get_int_array2()    { return m_int_array2; }
-unsigned int*   cppyy_test_data::get_uint_array()    { return m_uint_array; }
-unsigned int*   cppyy_test_data::get_uint_array2()   { return m_uint_array2; }
-long*           cppyy_test_data::get_long_array()    { return m_long_array; }
-long*           cppyy_test_data::get_long_array2()   { return m_long_array2; }
-unsigned long*  cppyy_test_data::get_ulong_array()   { return m_ulong_array; }
-unsigned long*  cppyy_test_data::get_ulong_array2()  { return m_ulong_array2; }
+bool*           CppyyTestData::get_bool_array()    { return m_bool_array; }
+bool*           CppyyTestData::get_bool_array2()   { return m_bool_array2; }
+short*          CppyyTestData::get_short_array()   { return m_short_array; }
+short*          CppyyTestData::get_short_array2()  { return m_short_array2; }
+unsigned short* CppyyTestData::get_ushort_array()  { return m_ushort_array; }
+unsigned short* CppyyTestData::get_ushort_array2() { return m_ushort_array2; }
+int*            CppyyTestData::get_int_array()     { return m_int_array; }
+int*            CppyyTestData::get_int_array2()    { return m_int_array2; }
+unsigned int*   CppyyTestData::get_uint_array()    { return m_uint_array; }
+unsigned int*   CppyyTestData::get_uint_array2()   { return m_uint_array2; }
+long*           CppyyTestData::get_long_array()    { return m_long_array; }
+long*           CppyyTestData::get_long_array2()   { return m_long_array2; }
+unsigned long*  CppyyTestData::get_ulong_array()   { return m_ulong_array; }
+unsigned long*  CppyyTestData::get_ulong_array2()  { return m_ulong_array2; }
 
-float*  cppyy_test_data::get_float_array()   { return m_float_array; }
-float*  cppyy_test_data::get_float_array2()  { return m_float_array2; }
-double* cppyy_test_data::get_double_array()  { return m_double_array; }
-double* cppyy_test_data::get_double_array2() { return m_double_array2; }
+float*  CppyyTestData::get_float_array()   { return m_float_array; }
+float*  CppyyTestData::get_float_array2()  { return m_float_array2; }
+double* CppyyTestData::get_double_array()  { return m_double_array; }
+double* CppyyTestData::get_double_array2() { return m_double_array2; }
 
-cppyy_test_pod cppyy_test_data::get_pod_val() { return m_pod; }
-cppyy_test_pod* cppyy_test_data::get_pod_val_ptr() { return &m_pod; }
-cppyy_test_pod& cppyy_test_data::get_pod_val_ref() { return m_pod; }
-cppyy_test_pod*& cppyy_test_data::get_pod_ptrref() { return m_ppod; }
+CppyyTestPod   CppyyTestData::get_pod_val()     { return m_pod; }
+CppyyTestPod*  CppyyTestData::get_pod_val_ptr() { return &m_pod; }
+CppyyTestPod&  CppyyTestData::get_pod_val_ref() { return m_pod; }
+CppyyTestPod*& CppyyTestData::get_pod_ptrref()  { return m_ppod; }
 
-cppyy_test_pod* cppyy_test_data::get_pod_ptr() { return m_ppod; }
+CppyyTestPod* CppyyTestData::get_pod_ptr() { return m_ppod; }
+
+//- getters const-ref -------------------------------------------------------
+const bool&                 CppyyTestData::get_bool_cr()    { return m_bool; }
+const char&                 CppyyTestData::get_char_cr()    { return m_char; }
+const signed char&          CppyyTestData::get_schar_cr()   { return m_schar; }
+const unsigned char&        CppyyTestData::get_uchar_cr()   { return m_uchar; }
+const short&                CppyyTestData::get_short_cr()   { return m_short; }
+const unsigned short&       CppyyTestData::get_ushort_cr()  { return m_ushort; }
+const int&                  CppyyTestData::get_int_cr()     { return m_int; }
+const unsigned int&         CppyyTestData::get_uint_cr()    { return m_uint; }
+const long&                 CppyyTestData::get_long_cr()    { return m_long; }
+const unsigned long&        CppyyTestData::get_ulong_cr()   { return m_ulong; }
+const long long&            CppyyTestData::get_llong_cr()   { return m_llong; }
+const unsigned long long&   CppyyTestData::get_ullong_cr()  { return m_ullong; }
+const float&                CppyyTestData::get_float_cr()   { return m_float; }
+const double&               CppyyTestData::get_double_cr()  { return m_double; }
+const long double&          CppyyTestData::get_ldouble_cr() { return m_ldouble; }
+const CppyyTestData::EWhat& CppyyTestData::get_enum_cr()    { return m_enum; }
 
 //- setters -----------------------------------------------------------------
-void cppyy_test_data::set_bool(bool b)                       { m_bool   = b; }
-void cppyy_test_data::set_char(char c)                       { m_char   = c; }
-void cppyy_test_data::set_uchar(unsigned char uc)            { m_uchar  = uc; }
-void cppyy_test_data::set_short(short s)                     { m_short  = s; }
-void cppyy_test_data::set_short_c(const short& s)            { m_short  = s; }
-void cppyy_test_data::set_ushort(unsigned short us)          { m_ushort = us; }
-void cppyy_test_data::set_ushort_c(const unsigned short& us) { m_ushort = us; }
-void cppyy_test_data::set_int(int i)                         { m_int    = i; }
-void cppyy_test_data::set_int_c(const int& i)                { m_int    = i; }
-void cppyy_test_data::set_uint(unsigned int ui)              { m_uint   = ui; }
-void cppyy_test_data::set_uint_c(const unsigned int& ui)     { m_uint   = ui; }
-void cppyy_test_data::set_long(long l)                       { m_long   = l; }
-void cppyy_test_data::set_long_c(const long& l)              { m_long   = l; }
-void cppyy_test_data::set_ulong(unsigned long ul)            { m_ulong  = ul; }
-void cppyy_test_data::set_ulong_c(const unsigned long& ul)   { m_ulong  = ul; }
-void cppyy_test_data::set_llong(long long ll)                { m_llong  = ll; }
-void cppyy_test_data::set_llong_c(const long long& ll)       { m_llong  = ll; }
-void cppyy_test_data::set_ullong(unsigned long long ull)     { m_ullong  = ull; }
-void cppyy_test_data::set_ullong_c(const unsigned long long& ull) { m_ullong  = ull; }
-void cppyy_test_data::set_float(float f)                     { m_float  = f; }
-void cppyy_test_data::set_float_c(const float& f)            { m_float  = f; }
-void cppyy_test_data::set_double(double d)                   { m_double = d; }
-void cppyy_test_data::set_double_c(const double& d)          { m_double = d; }
-void cppyy_test_data::set_enum(what w)                       { m_enum   = w; }
-void cppyy_test_data::set_voidp(void* p)                     { m_voidp  = p; }
+void CppyyTestData::set_bool(bool b)                       { m_bool    = b; }
+void CppyyTestData::set_char(char c)                       { m_char    = c; }
+void CppyyTestData::set_schar(signed char sc)              { m_schar   = sc; }
+void CppyyTestData::set_uchar(unsigned char uc)            { m_uchar   = uc; }
+void CppyyTestData::set_short(short s)                     { m_short   = s; }
+void CppyyTestData::set_ushort(unsigned short us)          { m_ushort  = us; }
+void CppyyTestData::set_int(int i)                         { m_int     = i; }
+void CppyyTestData::set_uint(unsigned int ui)              { m_uint    = ui; }
+void CppyyTestData::set_long(long l)                       { m_long    = l; }
+void CppyyTestData::set_ulong(unsigned long ul)            { m_ulong   = ul; }
+void CppyyTestData::set_llong(long long ll)                { m_llong   = ll; }
+void CppyyTestData::set_ullong(unsigned long long ull)     { m_ullong  = ull; }
+void CppyyTestData::set_float(float f)                     { m_float   = f; }
+void CppyyTestData::set_double(double d)                   { m_double  = d; }
+void CppyyTestData::set_ldouble(long double ld)            { m_ldouble = ld; }
+void CppyyTestData::set_enum(EWhat w)                      { m_enum    = w; }
+void CppyyTestData::set_voidp(void* p)                     { m_voidp   = p; }
 
-void cppyy_test_data::set_pod_val(cppyy_test_pod p)            { m_pod = p; }
-void cppyy_test_data::set_pod_ptr_in(cppyy_test_pod* pp)       { m_pod = *pp; }
-void cppyy_test_data::set_pod_ptr_out(cppyy_test_pod* pp)      { *pp = m_pod; }
-void cppyy_test_data::set_pod_ref(const cppyy_test_pod& rp)    { m_pod = rp; }
-void cppyy_test_data::set_pod_ptrptr_in(cppyy_test_pod** ppp)  { m_pod = **ppp; }
-void cppyy_test_data::set_pod_void_ptrptr_in(void** pp)        { m_pod = **((cppyy_test_pod**)pp); }
-void cppyy_test_data::set_pod_ptrptr_out(cppyy_test_pod** ppp) { delete *ppp; *ppp = new cppyy_test_pod(m_pod); }
-void cppyy_test_data::set_pod_void_ptrptr_out(void** pp)       { delete *((cppyy_test_pod**)pp);
-                                                                 *((cppyy_test_pod**)pp) = new cppyy_test_pod(m_pod); }
+void CppyyTestData::set_pod_val(CppyyTestPod p)            { m_pod = p; }
+void CppyyTestData::set_pod_ptr_in(CppyyTestPod* pp)       { m_pod = *pp; }
+void CppyyTestData::set_pod_ptr_out(CppyyTestPod* pp)      { *pp = m_pod; }
+void CppyyTestData::set_pod_ref(const CppyyTestPod& rp)    { m_pod = rp; }
+void CppyyTestData::set_pod_ptrptr_in(CppyyTestPod** ppp)  { m_pod = **ppp; }
+void CppyyTestData::set_pod_void_ptrptr_in(void** pp)        { m_pod = **((CppyyTestPod**)pp); }
+void CppyyTestData::set_pod_ptrptr_out(CppyyTestPod** ppp) { delete *ppp; *ppp = new CppyyTestPod(m_pod); }
+void CppyyTestData::set_pod_void_ptrptr_out(void** pp)       { delete *((CppyyTestPod**)pp);
+                                                                 *((CppyyTestPod**)pp) = new CppyyTestPod(m_pod); }
 
-void cppyy_test_data::set_pod_ptr(cppyy_test_pod* pp)          { m_ppod = pp; }
+void CppyyTestData::set_pod_ptr(CppyyTestPod* pp)          { m_ppod = pp; }
+
+//- setters const-ref -------------------------------------------------------
+void CppyyTestData::set_bool_cr(const bool& b)                   { m_bool    = b; }
+void CppyyTestData::set_char_cr(const char& c)                   { m_char    = c; }
+void CppyyTestData::set_schar_cr(const signed char& sc)          { m_schar   = sc; }
+void CppyyTestData::set_uchar_cr(const unsigned char& uc)        { m_uchar   = uc; }
+void CppyyTestData::set_short_cr(const short& s)                 { m_short   = s; }
+void CppyyTestData::set_ushort_cr(const unsigned short& us)      { m_ushort  = us; }
+void CppyyTestData::set_int_cr(const int& i)                     { m_int     = i; }
+void CppyyTestData::set_uint_cr(const unsigned int& ui)          { m_uint    = ui; }
+void CppyyTestData::set_long_cr(const long& l)                   { m_long    = l; }
+void CppyyTestData::set_ulong_cr(const unsigned long& ul)        { m_ulong   = ul; }
+void CppyyTestData::set_llong_cr(const long long& ll)            { m_llong   = ll; }
+void CppyyTestData::set_ullong_cr(const unsigned long long& ull) { m_ullong  = ull; }
+void CppyyTestData::set_float_cr(const float& f)                 { m_float   = f; }
+void CppyyTestData::set_double_cr(const double& d)               { m_double  = d; }
+void CppyyTestData::set_ldouble_cr(const long double& ld)        { m_ldouble = ld; }
+void CppyyTestData::set_enum_cr(const EWhat& w)                  { m_enum    = w; }
 
 //- passers -----------------------------------------------------------------
-short*          cppyy_test_data::pass_array(short* a)          { return a; }
-unsigned short* cppyy_test_data::pass_array(unsigned short* a) { return a; }
-int*            cppyy_test_data::pass_array(int* a)            { return a; }
-unsigned int*   cppyy_test_data::pass_array(unsigned int* a)   { return a; }
-long*           cppyy_test_data::pass_array(long* a)           { return a; }
-unsigned long*  cppyy_test_data::pass_array(unsigned long* a)  { return a; }
-float*          cppyy_test_data::pass_array(float* a)          { return a; }
-double*         cppyy_test_data::pass_array(double* a)         { return a; }
+short*          CppyyTestData::pass_array(short* a)          { return a; }
+unsigned short* CppyyTestData::pass_array(unsigned short* a) { return a; }
+int*            CppyyTestData::pass_array(int* a)            { return a; }
+unsigned int*   CppyyTestData::pass_array(unsigned int* a)   { return a; }
+long*           CppyyTestData::pass_array(long* a)           { return a; }
+unsigned long*  CppyyTestData::pass_array(unsigned long* a)  { return a; }
+float*          CppyyTestData::pass_array(float* a)          { return a; }
+double*         CppyyTestData::pass_array(double* a)         { return a; }
 
-char                cppyy_test_data::s_char   = 's';
-unsigned char       cppyy_test_data::s_uchar  = 'u';
-short               cppyy_test_data::s_short  = -101;
-unsigned short      cppyy_test_data::s_ushort =  255u;
-int                 cppyy_test_data::s_int    = -202;
-unsigned int        cppyy_test_data::s_uint   =  202u;
-long                cppyy_test_data::s_long   = -303l;
-unsigned long       cppyy_test_data::s_ulong  =  303ul;
-long long           cppyy_test_data::s_llong  = -404ll;
-unsigned long long  cppyy_test_data::s_ullong =  505ull;
-float               cppyy_test_data::s_float  = -606.f;
-double              cppyy_test_data::s_double = -707.;
-cppyy_test_data::what  cppyy_test_data::s_enum = cppyy_test_data::kNothing;
-void*               cppyy_test_data::s_voidp  = (void*)0;
+bool                 CppyyTestData::s_bool    = false;
+char                 CppyyTestData::s_char    = 'c';
+signed char          CppyyTestData::s_schar   = 's';
+unsigned char        CppyyTestData::s_uchar   = 'u';
+short                CppyyTestData::s_short   = -101;
+unsigned short       CppyyTestData::s_ushort  =  255u;
+int                  CppyyTestData::s_int     = -202;
+unsigned int         CppyyTestData::s_uint    =  202u;
+long                 CppyyTestData::s_long    = -303l;
+unsigned long        CppyyTestData::s_ulong   =  303ul;
+long long            CppyyTestData::s_llong   = -404ll;
+unsigned long long   CppyyTestData::s_ullong  =  404ull;
+float                CppyyTestData::s_float   = -606.f;
+double               CppyyTestData::s_double  = -707.;
+long double          CppyyTestData::s_ldouble = -808.l;
+CppyyTestData::EWhat CppyyTestData::s_enum    = CppyyTestData::kNothing;
+void*                CppyyTestData::s_voidp   = (void*)0;
 
 //- strings -----------------------------------------------------------------
-const char* cppyy_test_data::get_valid_string(const char* in) { return in; }
-const char* cppyy_test_data::get_invalid_string() { return (const char*)0; }
+const char* CppyyTestData::get_valid_string(const char* in) { return in; }
+const char* CppyyTestData::get_invalid_string() { return (const char*)0; }
 
 
 //= global functions ========================================================
-long get_pod_address(cppyy_test_data& c)
+long get_pod_address(CppyyTestData& c)
 {
     return (long)&c.m_pod;
 }
 
-long get_int_address(cppyy_test_data& c)
+long get_int_address(CppyyTestData& c)
 {
     return (long)&c.m_pod.m_int;
 }
 
-long get_double_address(cppyy_test_data& c)
+long get_double_address(CppyyTestData& c)
 {
     return (long)&c.m_pod.m_double;
 }
 
+
 //= global variables/pointers ===============================================
 int g_int = 42;
 
    return g_int;
 }
 
-cppyy_test_pod* g_pod = (cppyy_test_pod*)0;
+CppyyTestPod* g_pod = (CppyyTestPod*)0;
 
-bool is_global_pod(cppyy_test_pod* t) {
+bool is_global_pod(CppyyTestPod* t) {
    return t == g_pod;
 }
 
-void set_global_pod(cppyy_test_pod* t) {
+void set_global_pod(CppyyTestPod* t) {
    g_pod = t;
 }
 
-cppyy_test_pod* get_global_pod() {
+CppyyTestPod* get_global_pod() {
    return g_pod;
 }
 
-cppyy_test_pod* get_null_pod() {
-   return (cppyy_test_pod*)0;
+CppyyTestPod* get_null_pod() {
+   return (CppyyTestPod*)0;
 }

File pypy/module/cppyy/test/datatypes.h

View file
 
 
 //===========================================================================
-struct cppyy_test_pod {
+struct CppyyTestPod {
    int    m_int;
    double m_double;
 };
 
 
 //===========================================================================
-enum fruit { kApple=78, kBanana=29, kCitrus=34 };
+enum EFruit { kApple=78, kBanana=29, kCitrus=34 };
 
 
 //===========================================================================
-class four_vector {
+class FourVector {
 public:
-    four_vector(double x, double y, double z, double t) :
+    FourVector(double x, double y, double z, double t) :
         m_cc_called(false), m_x(x), m_y(y), m_z(z), m_t(t) {}
-    four_vector(const four_vector& s) :
+    FourVector(const FourVector& s) :
         m_cc_called(true), m_x(s.m_x), m_y(s.m_y), m_z(s.m_z), m_t(s.m_t) {}
 
     double operator[](int i) {
        return -1;
     }
 
-    bool operator==(const four_vector& o) {
+    bool operator==(const FourVector& o) {
        return (m_x == o.m_x && m_y == o.m_y &&
                m_z == o.m_z && m_t == o.m_t);
     }
 
 
 //===========================================================================
-class cppyy_test_data {
+class CppyyTestData {
 public:
-    cppyy_test_data();
-    ~cppyy_test_data();
+    CppyyTestData();
+    ~CppyyTestData();
 
 // special cases
-    enum what { kNothing=6, kSomething=111, kLots=42 };
+    enum EWhat { kNothing=6, kSomething=111, kLots=42 };
 
 // helper
     void destroy_arrays();
 // getters
     bool                 get_bool();
     char                 get_char();
+    signed char          get_schar();
     unsigned char        get_uchar();
     short                get_short();
     unsigned short       get_ushort();
     unsigned long long   get_ullong();
     float                get_float();
     double               get_double();
-    what                 get_enum();
+    long double          get_ldouble();
+    EWhat                get_enum();
     void*                get_voidp();
 
     bool*           get_bool_array();
     double* get_double_array();
     double* get_double_array2();
 
-    cppyy_test_pod get_pod_val();                 // for m_pod
-    cppyy_test_pod* get_pod_val_ptr();
-    cppyy_test_pod& get_pod_val_ref();
-    cppyy_test_pod*& get_pod_ptrref();
+    CppyyTestPod get_pod_val();                 // for m_pod
+    CppyyTestPod* get_pod_val_ptr();
+    CppyyTestPod& get_pod_val_ref();
+    CppyyTestPod*& get_pod_ptrref();
 
-    cppyy_test_pod* get_pod_ptr();                // for m_ppod
+    CppyyTestPod* get_pod_ptr();                // for m_ppod
+
+// getters const-ref
+    const bool&               get_bool_cr();
+    const char&               get_char_cr();
+    const signed char&        get_schar_cr();
+    const unsigned char&      get_uchar_cr();
+    const short&              get_short_cr();
+    const unsigned short&     get_ushort_cr();
+    const int&                get_int_cr();
+    const unsigned int&       get_uint_cr();
+    const long&               get_long_cr();
+    const unsigned long&      get_ulong_cr();
+    const long long&          get_llong_cr();
+    const unsigned long long& get_ullong_cr();
+    const float&              get_float_cr();
+    const double&             get_double_cr();
+    const long double&        get_ldouble_cr();
+    const EWhat&              get_enum_cr();
 
 // setters
-    void set_bool(bool b);
-    void set_char(char c);
-    void set_uchar(unsigned char uc);
-    void set_short(short s);
-    void set_short_c(const short& s);
-    void set_ushort(unsigned short us);
-    void set_ushort_c(const unsigned short& us);
-    void set_int(int i);
-    void set_int_c(const int& i);
-    void set_uint(unsigned int ui);
-    void set_uint_c(const unsigned int& ui);
-    void set_long(long l);
-    void set_long_c(const long& l);
-    void set_llong(long long ll);
-    void set_llong_c(const long long& ll);
-    void set_ulong(unsigned long ul);
-    void set_ulong_c(const unsigned long& ul);
-    void set_ullong(unsigned long long ll);
-    void set_ullong_c(const unsigned long long& ll);
-    void set_float(float f);
-    void set_float_c(const float& f);
-    void set_double(double d);
-    void set_double_c(const double& d);
-    void set_enum(what w);
-    void set_voidp(void* p);
+    void set_bool(bool);
+    void set_char(char);
+    void set_schar(signed char);
+    void set_uchar(unsigned char);
+    void set_short(short);
+    void set_ushort(unsigned short);
+    void set_int(int);
+    void set_uint(unsigned int);
+    void set_long(long);
+    void set_ulong(unsigned long);
+    void set_llong(long long);
+    void set_ullong(unsigned long long);
+    void set_float(float);
+    void set_double(double);
+    void set_ldouble(long double);
+    void set_enum(EWhat);
+    void set_voidp(void*);
 
-    void set_pod_val(cppyy_test_pod);             // for m_pod
-    void set_pod_ptr_in(cppyy_test_pod*);
-    void set_pod_ptr_out(cppyy_test_pod*);
-    void set_pod_ref(const cppyy_test_pod&);
-    void set_pod_ptrptr_in(cppyy_test_pod**);
+    void set_pod_val(CppyyTestPod);             // for m_pod
+    void set_pod_ptr_in(CppyyTestPod*);
+    void set_pod_ptr_out(CppyyTestPod*);
+    void set_pod_ref(const CppyyTestPod&);
+    void set_pod_ptrptr_in(CppyyTestPod**);
     void set_pod_void_ptrptr_in(void**);
-    void set_pod_ptrptr_out(cppyy_test_pod**);
+    void set_pod_ptrptr_out(CppyyTestPod**);
     void set_pod_void_ptrptr_out(void**);
 
-    void set_pod_ptr(cppyy_test_pod*);            // for m_ppod
+    void set_pod_ptr(CppyyTestPod*);            // for m_ppod
+
+// setters const-ref
+    void set_bool_cr(const bool&);
+    void set_char_cr(const char&);
+    void set_schar_cr(const signed char&);
+    void set_uchar_cr(const unsigned char&);
+    void set_short_cr(const short&);
+    void set_ushort_cr(const unsigned short&);
+    void set_int_cr(const int&);
+    void set_uint_cr(const unsigned int&);
+    void set_long_cr(const long&);
+    void set_ulong_cr(const unsigned long&);
+    void set_llong_cr(const long long&);
+    void set_ullong_cr(const unsigned long long&);
+    void set_float_cr(const float&);
+    void set_double_cr(const double&);
+    void set_ldouble_cr(const long double&);
+    void set_enum_cr(const EWhat&);
 
 // passers
     short*          pass_array(short*);
 // basic types
     bool                 m_bool;
     char                 m_char;
+    signed char          m_schar;
     unsigned char        m_uchar;
     short                m_short;
     unsigned short       m_ushort;
     unsigned long long   m_ullong;
     float                m_float;
     double               m_double;
-    what                 m_enum;
+    long double          m_ldouble;
+    EWhat                m_enum;
     void*                m_voidp;
 
 // array types
     double* m_double_array2;
 
 // object types
-    cppyy_test_pod m_pod;
-    cppyy_test_pod* m_ppod;
+    CppyyTestPod m_pod;
+    CppyyTestPod* m_ppod;
 
 public:
+    static bool                    s_bool;
     static char                    s_char;
+    static signed char             s_schar;
     static unsigned char           s_uchar;
     static short                   s_short;
     static unsigned short          s_ushort;
     static unsigned long long      s_ullong;
     static float                   s_float;
     static double                  s_double;
-    static what                    s_enum;
+    static long double             s_ldouble;
+    static EWhat                   s_enum;
     static void*                   s_voidp;
 
 private:
 
 
 //= global functions ========================================================
-long get_pod_address(cppyy_test_data& c);
-long get_int_address(cppyy_test_data& c);
-long get_double_address(cppyy_test_data& c);
+long get_pod_address(CppyyTestData& c);
+long get_int_address(CppyyTestData& c);
+long get_double_address(CppyyTestData& c);
 
 
 //= global variables/pointers ===============================================
 void set_global_int(int i);
 int get_global_int();
 
-extern cppyy_test_pod* g_pod;
-bool is_global_pod(cppyy_test_pod* t);
-void set_global_pod(cppyy_test_pod* t);
-cppyy_test_pod* get_global_pod();
-cppyy_test_pod* get_null_pod();
+extern CppyyTestPod* g_pod;
+bool is_global_pod(CppyyTestPod* t);
+void set_global_pod(CppyyTestPod* t);
+CppyyTestPod* get_global_pod();
+CppyyTestPod* get_null_pod();

File pypy/module/cppyy/test/datatypes.xml

View file
 <lcgdict>
 
-  <class pattern="cppyy_test_*" />
-  <class name="four_vector" />
+  <class pattern="CppyyTest*" />
+  <enum name="CppyyTestData::EWhat" />
+  <class name="FourVector" />
 
-  <enum name="fruit" />
+  <enum name="EFruit" />
 
   <function pattern="get_*" />
   <function pattern="set_*" />

File pypy/module/cppyy/test/datatypes_LinkDef.h

View file
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ struct cppyy_test_pod;
-#pragma link C++ class cppyy_test_data;
-#pragma link C++ class four_vector;
+#pragma link C++ struct CppyyTestPod;
+#pragma link C++ class CppyyTestData;
+#pragma link C++ class FourVector;
 
-#pragma link C++ enum fruit;
+#pragma link C++ enum EFruit;
 
-#pragma link C++ function get_pod_address(cppyy_test_data&);
-#pragma link C++ function get_int_address(cppyy_test_data&);
-#pragma link C++ function get_double_address(cppyy_test_data&);
+#pragma link C++ function get_pod_address(CppyyTestData&);
+#pragma link C++ function get_int_address(CppyyTestData&);
+#pragma link C++ function get_double_address(CppyyTestData&);
 #pragma link C++ function set_global_int(int);
 #pragma link C++ function get_global_int();
 
-#pragma link C++ function is_global_pod(cppyy_test_pod*);
-#pragma link C++ function set_global_pod(cppyy_test_pod*);
+#pragma link C++ function is_global_pod(CppyyTestPod*);
+#pragma link C++ function set_global_pod(CppyyTestPod*);
 #pragma link C++ function get_global_pod();
 #pragma link C++ function get_null_pod();
 

File pypy/module/cppyy/test/test_datatypes.py

View file
             return cppyy.load_reflection_info(%r)""" % (test_dct, ))
 
     def test01_load_reflection_cache(self):
-        """Test whether loading a refl. info twice results in the same object."""
+        """Loading reflection info twice should result in the same object"""
         import cppyy
         lib2 = cppyy.load_reflection_info(self.test_dct)
         assert self.datatypes is lib2
 
     def test02_instance_data_read_access(self):
-        """Test read access to instance public data and verify values"""
+        """Read access to instance public data and verify values"""
 
         import cppyy
-        cppyy_test_data = cppyy.gbl.cppyy_test_data
+        CppyyTestData = cppyy.gbl.CppyyTestData
 
-        c = cppyy_test_data()
-        assert isinstance(c, cppyy_test_data)
+        c = CppyyTestData()
+        assert isinstance(c, CppyyTestData)
 
         # reading boolean type
         assert c.m_bool == False
 
         # reading char types
         assert c.m_char  == 'a'
+        assert c.m_schar == 'b'
         assert c.m_uchar == 'c'
 
         # reading integer types
-        assert c.m_short  == -11
-        assert c.m_ushort ==  11
-        assert c.m_int    == -22
-        assert c.m_uint   ==  22
-        assert c.m_long   == -33
-        assert c.m_ulong  ==  33
-        assert c.m_llong  == -44
-        assert c.m_ullong ==  55
+        assert c.m_short   == -11; assert c.get_short_cr()   == -11
+        assert c.m_ushort  ==  11; assert c.get_ushort_cr()  ==  11
+        assert c.m_int     == -22; assert c.get_int_cr()     == -22
+        assert c.m_uint    ==  22; assert c.get_uint_cr()    ==  22
+        assert c.m_long    == -33; assert c.get_long_cr()    == -33
+        assert c.m_ulong   ==  33; assert c.get_ulong_cr()   ==  33
+        assert c.m_llong   == -44; assert c.get_llong_cr()   == -44
+        assert c.m_ullong  ==  44; assert c.get_ullong_cr()  ==  44
 
         # reading floating point types
-        assert round(c.m_float  + 66., 5) == 0
-        assert round(c.m_double + 77., 8) == 0
+        assert round(c.m_float          + 66.,  5) == 0
+        assert round(c.get_float_cr()   + 66.,  5) == 0
+        assert round(c.m_double         + 77., 11) == 0
+        assert round(c.get_double_cr()  + 77., 11) == 0
+        assert round(c.m_ldouble        + 88., 24) == 0
+        assert round(c.get_ldouble_cr() + 88., 24) == 0
 
-        # reding of array types
+        # reading of enum types