Example #1
0
void DefaultSource::doGetNextFrame()
{
    auto const CODE = _reader->read(fTo, fMaxSize, &fFrameSize, &fPresentationTime);
    if (isFailure(CODE)) {
        handleClosure();
        return;
    }

    // Inform the reader that he has data:
    // To avoid possible infinite recursion, we need to return to the event loop to do this:
    nextTask() = envir().taskScheduler().scheduleDelayedTask(0, (TaskFunc*)FramedSource::afterGetting, this);
}
void TextResultPrinter::endTest(const Test& test)
{
    auto lastest = tests.top();

    lastest->isSucc() ? onTestSucc(test)
                      : onTestFail(test, lastest->isFailure());

    auto elapsed = tests.top()->elapsedTime();

    out << WHITE << test.getName() << toString(elapsed) << std::endl;
    collectTime(elapsed);

    tests.pop();
}
Example #3
0
UBool IcuTestErrorCode::logDataIfFailureAndReset(const char *fmt, ...) {
    if(isFailure()) {
        char buffer[4000];
        va_list ap;
        va_start(ap, fmt);
        vsprintf(buffer, fmt, ap);
        va_end(ap);
        UnicodeString msg(testName, -1, US_INV);
        msg.append(UNICODE_STRING_SIMPLE(" failure: ")).append(UnicodeString(errorName(), -1, US_INV));
        msg.append(UNICODE_STRING_SIMPLE(" - ")).append(UnicodeString(buffer, -1, US_INV));
        testClass.dataerrln(msg);
        reset();
        return TRUE;
    } else {
        reset();
        return FALSE;
    }
}
Example #4
0
void InlineResult::report()
{
    // User may have suppressed reporting via setReported(). If so, do nothing.
    if (inlReported)
    {
        return;
    }

    inlReported = true;

#ifdef DEBUG

    // Optionally dump the result
    if (VERBOSE)
    {
        const char* format = "INLINER: during '%s' result '%s' reason '%s' for '%s' calling '%s'\n";
        const char* caller = (inlCaller == nullptr) ? "n/a" : inlCompiler->eeGetMethodFullName(inlCaller);
        const char* callee = (inlCallee == nullptr) ? "n/a" : inlCompiler->eeGetMethodFullName(inlCallee);

        JITDUMP(format, inlContext, resultString(), reasonString(), caller, callee);
    }

    // If the inline failed, leave information on the call so we can
    // later recover what observation lead to the failure.
    if (isFailure() && (inlCall != nullptr))
    {
        // compiler should have revoked candidacy on the call by now
        assert((inlCall->gtFlags & GTF_CALL_INLINE_CANDIDATE) == 0);

        inlCall->gtInlineObservation = static_cast<unsigned>(inlObservation);
    }

#endif // DEBUG

    if (isDecided())
    {
        const char* format = "INLINER: during '%s' result '%s' reason '%s'\n";
        JITLOG_THIS(inlCompiler, (LL_INFO100000, format, inlContext, resultString(), reasonString()));
        COMP_HANDLE comp = inlCompiler->info.compCompHnd;
        comp->reportInliningDecision(inlCaller, inlCallee, result(), reasonString());
    }
}
Example #5
0
 ~MyErrorCode() {
     if(isFailure()) {
         ++dests;
     }
 }
Example #6
0
IcuTestErrorCode::~IcuTestErrorCode() {
    // Safe because our handleFailure() does not throw exceptions.
    if(isFailure()) { handleFailure(); }
}
Example #7
0
void ErrorCode::assertSuccess() const {
    if(isFailure()) {
        handleFailure();
    }
}
Example #8
0
U_NAMESPACE_BEGIN

IcuToolErrorCode::~IcuToolErrorCode() {
    // Safe because our handleFailure() does not throw exceptions.
    if(isFailure()) { handleFailure(); }
}