Merge branch 'master' into doxygen

Merge 3.0.12 release changes from master.
This commit is contained in:
Vadim Zeitlin 2017-02-01 02:21:35 +01:00
commit 294ab27b90
254 changed files with 4158 additions and 2457 deletions

View file

@ -0,0 +1,45 @@
from extend_template_method import *
em = ExtendMe()
ret_double = em.do_stuff_double(1, 1.1)
if ret_double != 1.1:
raise RuntimeError("double failed " + ret_double)
ret_string = em.do_stuff_string(1, "hello there")
if ret_string != "hello there":
raise RuntimeError("string failed " + ret_string)
ret_double = em.do_overloaded_stuff(1.1)
if ret_double != 1.1:
raise RuntimeError("double failed " + ret_double)
ret_string = em.do_overloaded_stuff("hello there")
if ret_string != "hello there":
raise RuntimeError("string failed " + ret_string)
if ExtendMe.static_method(123) != 123:
raise RuntimeError("static_method failed")
em2 = ExtendMe(123)
em = TemplateExtend()
ret_double = em.do_template_stuff_double(1, 1.1)
if ret_double != 1.1:
raise RuntimeError("double failed " + ret_double)
ret_string = em.do_template_stuff_string(1, "hello there")
if ret_string != "hello there":
raise RuntimeError("string failed " + ret_string)
ret_double = em.do_template_overloaded_stuff(1.1)
if ret_double != 1.1:
raise RuntimeError("double failed " + ret_double)
ret_string = em.do_template_overloaded_stuff("hello there")
if ret_string != "hello there":
raise RuntimeError("string failed " + ret_string)
if TemplateExtend.static_template_method(123) != 123:
raise RuntimeError("static_template_method failed")
em2 = TemplateExtend(123)

View file

@ -7,3 +7,16 @@ d[5] = d[0] + 3
if d[5] + d[0] != 17:
raise RuntimeError
shorts = shortArray(5)
sum = sum_array(shorts)
if sum != 0:
raise RuntimeError("incorrect zero sum, got: " + str(sum))
for i in range(5):
shorts[i] = i
sum = sum_array(shorts)
if sum != 0+1+2+3+4:
raise RuntimeError("incorrect sum, got: " + str(sum))

View file

@ -7,3 +7,16 @@ d[5] = d[0] + 3
if d[5] + d[0] != 17:
raise RuntimeError
shorts = shortArray(5)
sum = sum_array(shorts)
if sum != 0:
raise RuntimeError("incorrect zero sum, got: " + str(sum))
for i in range(5):
shorts[i] = i
sum = sum_array(shorts)
if sum != 0+1+2+3+4:
raise RuntimeError("incorrect sum, got: " + str(sum))

View file

@ -2,6 +2,10 @@ from li_cpointer_cpp import *
p = new_intp()
if intp_value(p) != 0:
raise RuntimeError("not initialized")
intp_assign(p, 3)
if intp_value(p) != 3:

View file

@ -2,6 +2,10 @@ from li_cpointer import *
p = new_intp()
if intp_value(p) != 0:
raise RuntimeError("not initialized")
intp_assign(p, 3)
if intp_value(p) != 3:

View file

@ -12,10 +12,14 @@ if is_python_builtin():
if h != h2:
raise RuntimeError("default tp_hash not working")
# Test 1 for tp_hash
# Test 1a for tp_hash
if hash(SimpleValue(222)) != 222:
raise RuntimeError("tp_hash not working")
# Test 1b for tp_hash
if hash(SimpleValue2(333)) != 333:
raise RuntimeError("tp_hash not working")
# Test 2 for tp_hash
try:
# Was incorrectly raising: SystemError: error return without exception set

View file

@ -0,0 +1,9 @@
import template_default_cache
ap = template_default_cache.get_mp_a();
bp = template_default_cache.get_mp_b();
if not isinstance(ap, template_default_cache.AModelPtr):
raise RuntimeError("get_mp_a fail")
if not isinstance(bp, template_default_cache.BModelPtr):
raise RuntimeError("get_mp_b fail")