Restore checks for globals in php testcases
This commit is contained in:
parent
50f92dca08
commit
8cb0c185ac
38 changed files with 99 additions and 58 deletions
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "arrayptr.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo'));
|
||||
// No new classes
|
||||
check::classes(array());
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
check::done();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ require "arrays_global.php";
|
|||
|
||||
check::functions(array('test_a','test_b','new_simplestruct','new_material'));
|
||||
check::classes(array('arrays_global','SimpleStruct','Material'));
|
||||
check::globals(array('array_c','array_sc','array_uc','array_s','array_us','array_i','array_ui','array_l','array_ul','array_ll','array_f','array_d','array_struct','array_structpointers','array_ipointers','array_enum','array_enumpointers','array_const_i','beginstring_fix44a','beginstring_fix44b','beginstring_fix44c','beginstring_fix44d','beginstring_fix44e','beginstring_fix44f','chitmat','hitmat_val','hitmat'));
|
||||
|
||||
// The size of array_c is 2, but the last byte is \0, so we can only store a
|
||||
// single byte string in it.
|
||||
check::set("array_c","Z");
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ require "arrays_global_twodim.php";
|
|||
|
||||
check::functions(array('fn_taking_arrays','get_2d_array','new_simplestruct','new_material'));
|
||||
check::classes(array('arrays_global_twodim','SimpleStruct','Material'));
|
||||
check::globals(array('array_c','array_sc','array_uc','array_s','array_us','array_i','array_ui','array_l','array_ul','array_ll','array_f','array_d','array_struct','array_structpointers','array_ipointers','array_enum','array_enumpointers','array_const_i','chitmat','hitmat_val','hitmat'));
|
||||
|
||||
$a1=array(10,11,12,13);
|
||||
$a2=array(14,15,16,17);
|
||||
$a=array($a1,$a2);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ require "arrays.php";
|
|||
|
||||
check::functions(array('fn_taking_arrays','newintpointer','setintfrompointer','getintfrompointer','array_pointer_func'));
|
||||
check::classes(array('arrays','SimpleStruct','ArrayStruct','CartPoseData_t'));
|
||||
check::globals(array());
|
||||
|
||||
$ss=new simplestruct();
|
||||
check::classname('simplestruct',$ss);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ require "arrays_scope.php";
|
|||
check::functions(array('new_bar','bar_blah'));
|
||||
// New classes
|
||||
check::classes(array('arrays_scope','Bar'));
|
||||
// No new globals
|
||||
check::globals(array());
|
||||
|
||||
$bar=new bar();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "casts.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('new_a','a_hello','new_b'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('A','B'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
# Make sure $b inherits hello() from class A
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ require "cpp_basic.php";
|
|||
check::functions(array('foo_func1','foo_func2','foo___str__','foosubsub___str__','bar_test','bar_testfoo','get_func1_ptr','get_func2_ptr','test_func_ptr','fl_window_show'));
|
||||
// New classes
|
||||
check::classes(array('cpp_basic','Foo','FooSub','FooSubSub','Bar','Fl_Window'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$f = new Foo(3);
|
||||
$f->func_ptr = get_func1_ptr();
|
||||
|
|
|
|||
|
|
@ -7,5 +7,7 @@ require "cpp_static.php";
|
|||
check::functions(array('staticfunctiontest_static_func','staticfunctiontest_static_func_2','staticfunctiontest_static_func_3','is_python_builtin','staticmembertest_grab_int','staticbase_grab_statty_base','staticderived_grab_statty_derived'));
|
||||
// New classes
|
||||
check::classes(array('StaticMemberTest','StaticFunctionTest','cpp_static','StaticBase','StaticDerived'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
check::done();
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_abstract.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_ping','foo_pong','example0_getxsize','example0_color','example0_get_color','example1_getxsize','example1_color','example1_get_color','example2_getxsize','example2_color','example2_get_color','example4_getxsize','example4_color','example4_get_color','example3_i_color','example3_i_get_color','g','a_f'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('director_abstract','Foo','Example0','Example1','Example2','Example4','Example3_i','A'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyFoo extends Foo {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ require "director_basic.php";
|
|||
|
||||
check::functions(array('foo_ping','foo_pong','foo_get_self','a_f','a_rg','a1_ff','myclass_method','myclass_vmethod','myclass_pmethod','myclass_cmethod','myclass_get_self','myclass_call_pmethod','myclasst_i_method','myclass_nonvirtual','myclass_nonoverride','myclass_call_nonvirtual','myclass_call_nonoverride','myclass_connect','constptrclass_getconstptr'));
|
||||
check::classes(array('Foo','A','A1','Bar','MyClass','MyClassT_i','ConstPtrClass'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class PhpFoo extends Foo {
|
||||
function ping() {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_classic.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('being_id','person_id','child_id','grandchild_id','caller_delcallback','caller_setcallback','caller_resetcallback','caller_call','caller_baseclass'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Being','Person','Child','GrandChild','OrphanPerson','OrphanChild','Caller'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class TargetLangPerson extends Person {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_default.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_msg','foo_getmsg','bar_msg','bar_getmsg','defaultsbase_defaultargs','defaultsderived_defaultargs'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Foo','Bar','DefaultsBase','DefaultsDerived'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$f = new Foo();
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_detect.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_cloner','foo_get_value','foo_get_class','foo_just_do_it','bar_baseclass','bar_cloner','bar_get_value','bar_get_class','bar_just_do_it'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('A','Foo','Bar'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyBar extends Bar {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_enum.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_say_hello','foo_say_hi','foo_say_bye','foo_say_hi_ref','foo_ping','foo_ping_ref','foo_ping_member_enum','a_f','a2_f'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('director_enum','Foo','A','B','A2','B2'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyFoo extends Foo {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@
|
|||
require "tests.php";
|
||||
require "director_exception.php";
|
||||
|
||||
// New functions
|
||||
check::functions(array('foo_ping','foo_pong','launder','bar_ping','bar_pong','returnalltypes_return_int','returnalltypes_return_double','returnalltypes_return_const_char_star','returnalltypes_return_std_string','returnalltypes_return_bar','returnalltypes_call_int','returnalltypes_call_double','returnalltypes_call_const_char_star','returnalltypes_call_std_string','returnalltypes_call_bar','is_python_builtin'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('director_exception','Foo','Exception1','Exception2','Base','Bar','ReturnAllTypes'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyException extends Exception {
|
||||
function __construct($a, $b) {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_extend.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('spobject_getfoobar','spobject_dummy','spobject_exceptionmethod'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('SpObject'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyObject extends SpObject{
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_finalizer.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_orstatus','deletefoo','getstatus','launder','resetstatus'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('director_finalizer','Foo'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyFoo extends Foo {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@
|
|||
require "tests.php";
|
||||
require "director_frob.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('alpha_abs_method','bravo_abs_method','charlie_abs_method','ops_opint','ops_opintstarstarconst','ops_opintamp','ops_opintstar','ops_opconstintintstar','prims_ull','prims_callull','corecallbacks_on3dengineredrawn','corecallbacks_on3dengineredrawn2'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Alpha','Bravo','Charlie','Delta','Ops','Prims','corePoint3d','coreCallbacks_On3dEngineRedrawnData','coreCallbacksOn3dEngineRedrawnData','coreCallbacks'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$foo = new Bravo();
|
||||
$s = $foo->abs_method();
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_nested.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_int_advance','foo_int_do_advance','bar_step','bar_do_advance','bar_do_step','foobar_int_get_value','foobar_int_get_name','foobar_int_name','foobar_int_get_self','foobar_int_do_advance','foobar_int_do_step'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Foo_int','Bar','FooBar_int'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class A extends FooBar_int {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_profile.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('b_fn','b_vfi','b_fi','b_fj','b_fk','b_fl','b_get_self','b_vfs','b_fs'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('A','B'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyB extends B {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ require "director_protected.php";
|
|||
|
||||
check::functions(array('foo_pong','foo_s','foo_q','foo_ping','foo_pang','foo_used','foo_cheer','bar_create','bar_callping','bar_callcheer','bar_cheer','bar_pong','bar_used','bar_ping','bar_pang','a_draw','b_draw'));
|
||||
check::classes(array('Foo','Bar','PrivateFoo','A','B','AA','BB'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class FooBar extends Bar {
|
||||
protected function ping() {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "director_stl.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_bar','foo_ping','foo_pong','foo_tping','foo_tpong','foo_pident','foo_vident','foo_vsecond','foo_tpident','foo_tvident','foo_tvsecond','foo_vidents','foo_tvidents'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Foo'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyFoo extends Foo {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@
|
|||
require "tests.php";
|
||||
require "director_string.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('a_get_first','a_call_get_first','a_string_length','a_process_text','a_call_process_func','stringvector_size','stringvector_is_empty','stringvector_clear','stringvector_push','stringvector_pop','stringvector_capacity','stringvector_reserve'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('A','StringVector'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class B extends A {
|
||||
function get_first() {
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@ require "director_thread.php";
|
|||
# FIXME: Does this still fail in a threaded build of PHP7?
|
||||
exit(0);
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('millisecondsleep','foo_stop','foo_run','foo_do_foo'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('director_thread','Foo'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class Derived extends Foo {
|
||||
function do_foo() {
|
||||
|
|
|
|||
|
|
@ -3,10 +3,12 @@
|
|||
require "tests.php";
|
||||
require "director_unroll.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_ping','foo_pong'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Foo','Bar'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
class MyFoo extends Foo {
|
||||
function ping() {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ require "enum_scope_template.php";
|
|||
|
||||
check::classes(array("enum_scope_template", "TreeInt"));
|
||||
check::functions(array("chops","treeint_chops"));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
check::equal(0,TreeInt::Oak,"0==TreeInt_Oak");
|
||||
check::equal(1,TreeInt::Fir,"1==TreeInt_Fir");
|
||||
check::equal(2,TreeInt::Cedar,"2==TreeInt_Cedar");
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ require "exception_order.php";
|
|||
|
||||
check::functions(array('a_foo','a_bar','a_foobar','a_barfoo','is_python_builtin'));
|
||||
check::classes(array('A','E1','E2','E3','exception_order','ET_i','ET_d'));
|
||||
check::globals(array('efoovar','foovar','cfoovar'));
|
||||
|
||||
$a = new A();
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ require "grouping.php";
|
|||
check::functions(array("test1","test2","do_unary","negate"));
|
||||
check::equal(5,test1(5),"5==test1(5)");
|
||||
check::resource(test2(7),"_p_int","_p_int==test2(7)");
|
||||
check::globals(array('test3'));
|
||||
|
||||
//check::equal(37,test3_get(),'37==test3_get()');
|
||||
check::equal(37,check::get("test3"),'37==get(test3)');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ require "ignore_parameter.php";
|
|||
check::functions(array('jaguar','lotus','tvr','ferrari','fiat','sportscars_daimler','sportscars_astonmartin','sportscars_bugatti','sportscars_lamborghini','sportscars_maseratti'));
|
||||
// New classes
|
||||
check::classes(array('ignore_parameter','SportsCars','MiniCooper','MorrisMinor','FordAnglia','AustinAllegro'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
check::equal(jaguar(2,3.4),"hello",'jaguar(2,3.4)=="hello"');
|
||||
check::equal(lotus("eek",3.4),101,'lotus("eek",3.4)==101');
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ check::functions(array('new_intarray','delete_intarray','intarray_getitem','inta
|
|||
// NB An "li_carrays_cpp" class is created as a mock namespace.
|
||||
check::classes(array('li_carrays_cpp','doubleArray','AB','XY','XYArray','shortArray'));
|
||||
|
||||
// Check global variables.
|
||||
check::globals(array('globalxyarray','globalabarray'));
|
||||
|
||||
$d = new doubleArray(10);
|
||||
|
||||
$d->setitem(0, 7);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ check::functions(array('new_intarray','delete_intarray','intarray_getitem','inta
|
|||
// NB An "li_carrays" class is created as a mock namespace.
|
||||
check::classes(array('li_carrays','doubleArray','AB','XY','XYArray','shortArray'));
|
||||
|
||||
// Check global variables.
|
||||
check::globals(array('globalxyarray','globalabarray'));
|
||||
|
||||
$d = new doubleArray(10);
|
||||
|
||||
$d->setitem(0, 7);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "li_factory.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('geometry_draw','geometry_create','geometry_clone_','point_draw','point_width','point_clone_','circle_draw','circle_radius','circle_clone_'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Geometry','Point','Circle'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$circle = Geometry::create(Geometry::CIRCLE);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "newobject1.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_makefoo','foo_makemore','foo_foocount'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Foo'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$foo = Foo::makeFoo();
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ require "overload_rename.php";
|
|||
|
||||
// No new functions
|
||||
check::functions(array());
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('Foo'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$f = new Foo(1.0);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
require "tests.php";
|
||||
require "prefix.php";
|
||||
|
||||
// No new functions
|
||||
// New functions
|
||||
check::functions(array('foo_get_self'));
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('ProjectFoo'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$f = new ProjectFoo();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ require "____.php";
|
|||
check::functions(array());
|
||||
// No new classes
|
||||
check::classes(array());
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
check::done();
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ require "sym.php";
|
|||
|
||||
// No new functions
|
||||
check::functions(array());
|
||||
// No new classes
|
||||
// New classes
|
||||
check::classes(array('flim','flam'));
|
||||
// now new vars
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$flim=new flim();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ require "threads_exception.php";
|
|||
check::functions(array('test_simple','test_message','test_hosed','test_unknown','test_multi','is_python_builtin'));
|
||||
// Check classes.
|
||||
check::classes(array('Exc','Test','threads_exception'));
|
||||
// No new vars
|
||||
check::globals(array());
|
||||
|
||||
$t = new Test();
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue