This could happen in overloaded methods which returned void and took at least one const std::string& parameter.
45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
|
|
require "tests.php";
|
|
require "li_std_string.php";
|
|
|
|
function die_on_error($errno, $errstr, $file, $line) {
|
|
if ($file !== Null) {
|
|
print $file;
|
|
if ($line !== Null) print ":$line";
|
|
print ": ";
|
|
}
|
|
print "$errstr\n";
|
|
exit(1);
|
|
}
|
|
set_error_handler("die_on_error", -1);
|
|
|
|
// Global variables
|
|
//$s="initial string";
|
|
//check::equal(GlobalString2_get() ,"global string 2", "GlobalString2 test 1");
|
|
|
|
// Global variables
|
|
$s = "initial string";
|
|
check::equal(GlobalString2_get(), "global string 2", "GlobalString2 test 1");
|
|
GlobalString2_set($s);
|
|
check::equal(GlobalString2_get(), $s, "GlobalString2 test 2");
|
|
check::equal(ConstGlobalString_get(), "const global string", "ConstGlobalString test");
|
|
|
|
// Member variables
|
|
$myStructure = new Structure();
|
|
check::equal($myStructure->MemberString2, "member string 2", "MemberString2 test 1");
|
|
$myStructure->MemberString2 = $s;
|
|
check::equal($myStructure->MemberString2, $s, "MemberString2 test 2");
|
|
check::equal($myStructure->ConstMemberString, "const member string", "ConstMemberString test");
|
|
|
|
check::equal(Structure::StaticMemberString2(), "static member string 2", "StaticMemberString2 test 1");
|
|
Structure::StaticMemberString2($s);
|
|
check::equal(Structure::StaticMemberString2(), $s, "StaticMemberString2 test 2");
|
|
// below broken ?
|
|
//check::equal(Structure::ConstStaticMemberString(), "const static member string", "ConstStaticMemberString test");
|
|
|
|
// This used to give "Undefined variable: r"
|
|
li_std_string::test_const_reference_returning_void("foo");
|
|
|
|
check::done();
|
|
?>
|