Rename all C++0x to C++11 and cpp0x to cpp11

This commit is contained in:
William S Fulton 2013-10-07 20:37:00 +01:00
commit 738cc36aab
16 changed files with 309 additions and 309 deletions

View file

@ -1,12 +0,0 @@
import cpp0x_function_objects
import sys
t = cpp0x_function_objects.Test()
if t.value != 0:
raise RuntimeError("Runtime cpp0x_function_objects failed. t.value should be 0, but is " + str(t.value))
t(1,2) # adds numbers and sets value
if t.value != 3:
raise RuntimeError("Runtime cpp0x_function_objects failed. t.value not changed - should be 3, but is " + str(t.value))

View file

@ -1,4 +0,0 @@
import cpp0x_initializer_list_extend
c = cpp0x_initializer_list_extend.Container( [10, 20, 30, 40] )

View file

@ -1,5 +0,0 @@
import cpp0x_initializer_list
a = cpp0x_initializer_list.A()
a = cpp0x_initializer_list.A(11.1)

View file

@ -1,15 +0,0 @@
import cpp0x_null_pointer_constant
a = cpp0x_null_pointer_constant.A()
if a._myA != None:
raise RuntimeError, ("cpp0x_null_pointer_constant: _myA should be None, but is ", a._myA)
b = cpp0x_null_pointer_constant.A()
if a._myA != b._myA:
raise RuntimeError, ("cpp0x_null_pointer_constant: a._myA should be the same as b._myA, but ", a._myA, "!=", b._myA)
a._myA = cpp0x_null_pointer_constant.A()
if a._myA == None:
raise RuntimeError, ("cpp0x_null_pointer_constant: _myA should be object, but is None")

View file

@ -1,3 +0,0 @@
import cpp0x_result_of
if cpp0x_result_of.test_result(cpp0x_result_of.square, 3.0) != 9.0:
raise RuntimeError, "test_result(square, 3.0) is not 9.0."

View file

@ -0,0 +1,13 @@
import cpp11_alternate_function_syntax
a = cpp11_alternate_function_syntax.SomeStruct()
res = a.addNormal(4,5)
if res != 9:
raise RuntimeError, ("SomeStruct::addNormal(4,5) returns ", res, " should be 9.")
res = a.addAlternate(4,5)
if res != 9:
raise RuntimeError, ("SomeStruct::addAlternate(4,5) returns ", res, " should be 9.")

View file

@ -0,0 +1,19 @@
import cpp11_decltype
a = cpp11_decltype.A()
a.i = 5
if a.i != 5:
raise RuntimeError, "Assignment to a.i failed."
a.j = 10
if a.j != 10:
raise RuntimeError, "Assignment to a.j failed."
b = a.foo(5)
if b != 10:
raise RuntimeError, "foo(5) should return 10."
b = a.foo(6)
if b != 0:
raise RuntimeError, "foo(6) should return 0."

View file

@ -0,0 +1,12 @@
import cpp11_function_objects
import sys
t = cpp11_function_objects.Test()
if t.value != 0:
raise RuntimeError("Runtime cpp11_function_objects failed. t.value should be 0, but is " + str(t.value))
t(1,2) # adds numbers and sets value
if t.value != 3:
raise RuntimeError("Runtime cpp11_function_objects failed. t.value not changed - should be 3, but is " + str(t.value))

View file

@ -0,0 +1,4 @@
import cpp11_initializer_list_extend
c = cpp11_initializer_list_extend.Container( [10, 20, 30, 40] )

View file

@ -0,0 +1,5 @@
import cpp11_initializer_list
a = cpp11_initializer_list.A()
a = cpp11_initializer_list.A(11.1)

View file

@ -0,0 +1,15 @@
import cpp11_null_pointer_constant
a = cpp11_null_pointer_constant.A()
if a._myA != None:
raise RuntimeError, ("cpp11_null_pointer_constant: _myA should be None, but is ", a._myA)
b = cpp11_null_pointer_constant.A()
if a._myA != b._myA:
raise RuntimeError, ("cpp11_null_pointer_constant: a._myA should be the same as b._myA, but ", a._myA, "!=", b._myA)
a._myA = cpp11_null_pointer_constant.A()
if a._myA == None:
raise RuntimeError, ("cpp11_null_pointer_constant: _myA should be object, but is None")

