当前位置: 首页>>代码示例>>PHP>>正文


PHP check::fail方法代码示例

本文整理汇总了PHP中check::fail方法的典型用法代码示例。如果您正苦于以下问题:PHP check::fail方法的具体用法?PHP check::fail怎么用?PHP check::fail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在check的用法示例。


在下文中一共展示了check::fail方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: long_long_equal

function long_long_equal($a, $b, $message)
{
    if (!($a === $b)) {
        if (!((double) $a === $b)) {
            return check::fail($message . ": '{$a}'!=='{$b}'");
        }
    }
    return TRUE;
}
开发者ID:daxiazh,项目名称:swig,代码行数:9,代码来源:primitive_ref_runme.php

示例2: do_foo

<?php

require "tests.php";
require "director_thread.php";
// No new functions
check::functions(array(millisecondsleep, foo_stop, foo_run, foo_do_foo));
// No new classes
check::classes(array(director_thread, Foo));
// now new vars
check::globals(array(foo_val));
class Derived extends Foo
{
    function do_foo()
    {
        $this->val = $this->val - 1;
    }
}
$d = new Derived();
$d->run();
if ($d->val >= 0) {
    check::fail($d->val);
}
$d->stop();
check::done();
开发者ID:hj3938,项目名称:crossbridge,代码行数:24,代码来源:director_thread_runme.php

示例3: virtualMethod

<?php

require "tests.php";
require "director_pass_by_value.php";
$passByVal = null;
class director_pass_by_value_Derived extends DirectorPassByValueAbstractBase
{
    function virtualMethod($b)
    {
        global $passByVal;
        $passByVal = $b;
    }
}
# bug was the passByVal global object was destroyed after the call to virtualMethod had finished.
$caller = new Caller();
$caller->call_virtualMethod(new director_pass_by_value_Derived());
$ret = $passByVal->getVal();
if ($ret != 0x12345678) {
    check::fail("Bad return value, got " . dechex($ret));
}
check::done();
开发者ID:mromberg,项目名称:swig,代码行数:21,代码来源:director_pass_by_value_runme.php

示例4: catch

try {
    $bad->call_int();
    check::fail("Exception wasn't propagated from Bad::return_int()");
} catch (Exception $e) {
    check::equal($e->getMessage(), "bad int", "propagated exception incorrect");
}
try {
    $bad->call_double();
    check::fail("Exception wasn't propagated from Bad::return_double()");
} catch (Exception $e) {
    check::equal($e->getMessage(), "bad double", "propagated exception incorrect");
}
try {
    $bad->call_const_char_star();
    check::fail("Exception wasn't propagated from Bad::return_const_char_star()");
} catch (Exception $e) {
    check::equal($e->getMessage(), "bad const_char_star", "propagated exception incorrect");
}
try {
    $bad->call_std_string();
    check::fail("Exception wasn't propagated from Bad::return_std_string()");
} catch (Exception $e) {
    check::equal($e->getMessage(), "bad std_string", "propagated exception incorrect");
}
try {
    $bad->call_Bar();
    check::fail("Exception wasn't propagated from Bad::return_Bar()");
} catch (Exception $e) {
    check::equal($e->getMessage(), "bad Bar", "propagated exception incorrect");
}
check::done();
开发者ID:daxiazh,项目名称:swig,代码行数:31,代码来源:director_exception_runme.php

示例5: resource

 function resource($a, $b, $message)
 {
     $resource = trim(check::var_dump($a));
     if (!eregi("^resource\\([0-9]+\\) of type \\({$b}\\)", $resource)) {
         return check::fail($message);
     }
     return TRUE;
 }
开发者ID:daxiazh,项目名称:swig,代码行数:8,代码来源:tests.php


注:本文中的check::fail方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。