您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ASSERT_WITH_MESSAGE函数代码示例

51自学网 2021-06-01 19:38:06
  C++
这篇教程C++ ASSERT_WITH_MESSAGE函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ASSERT_WITH_MESSAGE函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_WITH_MESSAGE函数的具体用法?C++ ASSERT_WITH_MESSAGE怎么用?C++ ASSERT_WITH_MESSAGE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ASSERT_WITH_MESSAGE函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: asWrapper

JSValue* JSInspectedObjectWrapper::prepareIncomingValue(ExecState*, JSValue* value) const{    // The Inspector is only allowed to pass primitive values and wrapped objects to objects from the inspected page.    if (!value->isObject())        return value;    JSQuarantinedObjectWrapper* wrapper = asWrapper(value);    ASSERT_WITH_MESSAGE(wrapper, "Objects passed to JSInspectedObjectWrapper must be wrapped");    if (!wrapper)        return jsUndefined();    if (wrapper->allowsUnwrappedAccessFrom(unwrappedExecState())) {        ASSERT_WITH_MESSAGE(wrapper->inherits(&s_info), "A wrapper contains an object from the inspected page but is not a JSInspectedObjectWrapper");        if (!wrapper->inherits(&s_info))            return jsUndefined();        // Return the unwrapped object so the inspected page never sees one of its own objects in wrapped form.        return wrapper->unwrappedObject();    }    ASSERT_WITH_MESSAGE(wrapper->inherits(&JSInspectorCallbackWrapper::s_info), "A wrapper that was not from the inspected page and is not an Inspector callback was passed to a JSInspectedObjectWrapper");    if (!wrapper->inherits(&JSInspectorCallbackWrapper::s_info))        return jsUndefined();    return wrapper;}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:27,


示例2: ASSERT

uint32_t DFANode::bestFallbackTarget(const DFA& dfa) const{    ASSERT(canUseFallbackTransition(dfa));    HashMap<uint32_t, unsigned, DefaultHash<uint32_t>::Hash, WTF::UnsignedWithZeroKeyHashTraits<uint32_t>> histogram;    IterableConstRange iterableTransitions = transitions(dfa);    auto iterator = iterableTransitions.begin();    auto end = iterableTransitions.end();    ASSERT_WITH_MESSAGE(iterator != end, "An empty range list cannot use a fallback transition.");    if (!iterator.first() && !iterator.last())        ++iterator;    ASSERT_WITH_MESSAGE(iterator != end, "An empty range list matching only zero cannot use a fallback transition.");    uint32_t bestTarget = iterator.target();    unsigned bestTargetScore = !iterator.range().first ? iterator.range().size() - 1 : iterator.range().size();    histogram.add(bestTarget, bestTargetScore);    ++iterator;    for (;iterator != end; ++iterator) {        unsigned rangeSize = iterator.range().size();        uint32_t target = iterator.target();        auto addResult = histogram.add(target, rangeSize);        if (!addResult.isNewEntry)            addResult.iterator->value += rangeSize;        if (addResult.iterator->value > bestTargetScore) {            bestTargetScore = addResult.iterator->value;            bestTarget = target;        }    }    return bestTarget;}
开发者ID:biddyweb,项目名称:switch-oss,代码行数:33,


示例3: ASSERT

void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange){    ASSERT(matchRequest.ruleSet);    ASSERT_WITH_MESSAGE(!(m_mode == SelectorChecker::Mode::ResolvingStyle && !m_style), "When resolving style, the SelectorChecker must have a style to set the pseudo elements and/or to do marking. The SelectorCompiler also rely on that behavior.");    ASSERT_WITH_MESSAGE(!(m_mode == SelectorChecker::Mode::CollectingRulesIgnoringVirtualPseudoElements && m_pseudoStyleRequest.pseudoId != NOPSEUDO), "When in StyleInvalidation or SharingRules, SelectorChecker does not try to match the pseudo ID. While ElementRuleCollector supports matching a particular pseudoId in this case, this would indicate a error at the call site since matching a particular element should be unnecessary.");#if ENABLE(VIDEO_TRACK)    if (m_element.isWebVTTElement())        collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), matchRequest, ruleRange);#endif    auto* shadowRoot = m_element.containingShadowRoot();    if (shadowRoot && shadowRoot->type() == ShadowRoot::Type::UserAgent) {        const AtomicString& pseudoId = m_element.shadowPseudoId();        if (!pseudoId.isEmpty())            collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId.impl()), matchRequest, ruleRange);    }    // We need to collect the rules for id, class, tag, and everything else into a buffer and    // then sort the buffer.    if (m_element.hasID())        collectMatchingRulesForList(matchRequest.ruleSet->idRules(m_element.idForStyleResolution().impl()), matchRequest, ruleRange);    if (m_element.hasClass()) {        for (size_t i = 0; i < m_element.classNames().size(); ++i)            collectMatchingRulesForList(matchRequest.ruleSet->classRules(m_element.classNames()[i].impl()), matchRequest, ruleRange);    }    if (m_element.isLink())        collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest, ruleRange);    if (SelectorChecker::matchesFocusPseudoClass(m_element))        collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest, ruleRange);    collectMatchingRulesForList(matchRequest.ruleSet->tagRules(m_element.localName().impl(), m_element.isHTMLElement() && m_element.document().isHTMLDocument()), matchRequest, ruleRange);    collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest, ruleRange);}
开发者ID:kamihouse,项目名称:webkit,代码行数:34,


示例4: ASSERT_WITH_MESSAGE

void HTMLFieldSetElement::removeInvalidDescendant(const HTMLFormControlElement& formControlElement){    ASSERT_WITH_MESSAGE(!is<HTMLFieldSetElement>(formControlElement), "FieldSet are never candidates for constraint validation.");    ASSERT_WITH_MESSAGE(m_invalidDescendants.contains(&formControlElement), "Updating the fieldset on validity change is not an efficient operation, it should only be done when necessary.");    m_invalidDescendants.remove(&formControlElement);    if (m_invalidDescendants.isEmpty())        setNeedsStyleRecalc();}
开发者ID:valbok,项目名称:WebKitForWayland,代码行数:9,


示例5: initializeLLVMPOSIX

void initializeLLVMPOSIX(const char* libraryName){    void* library = dlopen(libraryName, RTLD_NOW);    ASSERT_WITH_MESSAGE(library, "%s", dlerror());        InitializerFunction initializer = bitwise_cast<InitializerFunction>(        dlsym(library, "initializeAndGetJSCLLVMAPI"));    ASSERT_WITH_MESSAGE(initializer, "%s", dlerror());        llvm = initializer();}
开发者ID:RobotsAndPencils,项目名称:JavaScriptCore-iOS,代码行数:11,


示例6: getAliasWhenSpilling

    Tmp getAliasWhenSpilling(Tmp tmp) const    {        ASSERT_WITH_MESSAGE(!m_spilledTmp.isEmpty(), "This function is only valid for coalescing during spilling.");        if (m_coalescedTmpsAtSpill.isEmpty())            return tmp;        Tmp alias = tmp;        while (Tmp nextAlias = m_coalescedTmpsAtSpill[AbsoluteTmpMapper<type>::absoluteIndex(alias)])            alias = nextAlias;        ASSERT_WITH_MESSAGE(!m_spilledTmp.contains(tmp) || alias == tmp, "The aliases at spill should always be colorable. Something went horribly wrong.");        return alias;    }
开发者ID:josedealcala,项目名称:webkit,代码行数:15,


示例7: adoptPtrWillBeNoop

void KeyframeEffectModelBase::ensureKeyframeGroups() const{    if (m_keyframeGroups)        return;    m_keyframeGroups = adoptPtrWillBeNoop(new KeyframeGroupMap);    const KeyframeVector keyframes = normalizedKeyframes(getFrames());    for (KeyframeVector::const_iterator keyframeIter = keyframes.begin(); keyframeIter != keyframes.end(); ++keyframeIter) {        const Keyframe* keyframe = keyframeIter->get();        PropertySet keyframeProperties = keyframe->properties();        for (PropertySet::const_iterator propertyIter = keyframeProperties.begin(); propertyIter != keyframeProperties.end(); ++propertyIter) {            CSSPropertyID property = *propertyIter;            ASSERT_WITH_MESSAGE(!isExpandedShorthand(property), "Web Animations: Encountered shorthand CSS property (%d) in normalized keyframes.", property);            KeyframeGroupMap::iterator groupIter = m_keyframeGroups->find(property);            PropertySpecificKeyframeGroup* group;            if (groupIter == m_keyframeGroups->end())                group = m_keyframeGroups->add(property, adoptPtrWillBeNoop(new PropertySpecificKeyframeGroup)).storedValue->value.get();            else                group = groupIter->value.get();            group->appendKeyframe(keyframe->createPropertySpecificKeyframe(property));        }    }    // Add synthetic keyframes.    for (KeyframeGroupMap::iterator iter = m_keyframeGroups->begin(); iter != m_keyframeGroups->end(); ++iter) {        iter->value->addSyntheticKeyframeIfRequired(this);        iter->value->removeRedundantKeyframes();    }}
开发者ID:darktears,项目名称:blink-crosswalk,代码行数:30,


示例8: adoptPtr

void KeyframeEffectModelBase::ensureKeyframeGroups() const{    if (m_keyframeGroups)        return;    m_keyframeGroups = adoptPtr(new KeyframeGroupMap);    RefPtr<TimingFunction> zeroOffsetEasing = m_defaultKeyframeEasing;    for (const auto& keyframe : normalizedKeyframes(getFrames())) {        if (keyframe->offset() == 0)            zeroOffsetEasing = &keyframe->easing();        for (const PropertyHandle& property : keyframe->properties()) {            if (property.isCSSProperty())                ASSERT_WITH_MESSAGE(!isShorthandProperty(property.cssProperty()), "Web Animations: Encountered shorthand CSS property (%d) in normalized keyframes.", property.cssProperty());            KeyframeGroupMap::iterator groupIter = m_keyframeGroups->find(property);            PropertySpecificKeyframeGroup* group;            if (groupIter == m_keyframeGroups->end())                group = m_keyframeGroups->add(property, adoptPtr(new PropertySpecificKeyframeGroup)).storedValue->value.get();            else                group = groupIter->value.get();            group->appendKeyframe(keyframe->createPropertySpecificKeyframe(property));        }    }    // Add synthetic keyframes.    m_hasSyntheticKeyframes = false;    for (const auto& entry : *m_keyframeGroups) {        if (entry.value->addSyntheticKeyframeIfRequired(zeroOffsetEasing))            m_hasSyntheticKeyframes = true;        entry.value->removeRedundantKeyframes();    }}
开发者ID:howardroark2018,项目名称:chromium,代码行数:34,


示例9: m_font

FontPlatformData::FontPlatformData(HFONT font, float size, bool bold, bool oblique, bool useGDI)    : m_font(RefCountedGDIHandle<HFONT>::create(font))    , m_size(size)#if PLATFORM(CG)    , m_cgFont(0)#elif PLATFORM(CAIRO)    , m_fontFace(0)    , m_scaledFont(0)#endif    , m_syntheticBold(bold)    , m_syntheticOblique(oblique)    , m_useGDI(useGDI){    HDC hdc = GetDC(0);    SaveDC(hdc);        SelectObject(hdc, font);    UINT bufferSize = GetOutlineTextMetrics(hdc, 0, NULL);    ASSERT_WITH_MESSAGE(bufferSize, "Bitmap fonts not supported with CoreGraphics.");    if (bufferSize) {        OUTLINETEXTMETRICW* metrics = (OUTLINETEXTMETRICW*)malloc(bufferSize);        GetOutlineTextMetricsW(hdc, bufferSize, metrics);        WCHAR* faceName = (WCHAR*)((uintptr_t)metrics + (uintptr_t)metrics->otmpFaceName);        platformDataInit(font, size, hdc, faceName);        free(metrics);    }    RestoreDC(hdc, -1);    ReleaseDC(0, hdc);}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:35,


示例10: initializeIterator

static UBreakIterator* initializeIterator(UBreakIteratorType type, const char* locale = currentTextBreakLocaleID()){    UErrorCode openStatus = U_ZERO_ERROR;    UBreakIterator* iterator = ubrk_open(type, locale, 0, 0, &openStatus);    ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);    return iterator;}
开发者ID:wolfviking0,项目名称:webcl-webkit,代码行数:7,


示例11: initializeGStreamer

bool initializeGStreamer(){    if (gst_is_initialized())        return true;#if ENABLE(SECCOMP_FILTERS)    // The gst-plugin-scanner helper binary will receive SIGSYS and dump core    // when it attempts to open a file. Disable it so that plugin scanning    // occurs in-process. The disadvantage is that a plugin that crashes while    // loading will now crash the web process.    gst_registry_fork_set_enabled(FALSE);#endif    GUniqueOutPtr<GError> error;    // FIXME: We should probably pass the arguments from the command line.    bool gstInitialized = gst_init_check(0, 0, &error.outPtr());    ASSERT_WITH_MESSAGE(gstInitialized, "GStreamer initialization failed: %s", error ? error->message : "unknown error occurred");#if ENABLE(VIDEO_TRACK) && USE(GSTREAMER_MPEGTS)    if (gstInitialized)        gst_mpegts_initialize();#endif    return gstInitialized;}
开发者ID:houzhenggang,项目名称:webkit,代码行数:25,


示例12: ASSERT

void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange){    ASSERT(matchRequest.ruleSet);    ASSERT_WITH_MESSAGE(!(m_mode == SelectorChecker::ResolvingStyle && !m_style), "When resolving style, the SelectorChecker must have a style to set the pseudo elements and/or to do marking. The SelectorCompiler also rely on that behavior.");    const AtomicString& pseudoId = m_element.shadowPseudoId();    if (!pseudoId.isEmpty())        collectMatchingRulesForList(matchRequest.ruleSet->shadowPseudoElementRules(pseudoId.impl()), matchRequest, ruleRange);#if ENABLE(VIDEO_TRACK)    if (m_element.isWebVTTElement())        collectMatchingRulesForList(matchRequest.ruleSet->cuePseudoRules(), matchRequest, ruleRange);#endif    // Only match UA rules in shadow tree.    if (!MatchingUARulesScope::isMatchingUARules() && m_element.treeScope().rootNode().isShadowRoot())        return;    // We need to collect the rules for id, class, tag, and everything else into a buffer and    // then sort the buffer.    if (m_element.hasID())        collectMatchingRulesForList(matchRequest.ruleSet->idRules(m_element.idForStyleResolution().impl()), matchRequest, ruleRange);    if (m_element.hasClass()) {        for (size_t i = 0; i < m_element.classNames().size(); ++i)            collectMatchingRulesForList(matchRequest.ruleSet->classRules(m_element.classNames()[i].impl()), matchRequest, ruleRange);    }    if (m_element.isLink())        collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest, ruleRange);    if (SelectorChecker::matchesFocusPseudoClass(&m_element))        collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest, ruleRange);    collectMatchingRulesForList(matchRequest.ruleSet->tagRules(m_element.localName().impl()), matchRequest, ruleRange);    collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest, ruleRange);}
开发者ID:Zirias,项目名称:webkitfltk,代码行数:33,


示例13: ASSERT

void ElementRuleCollector::collectMatchingRules(const MatchRequest& matchRequest, StyleResolver::RuleRange& ruleRange){    ASSERT(matchRequest.ruleSet);    ASSERT_WITH_MESSAGE(!(m_mode == SelectorChecker::Mode::CollectingRulesIgnoringVirtualPseudoElements && m_pseudoStyleRequest.pseudoId != NOPSEUDO), "When in StyleInvalidation or SharingRules, SelectorChecker does not try to match the pseudo ID. While ElementRuleCollector supports matching a particular pseudoId in this case, this would indicate a error at the call site since matching a particular element should be unnecessary.");    auto* shadowRoot = m_element.containingShadowRoot();    if (shadowRoot && shadowRoot->mode() == ShadowRootMode::UserAgent)        collectMatchingShadowPseudoElementRules(matchRequest, ruleRange);    // We need to collect the rules for id, class, tag, and everything else into a buffer and    // then sort the buffer.    auto& id = m_element.idForStyleResolution();    if (!id.isNull())        collectMatchingRulesForList(matchRequest.ruleSet->idRules(*id.impl()), matchRequest, ruleRange);    if (m_element.hasClass()) {        for (size_t i = 0; i < m_element.classNames().size(); ++i)            collectMatchingRulesForList(matchRequest.ruleSet->classRules(m_element.classNames()[i].impl()), matchRequest, ruleRange);    }    if (m_element.isLink())        collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest, ruleRange);    if (SelectorChecker::matchesFocusPseudoClass(m_element))        collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest, ruleRange);    collectMatchingRulesForList(matchRequest.ruleSet->tagRules(m_element.localName().impl(), m_element.isHTMLElement() && m_element.document().isHTMLDocument()), matchRequest, ruleRange);    collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest, ruleRange);}
开发者ID:ollie314,项目名称:webkit,代码行数:26,


示例14: freeze

 void freeze() {     IndexType victimIndex = m_freezeWorklist.takeAny();     ASSERT_WITH_MESSAGE(getAlias(victimIndex) == victimIndex, "coalesce() should not leave aliased Tmp in the worklist.");     m_simplifyWorklist.append(victimIndex);     freezeMoves(victimIndex); }
开发者ID:jeff-jenness,项目名称:webkit,代码行数:7,


示例15: allocate

    void allocate()    {        ASSERT_WITH_MESSAGE(m_activeMoves.size() >= m_coalescingCandidates.size(), "The activeMove set should be big enough for the quick operations of BitVector.");        makeWorkList();        if (debug) {            dumpInterferenceGraphInDot(WTF::dataFile());            dataLog("Initial work list/n");            dumpWorkLists(WTF::dataFile());        }        do {            if (traceDebug) {                dataLog("Before Graph simplification iteration/n");                dumpWorkLists(WTF::dataFile());            }            if (!m_simplifyWorklist.isEmpty())                simplify();            else if (!m_worklistMoves.isEmpty())                coalesce();            else if (!m_freezeWorklist.isEmpty())                freeze();            else if (!m_spillWorklist.isEmpty())                selectSpill();            if (traceDebug) {                dataLog("After Graph simplification iteration/n");                dumpWorkLists(WTF::dataFile());            }        } while (!m_simplifyWorklist.isEmpty() || !m_worklistMoves.isEmpty() || !m_freezeWorklist.isEmpty() || !m_spillWorklist.isEmpty());        assignColors();    }
开发者ID:cls1991,项目名称:webkit,代码行数:35,


示例16: m_font

FontPlatformData::FontPlatformData(GDIObject<HFONT> font, float size, bool bold, bool oblique, bool useGDI)    : m_font(SharedGDIObject<HFONT>::create(WTFMove(font)))    , m_size(size)    , m_orientation(Horizontal)    , m_widthVariant(RegularWidth)    , m_isColorBitmapFont(false)    , m_syntheticBold(bold)    , m_syntheticOblique(oblique)    , m_useGDI(useGDI){    HWndDC hdc(0);    SaveDC(hdc);        ::SelectObject(hdc, m_font->get());    UINT bufferSize = GetOutlineTextMetrics(hdc, 0, NULL);    ASSERT_WITH_MESSAGE(bufferSize, "Bitmap fonts not supported with CoreGraphics.");    if (bufferSize) {        OUTLINETEXTMETRICW* metrics = (OUTLINETEXTMETRICW*)malloc(bufferSize);        GetOutlineTextMetricsW(hdc, bufferSize, metrics);        WCHAR* faceName = (WCHAR*)((uintptr_t)metrics + (uintptr_t)metrics->otmpFaceName);        platformDataInit(m_font->get(), size, hdc, faceName);        free(metrics);    }    RestoreDC(hdc, -1);}
开发者ID:edcwconan,项目名称:webkit,代码行数:31,


示例17: ASSERT_WITH_MESSAGE

void StyleBuilder::applyProperty(CSSPropertyID id, StyleResolverState& state, CSSValue* value){    ASSERT_WITH_MESSAGE(!isShorthandProperty(id), "Shorthand property id = %d wasn't expanded at parsing time", id);    bool isInherit = state.parentNode() && value->isInheritedValue();    bool isInitial = value->isInitialValue() || (!state.parentNode() && value->isInheritedValue());    ASSERT(!isInherit || !isInitial); // isInherit -> !isInitial && isInitial -> !isInherit    ASSERT(!isInherit || (state.parentNode() && state.parentStyle())); // isInherit -> (state.parentNode() && state.parentStyle())    if (!state.applyPropertyToRegularStyle() && (!state.applyPropertyToVisitedLinkStyle() || !isValidVisitedLinkProperty(id))) {        // Limit the properties that can be applied to only the ones honored by :visited.        return;    }    if (isInherit && !state.parentStyle()->hasExplicitlyInheritedProperties() && !CSSPropertyMetadata::isInheritedProperty(id)) {        state.parentStyle()->setHasExplicitlyInheritedProperties();    } else if (value->isUnsetValue()) {        ASSERT(!isInherit && !isInitial);        if (CSSPropertyMetadata::isInheritedProperty(id))            isInherit = true;        else            isInitial = true;    }    StyleBuilder::applyProperty(id, state, value, isInitial, isInherit);}
开发者ID:OctiumBrowser,项目名称:octium-main,代码行数:27,


示例18: ASSERT_WITH_MESSAGE

void CombinedURLFilters::addPattern(uint64_t actionId, const Vector<Term>& pattern){    ASSERT_WITH_MESSAGE(!pattern.isEmpty(), "The parser should have excluded empty patterns before reaching CombinedURLFilters.");    if (pattern.isEmpty())        return;    // Extend the prefix tree with the new pattern.    PrefixTreeVertex* lastPrefixTree = m_prefixTreeRoot.get();    for (const Term& term : pattern) {        size_t nextEntryIndex = WTF::notFound;        for (size_t i = 0; i < lastPrefixTree->edges.size(); ++i) {            if (lastPrefixTree->edges[i].term == term) {                nextEntryIndex = i;                break;            }        }        if (nextEntryIndex != WTF::notFound)            lastPrefixTree = lastPrefixTree->edges[nextEntryIndex].child.get();        else {            lastPrefixTree->edges.append(PrefixTreeEdge({term, std::make_unique<PrefixTreeVertex>()}));            lastPrefixTree = lastPrefixTree->edges.last().child.get();        }    }    ActionList& actions = lastPrefixTree->finalActions;    if (actions.find(actionId) == WTF::notFound)        actions.append(actionId);}
开发者ID:mu326668629,项目名称:webkit,代码行数:30,


示例19: m_callback

AudioDestinationGStreamer::AudioDestinationGStreamer(AudioIOCallback& callback, float sampleRate)    : m_callback(callback)    , m_renderBus(AudioBus::create(2, framesToPull, false))    , m_sampleRate(sampleRate)    , m_isPlaying(false){    m_pipeline = gst_pipeline_new("play");    GRefPtr<GstBus> bus = adoptGRef(gst_pipeline_get_bus(GST_PIPELINE(m_pipeline)));    ASSERT(bus);    gst_bus_add_signal_watch(bus.get());    g_signal_connect(bus.get(), "message", G_CALLBACK(messageCallback), this);    GstElement* webkitAudioSrc = reinterpret_cast<GstElement*>(g_object_new(WEBKIT_TYPE_WEB_AUDIO_SRC,                                                                            "rate", sampleRate,                                                                            "bus", m_renderBus.get(),                                                                            "provider", &m_callback,                                                                            "frames", framesToPull, NULL));    GstElement* wavParser = gst_element_factory_make("wavparse", 0);    m_wavParserAvailable = wavParser;    ASSERT_WITH_MESSAGE(m_wavParserAvailable, "Failed to create GStreamer wavparse element");    if (!m_wavParserAvailable)        return;    gst_bin_add_many(GST_BIN(m_pipeline), webkitAudioSrc, wavParser, NULL);    gst_element_link_pads_full(webkitAudioSrc, "src", wavParser, "sink", GST_PAD_LINK_CHECK_NOTHING);    GRefPtr<GstPad> srcPad = adoptGRef(gst_element_get_static_pad(wavParser, "src"));    finishBuildingPipelineAfterWavParserPadReady(srcPad.get());}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:31,


示例20: createStackOverflowError

JSValue* createStackOverflowError(ExecState* exec){    //Note by Arpit Baldeva:07/16/09. Added this assert to indicate to the users that the JavaScript has exceeded	//statck size. This is because EAWebkit users can explicitly set the stack size for JavaScript usage.	ASSERT_WITH_MESSAGE(false, "JavaScript Stack overflowed. Please increase the stack size");	return createError(exec, RangeError, "Maximum call stack size exceeded.");}
开发者ID:Chingliu,项目名称:EAWebkit,代码行数:7,


示例21: ASSERT

void HeapSnapshot::sweepCell(JSCell* cell){    ASSERT(cell);    if (m_finalized && !m_filter.ruleOut(bitwise_cast<uintptr_t>(cell))) {        ASSERT_WITH_MESSAGE(!isEmpty(), "Our filter should have ruled us out if we are empty.");        unsigned start = 0;        unsigned end = m_nodes.size();        while (start != end) {            unsigned middle = start + ((end - start) / 2);            HeapSnapshotNode& node = m_nodes[middle];            if (cell == node.cell) {                // Cells should always have 0 as low bits.                // Mark this cell for removal by setting the low bit.                ASSERT(!(reinterpret_cast<intptr_t>(node.cell) & CellToSweepTag));                node.cell = reinterpret_cast<JSCell*>(reinterpret_cast<intptr_t>(node.cell) | CellToSweepTag);                m_hasCellsToSweep = true;                return;            }            if (cell < node.cell)                end = middle;            else                start = middle + 1;        }    }    if (m_previous)        m_previous->sweepCell(cell);}
开发者ID:ollie314,项目名称:webkit,代码行数:29,


示例22: ASSERT_WITH_MESSAGE

void dle::Group::AddObject( Object *child, align_t align, float weight ){	ASSERT_WITH_MESSAGE( child!=NULL, "Illegal child object" );	ASSERT_WITH_MESSAGE( weight>=0.0f, "A child's weight must be greater that 0" );	childinfo *c = new childinfo;	c->object = child;//	c->objectisgroup = dynamic_cast<Group*>(c->object)!=NULL;	c->objectisgroup = !c->object->WantInnerSpacing();	c->weight = weight;	c->align = (align_t)(		((align&HMASK)==HDEFAULT) ? (fDefaultAlign&HMASK) : (align&HMASK) | 		((align&VMASK)==VDEFAULT) ? (fDefaultAlign&VMASK) : (align&VMASK));		fChilds.AddItem( c );	fView->AddChild( child->GetView() );}
开发者ID:HaikuArchives,项目名称:YasirsJunkyard,代码行数:17,


示例23: initializeIteratorWithRules

static TextBreakIterator* initializeIteratorWithRules(const char* breakRules){    UParseError parseStatus;    UErrorCode openStatus = U_ZERO_ERROR;    String rules(breakRules);    TextBreakIterator* iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(rules.deprecatedCharacters(), rules.length(), 0, 0, &parseStatus, &openStatus));    ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);    return iterator;}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:9,


示例24: ASSERT_WITH_MESSAGE

void LegacyTransaction::enqueueEvent(Ref<Event>&& event){    ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().string().utf8().data());    if (m_contextStopped || !scriptExecutionContext())        return;    event->setTarget(this);    scriptExecutionContext()->eventQueue().enqueueEvent(WTF::move(event));}
开发者ID:zte-lhg,项目名称:webkit,代码行数:9,


示例25: print

void CombinedURLFilters::processNFAs(size_t maxNFASize, std::function<void(NFA&&)> handler){#if CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING    print();#endif    while (true) {        // Traverse out to a leaf.        Vector<PrefixTreeVertex*, 128> stack;        PrefixTreeVertex* vertex = m_prefixTreeRoot.get();        while (true) {            ASSERT(vertex);            stack.append(vertex);            if (vertex->edges.isEmpty())                break;            vertex = vertex->edges.last().child.get();        }        if (stack.size() == 1)            break; // We're done once we have processed and removed all the edges in the prefix tree.                // Find the prefix root for this NFA. This is the vertex after the last term with a quantifier if there is one,        // or the root if there are no quantifiers left.        while (stack.size() > 1) {            if (!stack[stack.size() - 2]->edges.last().term.hasFixedLength())                break;            stack.removeLast();        }        ASSERT_WITH_MESSAGE(!stack.isEmpty(), "At least the root should be in the stack");                // Make an NFA with the subtrees for whom this is also the last quantifier (or who also have no quantifier).        NFA nfa;        // Put the prefix into the NFA.        unsigned prefixEnd = nfa.root();        for (unsigned i = 0; i < stack.size() - 1; ++i) {            ASSERT(!stack[i]->edges.isEmpty());            const PrefixTreeEdge& edge = stack[i]->edges.last();            prefixEnd = edge.term.generateGraph(nfa, prefixEnd, edge.child->finalActions);        }        // Put the non-quantified vertices in the subtree into the NFA and delete them.        ASSERT(stack.last());        generateNFAForSubtree(nfa, prefixEnd, *stack.last(), maxNFASize);                handler(WTF::move(nfa));                // Clean up any processed leaf nodes.        while (true) {            if (stack.size() > 1) {                if (stack[stack.size() - 1]->edges.isEmpty()) {                    stack[stack.size() - 2]->edges.removeLast();                    stack.removeLast();                } else                    break; // Vertex is not a leaf.            } else                break; // Leave the empty root.        }    }}
开发者ID:mu326668629,项目名称:webkit,代码行数:56,


示例26: initializeIteratorWithRules

static TextBreakIterator* initializeIteratorWithRules(const char* breakRules){    UParseError parseStatus;    UErrorCode openStatus = U_ZERO_ERROR;    unsigned length = strlen(breakRules);    auto upconvertedCharacters = StringView(reinterpret_cast<const LChar*>(breakRules), length).upconvertedCharacters();    TextBreakIterator* iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(upconvertedCharacters, length, 0, 0, &parseStatus, &openStatus));    ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus);    return iterator;}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:10,


示例27: ASSERT_WITH_MESSAGE

void IDBTransaction::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event){    ASSERT_WITH_MESSAGE(m_state != Finished, "A finished transaction tried to enqueue an event of type %s.", event->type().utf8().data());    if (m_contextStopped || !executionContext())        return;    EventQueue* eventQueue = executionContext()->eventQueue();    event->setTarget(this);    eventQueue->enqueueEvent(event);}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:10,


示例28: ASSERT_WITH_MESSAGE

bool IDBDatabaseBackendImpl::openInternal(){    bool success = m_backingStore->getIDBDatabaseMetaData(m_metadata.name, &m_metadata);    ASSERT_WITH_MESSAGE(success == (m_metadata.id != InvalidId), "success = %s, m_id = %lld", success ? "true" : "false", static_cast<long long>(m_metadata.id));    if (success) {        loadObjectStores();        return true;    }    return m_backingStore->createIDBDatabaseMetaData(m_metadata.name, m_metadata.version, m_metadata.intVersion, m_metadata.id);}
开发者ID:eugenejen,项目名称:wkhtmltopdf,代码行数:10,



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


C++ ASSERT_WITH_SECURITY_IMPLICATION函数代码示例
C++ ASSERT_WDEV_LOCK函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。