View file

@ -0,0 +1,50 @@
from cpp11_raw_string_literals import *
if cvar.L != 100:
raise RuntimeError
if cvar.u8 != 100:
raise RuntimeError
if cvar.u != 100:
raise RuntimeError
if UStruct.U != 100:
raise RuntimeError
if cvar.R != 100:
raise RuntimeError
if cvar.LR != 100:
raise RuntimeError
if cvar.u8R != 100:
raise RuntimeError
if cvar.uR != 100:
raise RuntimeError
if URStruct.UR != 100:
raise RuntimeError
if cvar.aa != "Wide string":
raise RuntimeError
if cvar.bb != "UTF-8 string":
raise RuntimeError, cvar.wide
if cvar.xx != ")I'm an \"ascii\" \\ string.":
raise RuntimeError, cvar.xx
if cvar.ee != ")I'm an \"ascii\" \\ string.":
raise RuntimeError, cvar.ee
if cvar.ff != "I'm a \"raw wide\" \\ string.":
raise RuntimeError, cvar.ff
if cvar.gg != "I'm a \"raw UTF-8\" \\ string.":
raise RuntimeError, cvar.gg

View file

@ -0,0 +1,3 @@
import cpp11_result_of
if cpp11_result_of.test_result(cpp11_result_of.square, 3.0) != 9.0:
raise RuntimeError, "test_result(square, 3.0) is not 9.0."

View file

@ -0,0 +1,24 @@
import cpp11_rvalue_reference
a = cpp11_rvalue_reference.A()
a.setAcopy(5)
if a.getAcopy() != 5:
raise RunTimeError, ("int A::getAcopy() value is ", a.getAcopy(), " should be 5")
ptr = a.getAptr()
a.setAptr(ptr)
if a.getAcopy() != 5:
raise RunTimeError, ("after A::setAptr(): int A::getAcopy() value is ", a.getAcopy(), " should be 5")
a.setAref(ptr)
if a.getAcopy() != 5:
raise RunTimeError, ("after A::setAref(): int A::getAcopy() value is ", a.getAcopy(), " should be 5")
rvalueref = a.getAmove()
a.setAmove(rvalueref)
if a.getAcopy() != 5:
raise RunTimeError, ("after A::setAmove(): int A::getAcopy() value is ", a.getAcopy(), " should be 5")

View file

@ -0,0 +1,38 @@
from cpp11_thread_local import *
t = ThreadLocals()
if t.stval != 11:
raise RuntimeError
if t.tsval != 22:
raise RuntimeError
if t.tscval99 != 99:
raise RuntimeError
cvar.etval = -11
if cvar.etval != -11:
raise RuntimeError
cvar.stval = -22
if cvar.stval != -22:
raise RuntimeError
cvar.tsval = -33
if cvar.tsval != -33:
raise RuntimeError
cvar.etval = -44
if cvar.etval != -44:
raise RuntimeError
cvar.teval = -55
if cvar.teval != -55:
raise RuntimeError
cvar.ectval = -66
if cvar.ectval != -66:
raise RuntimeError
cvar.ecpptval = -66
if cvar.ecpptval != -66:
raise RuntimeError

View file

@ -0,0 +1,21 @@
import cpp11_uniform_initialization
var1 = cpp11_uniform_initialization.cvar.var1
if var1.x != 5:
raise RuntimeError
var2 = cpp11_uniform_initialization.cvar.var2
if var2.getX() != 2:
raise RuntimeError
m = cpp11_uniform_initialization.MoreInit()
if m.charptr != None:
raise RuntimeError, m.charptr
m.charptr = "hello sir"
if m.charptr != "hello sir":
raise RuntimeError, m.charptr
if m.more1(m.vi) != 15:
raise RuntimeError, m.vi
if m.more1( [-1,1,2] ) != 2:
raise RuntimeError, m.vi
if m.more1() != 10:
raise RuntimeError