这篇教程C++ DE_ASSERT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DE_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ DE_ASSERT函数的具体用法?C++ DE_ASSERT怎么用?C++ DE_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DE_ASSERT函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: rndUniqueRandomIterator<T>::UniqueRandomIterator (deUint32 numItems, deUint32 numValues, int seed){ de::Random rnd(seed); DE_ASSERT(numItems <= numValues); if (numItems == numValues) { // Fast way to populate the index sequence m_indices = std::vector<deUint32>(numItems); for (deUint32 itemNdx = 0; itemNdx < numItems; itemNdx++) m_indices[itemNdx] = itemNdx; } else { std::set<deUint32> uniqueIndices; // Populate set with "numItems" unique values between 0 and numValues - 1 while (uniqueIndices.size() < numItems) uniqueIndices.insert(rnd.getUint32() % numValues); // Copy set into index sequence m_indices = std::vector<deUint32>(uniqueIndices.begin(), uniqueIndices.end()); } // Scramble the indices rnd.shuffle(m_indices.begin(), m_indices.end()); reset();}
开发者ID:MIPS,项目名称:external-deqp,代码行数:31,
示例2: DE_ASSERTvoid ContainerFormatParser::getData (deUint8* dst, int numBytes, int offset){ DE_ASSERT(de::inBounds(offset, 0, m_elementLen) && numBytes > 0 && de::inRange(numBytes+offset, 0, m_elementLen)); for (int ndx = 0; ndx < numBytes; ndx++) dst[ndx] = m_buf.peekBack(offset+ndx);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:7,
示例3: DE_ASSERTvoid RingBuffer<T>::resize (int newSize){ DE_ASSERT(newSize >= m_numElements); T* buf = new T[newSize]; try { // Copy old elements. for (int ndx = 0; ndx < m_numElements; ndx++) buf[ndx] = m_buffer[(m_back + ndx) % m_size]; // Reset pointers. m_front = m_numElements; m_back = 0; m_size = newSize; DE_SWAP(T*, buf, m_buffer); delete[] buf; } catch (...) { delete[] buf; throw; }}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:25,
示例4: switchstd::ostream& operator<< (std::ostream& str, const TypeAccessFormat& format){ const VarType* curType = &format.type; for (TypeComponentVector::const_iterator iter = format.path.begin(); iter != format.path.end(); iter++) { switch (iter->type) { case VarTypeComponent::ARRAY_ELEMENT: curType = &curType->getElementType(); // Update current type. // Fall-through. case VarTypeComponent::MATRIX_COLUMN: case VarTypeComponent::VECTOR_COMPONENT: str << "[" << iter->index << "]"; break; case VarTypeComponent::STRUCT_MEMBER: { const StructMember& member = curType->getStructPtr()->getMember(iter->index); str << "." << member.getName(); curType = &member.getType(); break; } default: DE_ASSERT(false); } } return str;}
开发者ID:MIPS,项目名称:external-deqp,代码行数:32,
示例5: wrapint wrap (Sampler::WrapMode mode, int c, int size){ switch (mode) { // /note CL and GL modes are handled identically here, as verification process accounts for // accuracy differences caused by different methods (wrapping vs. denormalizing first). case tcu::Sampler::CLAMP_TO_BORDER: return deClamp32(c, -1, size); case tcu::Sampler::CLAMP_TO_EDGE: return deClamp32(c, 0, size-1); case tcu::Sampler::REPEAT_GL: case tcu::Sampler::REPEAT_CL: return imod(c, size); case tcu::Sampler::MIRRORED_REPEAT_GL: case tcu::Sampler::MIRRORED_REPEAT_CL: return (size - 1) - mirror(imod(c, 2*size) - size); default: DE_ASSERT(DE_FALSE); return 0; }}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:25,
示例6: handle_dlm_load_cfmstatic void handle_dlm_load_cfm(hic_dlm_load_cfm_t *cfm){ hic_message_context_t msg_ref; hic_dlm_load_req_t *req; DE_ASSERT(dlm_state.ops); if(cfm->remaining_size == 0) { /* done */ WiFiEngine_AllowPowerSave(dlm_state.ps_ctrl); return; } create_dlm_req_and_update_state( &msg_ref, &req, cfm->address, cfm->remaining_size); DE_TRACE_INT4(TR_INITIALIZE, "DLM_REQ a:%x s:%u rs:%u c:%x/n", req->address, req->page.size, req->remaining_size, req->checksum); send_and_free(&msg_ref,req);}
开发者ID:CoreTech-Development,项目名称:buildroot-linux-kernel-m3,代码行数:28,
示例7: qpTestLog_writeKeyValuePairstatic deBool qpTestLog_writeKeyValuePair (qpTestLog* log, const char* elementName, const char* name, const char* description, const char* unit, qpKeyValueTag tag, const char* text){ const char* tagString = QP_LOOKUP_STRING(s_qpTagMap, tag); qpXmlAttribute attribs[8]; int numAttribs = 0; DE_ASSERT(log && elementName && text); deMutex_lock(log->lock); /* Fill in attributes. */ if (name) attribs[numAttribs++] = qpSetStringAttrib("Name", name); if (description) attribs[numAttribs++] = qpSetStringAttrib("Description", description); if (tagString) attribs[numAttribs++] = qpSetStringAttrib("Tag", tagString); if (unit) attribs[numAttribs++] = qpSetStringAttrib("Unit", unit); if (!qpXmlWriter_startElement(log->writer, elementName, numAttribs, attribs) || !qpXmlWriter_writeString(log->writer, text) || !qpXmlWriter_endElement(log->writer, elementName)) { qpPrintf("qpTestLog_writeKeyValuePair(): Writing XML failed/n"); deMutex_unlock(log->lock); return DE_FALSE; } deMutex_unlock(log->lock); return DE_TRUE;}
开发者ID:LeMaker,项目名称:android-actions,代码行数:27,
示例8: DE_ASSERT/** Reads read buffer's depth data (assuming it's of 32-bit FP resolution) * and verifies its correctness. * * @param texture_size Texture size * @param n_layer Index of the layer to verify. * * @return true if the retrieved data was found correct, false otherwise. **/bool TextureCubeMapArrayColorDepthAttachmentsTest::verifyDepth32FData(const _texture_size& texture_size, glw::GLuint n_layer){ /* Allocate buffer for the data we will retrieve from the implementation */ glw::GLfloat expected_value = (glw::GLfloat)n_layer / 256.0f; const glw::Functions& gl = m_context.getRenderContext().getFunctions(); bool result = false; const glw::GLuint result_data_size = texture_size.m_size * texture_size.m_size; glw::GLfloat* result_data = new glw::GLfloat[result_data_size]; DE_ASSERT(result_data != NULL); /* Read the data */ gl.readPixels(0, /* x */ 0, /* y */ texture_size.m_size, texture_size.m_size, m_depth_format, m_depth_type, result_data); GLU_EXPECT_NO_ERROR(gl.getError(), "glReadPixels() call failed"); /* Verify image, expected value is layer index */ result = verifyImage<glw::GLfloat, 1>(texture_size.m_size, texture_size.m_size, &expected_value, result_data); /* Release the buffer */ if (result_data != NULL) { delete[] result_data; result_data = NULL; } return result;}
开发者ID:eth0047,项目名称:VK-GL-CTS,代码行数:39,
示例9: Message explicit Message (MessageType type_) : type(type_) { DE_ASSERT(type_ == MESSAGE_RESUME || type_ == MESSAGE_PAUSE || type_ == MESSAGE_FINISH); }
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:7,
示例10: mapGLBlendFuncrr::BlendFunc mapGLBlendFunc (deUint32 func){ switch (func) { case GL_ZERO: return rr::BLENDFUNC_ZERO; case GL_ONE: return rr::BLENDFUNC_ONE; case GL_SRC_COLOR: return rr::BLENDFUNC_SRC_COLOR; case GL_ONE_MINUS_SRC_COLOR: return rr::BLENDFUNC_ONE_MINUS_SRC_COLOR; case GL_DST_COLOR: return rr::BLENDFUNC_DST_COLOR; case GL_ONE_MINUS_DST_COLOR: return rr::BLENDFUNC_ONE_MINUS_DST_COLOR; case GL_SRC_ALPHA: return rr::BLENDFUNC_SRC_ALPHA; case GL_ONE_MINUS_SRC_ALPHA: return rr::BLENDFUNC_ONE_MINUS_SRC_ALPHA; case GL_DST_ALPHA: return rr::BLENDFUNC_DST_ALPHA; case GL_ONE_MINUS_DST_ALPHA: return rr::BLENDFUNC_ONE_MINUS_DST_ALPHA; case GL_CONSTANT_COLOR: return rr::BLENDFUNC_CONSTANT_COLOR; case GL_ONE_MINUS_CONSTANT_COLOR: return rr::BLENDFUNC_ONE_MINUS_CONSTANT_COLOR; case GL_CONSTANT_ALPHA: return rr::BLENDFUNC_CONSTANT_ALPHA; case GL_ONE_MINUS_CONSTANT_ALPHA: return rr::BLENDFUNC_ONE_MINUS_CONSTANT_ALPHA; case GL_SRC_ALPHA_SATURATE: return rr::BLENDFUNC_SRC_ALPHA_SATURATE; case GL_SRC1_COLOR: return rr::BLENDFUNC_SRC1_COLOR; case GL_ONE_MINUS_SRC1_COLOR: return rr::BLENDFUNC_ONE_MINUS_SRC1_COLOR; case GL_SRC1_ALPHA: return rr::BLENDFUNC_SRC1_ALPHA; case GL_ONE_MINUS_SRC1_ALPHA: return rr::BLENDFUNC_ONE_MINUS_SRC1_ALPHA; default: DE_ASSERT(false); return rr::BLENDFUNC_LAST; }}
开发者ID:MIPS,项目名称:external-deqp,代码行数:28,
示例11: core_dump_appendint core_dump_append(void *ctx, void *data, size_t len){ struct dump_s *s = (struct dump_s*)ctx; if(s==NULL) { return -1; } if( s->cache ) { /* Coredump cache must be larger then each packet */ DE_ASSERT(len < DE_COREDUMP_CACHE_SIZE); if(s->cache_off + len >= DE_COREDUMP_CACHE_SIZE) { s->written += de_fwrite(s->file, s->cache, s->cache_off); s->cache_off = 0; } DE_MEMCPY(s->cache + s->cache_off, data, len); s->cache_off += len; } else { s->written += de_fwrite(s->file, (char*)data, len); } DE_TRACE_INT2(TR_NOISE, "wrote %d file at %d/n", len, s->written); return len;}
开发者ID:murphy666,项目名称:sun4i-kernel,代码行数:29,
示例12: stripLeadingPathstatic void stripLeadingPath (char* fileName, const char* pathPrefix){ int pathLen = strlen(pathPrefix); int fileNameLen = strlen(fileName); DE_ASSERT(beginsWithPath(fileName, pathPrefix)); /* Strip trailing / */ while (pathLen > 0 && pathPrefix[pathLen-1] == '/') pathLen -= 1; DE_ASSERT(pathLen > 0); DE_ASSERT(fileName[pathLen] == '/'); memmove(&fileName[0], &fileName[0]+pathLen+1, fileNameLen-pathLen);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:16,
示例13: deProcess_cleanupHandlesvoid deProcess_cleanupHandles (deProcess* process){ DE_ASSERT(!deProcess_isRunning(process)); if (process->standardErr) deFile_destroy(process->standardErr); if (process->standardOut) deFile_destroy(process->standardOut); if (process->standardIn) deFile_destroy(process->standardIn); if (process->procInfo.hProcess) CloseHandle(process->procInfo.hProcess); if (process->procInfo.hThread) CloseHandle(process->procInfo.hThread); process->standardErr = DE_NULL; process->standardOut = DE_NULL; process->standardIn = DE_NULL; process->procInfo.hProcess = DE_NULL; process->procInfo.hThread = DE_NULL;}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:25,
示例14: DE_ASSERT/*--------------------------------------------------------------------*//*! * /brief Start thread. * * Starts thread that will execute the virtual run() method. * * The function will fail if the thread is currently running or has finished * but no join() has been called. *//*--------------------------------------------------------------------*/void Thread::start (void){ DE_ASSERT(!m_thread); m_thread = deThread_create(threadFunc, this, &m_attribs); if (!m_thread) throw std::bad_alloc();}
开发者ID:MIPS,项目名称:external-deqp,代码行数:15,
示例15: switchIterateResult NumLayersTest::build (FboBuilder& builder){ TextureLayered* texCfg = DE_NULL; const GLenum target = GL_COLOR_ATTACHMENT0; switch (m_params.textureKind) { case GL_TEXTURE_3D: texCfg = &builder.makeConfig<Texture3D>(); break; case GL_TEXTURE_2D_ARRAY: texCfg = &builder.makeConfig<Texture2DArray>(); break; default: DE_ASSERT(!"Impossible case"); } texCfg->internalFormat = getDefaultFormat(target, GL_TEXTURE); texCfg->width = 64; texCfg->height = 64; texCfg->numLayers = m_params.numLayers; const GLuint tex = builder.glCreateTexture(*texCfg); TextureLayerAttachment* att = &builder.makeConfig<TextureLayerAttachment>(); att->layer = m_params.attachmentLayer; att->imageName = tex; builder.glAttach(target, att); return STOP;}
开发者ID:crucible,项目名称:deqp,代码行数:30,
示例16: deTimer_destroyvoid deTimer_destroy (deTimer* timer){ DE_ASSERT(timer); timer_delete(timer->timer); deFree(timer);}
开发者ID:MIPS,项目名称:external-deqp,代码行数:7,
示例17: deMutex_destroyvoid deMutex_destroy (deMutex mutex){ pthread_mutex_t* pMutex = (pthread_mutex_t*)mutex; DE_ASSERT(pMutex); pthread_mutex_destroy(pMutex); deFree(pMutex);}
开发者ID:MIPS,项目名称:external-deqp,代码行数:7,
示例18: deTimerThread_createstatic deTimerThread* deTimerThread_create (deTimerCallback callback, void* arg, int interval, TimerState state){ deTimerThread* thread = (deTimerThread*)deCalloc(sizeof(deTimerThread)); DE_ASSERT(state == TIMERSTATE_INTERVAL || state == TIMERSTATE_SINGLE); if (!thread) return DE_NULL; thread->callback = callback; thread->callbackArg = arg; thread->interval = interval; thread->lock = deMutex_create(DE_NULL); thread->state = state; thread->thread = deThread_create(timerThread, thread, DE_NULL); if (!thread->thread) { deMutex_destroy(thread->lock); deFree(thread); return DE_NULL; } return thread;}
开发者ID:MIPS,项目名称:external-deqp,代码行数:25,
示例19: Java_com_drawelements_deqp_execserver_ExecService_onCreateNativeDE_BEGIN_EXTERN_CJNIEXPORT void JNICALL Java_com_drawelements_deqp_execserver_ExecService_onCreateNative (JNIEnv* env, jobject obj){ tcu::Android::ExecService* service = DE_NULL; JavaVM* vm = DE_NULL; try { DE_ASSERT(!getExecService(env, obj)); env->GetJavaVM(&vm); TCU_CHECK_INTERNAL(vm); service = new tcu::Android::ExecService(vm, obj); service->start(); setExecService(env, obj, service); } catch (const std::exception& e) { logException(e); delete service; tcu::die("ExecService.onCreateNative() failed"); }}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:26,
示例20: inStreamCopystatic void inStreamCopy (void* arg){ deThreadInStream* threadStream = (deThreadInStream*)arg; deUint8* buffer = malloc(sizeof(deUint8) * threadStream->bufferSize); for(;;) { deInt32 read = 0; deInt32 written = 0; deStreamResult readResult = DE_STREAMRESULT_ERROR; readResult = deInStream_read(threadStream->input, buffer, threadStream->bufferSize, &read); DE_ASSERT(readResult != DE_STREAMRESULT_ERROR); while (written < read) { deInt32 wrote = 0; /* /todo [mika] Handle errors */ deOutStream_write(&(threadStream->producerStream), buffer, read - written, &wrote); written += wrote; } if (readResult == DE_STREAMRESULT_END_OF_STREAM) { break; } } deOutStream_flush(&(threadStream->producerStream)); deRingbuffer_stop(threadStream->ringbuffer); free(buffer);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:35,
示例21: deSemaphore_destroyvoid deSemaphore_destroy (deSemaphore semaphore){ sem_t* sem = (sem_t*)semaphore; DE_ASSERT(sem); sem_destroy(sem); deFree(sem);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:7,
示例22: writeCaseListNodestatic void writeCaseListNode (std::ostream& str, const TestNode* node, const TestSet& testSet){ DE_ASSERT(testSet.hasNode(node)); TestNodeType nodeType = node->getNodeType(); if (nodeType != TESTNODETYPE_ROOT) str << node->getName(); if (nodeType == TESTNODETYPE_ROOT || nodeType == TESTNODETYPE_GROUP) { const TestGroup* group = static_cast<const TestGroup*>(node); bool isFirst = true; str << "{"; for (int ndx = 0; ndx < group->getNumChildren(); ndx++) { const TestNode* child = group->getChild(ndx); if (testSet.hasNode(child)) { if (!isFirst) str << ","; writeCaseListNode(str, child, testSet); isFirst = false; } } str << "}"; }}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:33,
示例23: deSemaphore_decrementvoid deSemaphore_decrement (deSemaphore semaphore){ sem_t* sem = (sem_t*)semaphore; int ret = sem_wait(sem); DE_ASSERT(ret == 0); DE_UNREF(ret);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:7,
示例24: DE_ASSERTvoid VarTokenizer::advance (void){ DE_ASSERT(m_token != TOKEN_END); m_tokenStart += m_tokenLen; m_token = TOKEN_LAST; m_tokenLen = 1; if (m_str[m_tokenStart] == '[') m_token = TOKEN_LEFT_BRACKET; else if (m_str[m_tokenStart] == ']') m_token = TOKEN_RIGHT_BRACKET; else if (m_str[m_tokenStart] == 0) m_token = TOKEN_END; else if (m_str[m_tokenStart] == '.') m_token = TOKEN_PERIOD; else if (isNum(m_str[m_tokenStart])) { m_token = TOKEN_NUMBER; while (isNum(m_str[m_tokenStart+m_tokenLen])) m_tokenLen += 1; } else if (isIdentifierChar(m_str[m_tokenStart])) { m_token = TOKEN_IDENTIFIER; while (isIdentifierChar(m_str[m_tokenStart+m_tokenLen])) m_tokenLen += 1; } else TCU_FAIL("Unexpected character");}
开发者ID:MIPS,项目名称:external-deqp,代码行数:31,
示例25: getCharvoid ContainerFormatParser::advance (void){ if (m_element != CONTAINERELEMENT_INCOMPLETE) { m_buf.popBack(m_elementLen); m_element = CONTAINERELEMENT_INCOMPLETE; m_elementLen = 0; m_attribute.clear(); m_value.clear(); } for (;;) { int curChar = getChar(m_elementLen); if (curChar != (int)END_OF_BUFFER) m_elementLen += 1; if (curChar == END_OF_STRING) { if (m_elementLen == 1) m_element = CONTAINERELEMENT_END_OF_STRING; else if (m_state == STATE_CONTAINER_LINE) parseContainerLine(); else m_element = CONTAINERELEMENT_TEST_LOG_DATA; break; } else if (curChar == (int)END_OF_BUFFER) { if (m_elementLen > 0 && m_state == STATE_DATA) m_element = CONTAINERELEMENT_TEST_LOG_DATA; break; } else if (curChar == '/r' || curChar == '/n') { // Check for /r/n int nextChar = getChar(m_elementLen); if (curChar == '/n' || (nextChar != (int)END_OF_BUFFER && nextChar != '/n')) { if (m_state == STATE_CONTAINER_LINE) parseContainerLine(); else m_element = CONTAINERELEMENT_TEST_LOG_DATA; m_state = STATE_AT_LINE_START; break; } // else handle following end or /n in next iteration. } else if (m_state == STATE_AT_LINE_START) { DE_ASSERT(m_elementLen == 1); m_state = (curChar == '#') ? STATE_CONTAINER_LINE : STATE_DATA; } }}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:60,
示例26: deSemaphore_decrementvoid deSemaphore_decrement (deSemaphore semaphore){ sem_t* sem = ((NamedSemaphore*)semaphore)->semaphore; int res = sem_wait(sem); DE_ASSERT(res == 0); DE_UNREF(res);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_deqp,代码行数:7,
示例27: qpTestLog_endSampleListdeBool qpTestLog_endSampleList (qpTestLog* log){ DE_ASSERT(log); deMutex_lock(log->lock); if (!qpXmlWriter_endElement(log->writer, "SampleList")) { qpPrintf("qpTestLog_endSampleList(): Writing XML failed/n"); deMutex_unlock(log->lock); return DE_FALSE; } DE_ASSERT(ContainerStack_pop(&log->containerStack) == CONTAINERTYPE_SAMPLELIST); deMutex_unlock(log->lock); return DE_TRUE;}
开发者ID:eth0047,项目名称:VK-GL-CTS,代码行数:17,
示例28: qpTestLog_startSampleInfodeBool qpTestLog_startSampleInfo (qpTestLog* log){ DE_ASSERT(log); deMutex_lock(log->lock); if (!qpXmlWriter_startElement(log->writer, "SampleInfo", 0, DE_NULL)) { qpPrintf("qpTestLog_startSampleInfo(): Writing XML failed/n"); deMutex_unlock(log->lock); return DE_FALSE; } DE_ASSERT(ContainerStack_push(&log->containerStack, CONTAINERTYPE_SAMPLEINFO)); deMutex_unlock(log->lock); return DE_TRUE;}
开发者ID:eth0047,项目名称:VK-GL-CTS,代码行数:17,
注:本文中的DE_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DE_CONST函数代码示例 C++ DE_ACT函数代码示例 |