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

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

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

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

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

示例1: test_vm_alloc

int test_vm_alloc() {	int i;	int *baz, *buf = vm_zalloc(tvm, sizeof(int) * 16);	ASSERT_NOTNULL(buf);	for (i = 0; i < 16; ++i)		ASSERT_EQ(int, buf[i], 0);	vm_free(tvm, buf);	buf = vm_zalloc(tvm, sizeof(int) * 4096);	ASSERT_NOTNULL(buf);	for (i = 0; i < 4096; ++i)		ASSERT_EQ(int, buf[i], 0);	vm_free(tvm, buf);	buf = vm_zalloc(tvm, sizeof(int) * 32);	for (i = 0; i < 32; ++i)		ASSERT_EQ(int, buf[i], 0);	baz = vm_realloc(tvm, buf, sizeof(int) * 4096);	ASSERT_TRUE(buf == baz);	for (i = 0; i < 32; ++i)		ASSERT_EQ(int, baz[i], 0);		vm_free(tvm, vm_zalloc(tvm, 16));	buf = vm_realloc(tvm, baz, sizeof(int) * 1024 * 4096);	ASSERT_FALSE(buf == baz);	return 0;}
开发者ID:ziyoudefeng,项目名称:ymd,代码行数:28,


示例2: GetCurDisplay

void GetCurDisplay(HDC& rCompatibleHDC, HBITMAP& rHbitmap){    HDC desktopDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL);    ASSERT_NOTNULL(desktopDC);    int cx = GetDeviceCaps(desktopDC, HORZRES);    int cy = GetDeviceCaps(desktopDC, VERTRES);    rCompatibleHDC = CreateCompatibleDC(desktopDC);    ASSERT_NOTNULL(rCompatibleHDC);    rHbitmap = CreateCompatibleBitmap(desktopDC, cx, cy);    ASSERT_NOTNULL(rHbitmap);    HBITMAP oldbitMap = (HBITMAP)SelectObject(rCompatibleHDC, rHbitmap);    // 因为在正常得到的图像是颠倒的,所以需要在之前处理成反的    //int res = BitBlt(rCompatibleHDC, 0, cy, cx, -1*cy, desktopDC, 0, 0, SRCCOPY);    /*    StretchBlt也允许水平或垂直翻转图像。如果cxSrc和cxDst标记(转换成设备单位以后)不同,    那么StretchBlt就建立一个镜像:左右翻转。在STRETCH程序中,通过将xDst参数改为cxClient并将cxDst参数改成-cxClient,    就可以做到这一点。如果cySrc和cyDst不同,则StretchBlt会上下翻转图像。要在STRETCH程序中测试这一点,    可将yDst参数改为cyClient并将cyDst参数改成-cyClient。    */    int res = StretchBlt(rCompatibleHDC, 0, cy, cx, -1*cy, desktopDC, 0, 0, cx, cy,SRCCOPY);    //int res = StretchDIBits(rCompatibleHDC, 0, 0, cx, -1*cy, desktopDC, 0, 0, cx, cy,SRCCOPY);    ASSERT_NOTZERO(res);    rHbitmap = (HBITMAP)SelectObject(rCompatibleHDC, oldbitMap);    DeleteDC(desktopDC);}
开发者ID:wp4398151,项目名称:TestProjectJar,代码行数:32,


示例3: document

void BR::Database::load(std::string filename){  this->filename = filename;  size_t dir_pos = filename.find_last_of("///");  std::string filename_prefix = dir_pos == std::string::npos ? "" : filename.substr(0, dir_pos + 1);  std::string book_image_filename;  std::string book_info_filename;  TiXmlDocument document(filename.c_str());  if (!document.LoadFile())  {    throw DatabaseException("unable to load file: " + filename);  }  //get books  TiXmlElement * element = document.RootElement()->FirstChildElement("book");  do  {    Book * book = new Book();    //read XML    TiXmlElement * child = element->FirstChildElement("isbn");    ASSERT_NOTNULL(child, "Unknown file stucture. No ISBN Element.");    book->isbn = child->GetText();        child = child->NextSiblingElement("title");    ASSERT_NOTNULL(child, "Unknown file stucture. No title element.");    book->title = child->GetText();        child = child->NextSiblingElement("author");    ASSERT_NOTNULL(child, "Unknown file stucture. No author element.");    book->author = child->GetText();        child = child->NextSiblingElement("image_filename");    ASSERT_NOTNULL(child, "Unknown file stucture. No image filename.");    book_image_filename = filename_prefix +  child->GetText();        child = child->NextSiblingElement("image_info_filename");    ASSERT_NOTNULL(child, "Unknown file stucture. No image info filename.");    book_info_filename = filename_prefix + child->GetText();    //load structures    cv::FileStorage fs(book_info_filename, cv::FileStorage::READ);    cv::read(fs["keypoints"], book->keypoints);    fs["descriptors"] >> book->descriptors;    fs.release();    //load image    book->image = cv::imread(book_image_filename);        books.push_back(book);  } while( (element = element->NextSiblingElement("book")) != NULL);}
开发者ID:barthez,项目名称:book-recognition-with-surf,代码行数:51,


示例4: test_cwmp_get_parameter_path_node

static void test_cwmp_get_parameter_path_node (abts_case *tc, void *data){    cwmp_t * c = (cwmp_t*)data;    parameter_node_t * param;    FUNCTION_TRACE();    param = cwmp_get_parameter_path_node(c->root, "InternetGatewayDevice.");    ASSERT_NOTNULL(param);    param = cwmp_get_parameter_path_node(c->root, "InternetGatewayDevice.WANDevice.{i}.WANConnectionNumberOfEntries");    ASSERT_NOTNULL(param);    param = cwmp_get_parameter_path_node(c->root, "InternetGatewayDevice.WANDevice.1.WANConnectionNumberOfEntries");    ASSERT_NULL(param);    }
开发者ID:HankMa,项目名称:netcwmp,代码行数:14,


示例5: TEST_P

TEST_P(Int32Compare, UsingLoadParam) {    auto param = TRTest::to_struct(GetParam());    char inputTrees[120] = {0};    std::snprintf(inputTrees, 120,       "(method return=Int32 args=[Int32, Int32] "         "(block "           "(ireturn "             "(%s "               "(iload parm=0) "               "(iload parm=1)))))",       param.opcode.c_str());    auto trees = parseString(inputTrees);    ASSERT_NOTNULL(trees);    Tril::DefaultCompiler compiler{trees};    ASSERT_EQ(0, compiler.compile()) << "Compilation failed unexpectedly/n" << "Input trees: " << inputTrees;    auto entry_point = compiler.getEntryPoint<int32_t (*)(int32_t, int32_t)>();    volatile auto exp = param.oracle(param.lhs, param.rhs);    volatile auto act = entry_point(param.lhs, param.rhs);    ASSERT_EQ(exp, act);}
开发者ID:jduimovich,项目名称:omr,代码行数:25,


示例6: test_getset_parameter_node_value

static void test_getset_parameter_node_value (abts_case *tc, void *data){    cwmp_t * c = (cwmp_t*)data;    parameter_node_t * param;    char * name = "InternetGatewayDevice.DeviceInfo.SoftwareVersion";    char * retval;    char * value ;        pool_t * pool = pool_create(POOL_DEFAULT_SIZE);    FUNCTION_TRACE();    param = cwmp_get_parameter_path_node(c->root, name);    ASSERT_NOTNULL(param);        value = "V1.3.x";    cwmp_set_parameter_node_value(c, param, name, value, strlen(value));        retval = cwmp_data_get_parameter_value(c, param, name, pool);    printf("retval ------------------is %s/n", retval);    ASSERT_STR_EQ(value, retval);           value = "V1.4.x";    cwmp_set_parameter_node_value(c, param, name, value, strlen(value));    retval = cwmp_data_get_parameter_value(c, param, name, pool);    ASSERT_STR_EQ(value, retval);            pool_destroy(pool);}
开发者ID:HankMa,项目名称:netcwmp,代码行数:32,


示例7: TEST_P

TEST_P(DoubleToFloat, UsingConst) {    auto param = TRTest::to_struct(GetParam());    char inputTrees[512] = {0};    std::snprintf(inputTrees, 512,        "(method return=Float"        "  (block"        "    (freturn"        "      (d2f"        "        (dconst %f) ) ) ) )",        param.value);    auto trees = parseString(inputTrees);    ASSERT_NOTNULL(trees);    Tril::DefaultCompiler compiler{trees};    ASSERT_EQ(0, compiler.compile()) << "Compilation failed unexpectedly/n" << "Input trees: " << inputTrees;    auto entry_point = compiler.getEntryPoint<float (*)()>();    volatile auto exp = param.oracle(param.value);    volatile auto act = entry_point();    if (std::isnan(exp)) {        ASSERT_EQ(std::isnan(exp), std::isnan(act));    } else {        ASSERT_EQ(exp, act);    }}
开发者ID:jduimovich,项目名称:omr,代码行数:28,


示例8: TEST_P

TEST_P(Int8ToInt32, UsingLoadParam) {    std::string arch = omrsysinfo_get_CPU_architecture();    SKIP_IF(OMRPORT_ARCH_S390 == arch || OMRPORT_ARCH_S390X == arch, KnownBug)        << "The Z code generator incorrectly spills sub-integer types arguments (see issue #3525)";    auto param = TRTest::to_struct(GetParam());    char *inputTrees =        "(method return=Int32 args=[Int8]"        "  (block"        "    (ireturn"        "      (b2i"        "        (bload parm=0) ) ) ) )";    auto trees = parseString(inputTrees);    ASSERT_NOTNULL(trees);    Tril::DefaultCompiler compiler{trees};    ASSERT_EQ(0, compiler.compile()) << "Compilation failed unexpectedly/n" << "Input trees: " << inputTrees;    auto entry_point = compiler.getEntryPoint<int32_t (*)(int8_t)>();    volatile auto exp = param.oracle(param.value);    volatile auto act = entry_point(param.value);    ASSERT_EQ(exp, act);}
开发者ID:hangshao0,项目名称:omr,代码行数:26,


示例9: renderSolid

		void renderSolid (Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected) const		{			if (selected) {				m_renderOrigin.render(renderer, volume, localToWorld);			}			ASSERT_NOTNULL(m_entity.getEntityClass().m_state_wire);			renderer.SetState(m_entity.getEntityClass().m_state_wire, Renderer::eWireframeOnly);		}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:9,


示例10: registerModule

		void registerModule (const std::string& type, int version, const std::string& name, Module& module)		{			ASSERT_NOTNULL(&module);			if (!m_modules.insert(Modules_::value_type(ModuleKey(ModuleType(type, version), name), &module)).second) {				g_warning("Module already registered: type='%s' name='%s'/n", type.c_str(), name.c_str());			} else {				g_message("Module registered: type='%s' version='%i' name='%s'/n", type.c_str(), version, name.c_str());			}		}
开发者ID:AresAndy,项目名称:ufoai,代码行数:9,


示例11: registerModule

void registerModule( const char* type, int version, const char* name, Module& module ){	ASSERT_NOTNULL( &module );	if ( !m_modules.insert( Modules_::value_type( ModuleKey( ModuleType( type, version ), name ), &module ) ).second ) {		globalErrorStream() << "module already registered: type=" << makeQuoted( type ) << " name=" << makeQuoted( name ) << "/n";	}	else	{		globalOutputStream() << "Module Registered: type=" << makeQuoted( type ) << " version=" << makeQuoted( version ) << " name=" << makeQuoted( name ) << "/n";	}}
开发者ID:Triang3l,项目名称:netradiant,代码行数:10,


示例12: ItoWStatic

bool C2DimensionSourceIndexFile::GenerateType(wstring* wstrColoumnName){	m_wstrResultContent += L"public:/r/n";	m_wstrResultContent += L"static const void* s_pColounm[";	m_wstrResultContent += ItoWStatic(m_ColumnCount);	m_wstrResultContent += L"];/r/n";	unsigned int curPos = m_wstrMetaRow.find(L"/t", 0) + 1;	int colIndex = 0;	while (curPos < m_wstrMetaRow.size())	{		wstring wFieldStr = m_wstrMetaRow.substr(curPos, m_wstrMetaRow.find(L"/t", curPos) - curPos);		int typePos = wFieldStr.find(L":", 0);		ASSERT_NEQU(typePos, string::npos);		wstring wstrFieldName = wFieldStr.substr(0, typePos);		wstring wstrType = wFieldStr.substr(typePos + 1, wFieldStr.size() - (typePos + 1));		TypeContainer *pTypeContainer = GetTypeContaner((WCHAR*)wstrType.c_str());		ASSERT_NOTNULL(pTypeContainer);		m_wstrResultContent += L"/t";		wstrColoumnName[colIndex] = wstrFieldName;		m_ConvertFunc[colIndex++] = pTypeContainer->pValueFunc;		m_wstrResultContent += L"static const ";		m_wstrResultContent += pTypeContainer->pMemberStr;		m_wstrResultContent += L" m_";		m_wstrResultContent += wstrFieldName;		m_wstrResultContent += L"[";		m_wstrResultContent += ItoWStatic(m_RowCount);		m_wstrResultContent += L"];/r/n";		curPos = m_wstrMetaRow.find(L"/t", curPos) + 1;	}	m_wstrResultContent += L"/t const static int m_Size;/r/n";	m_wstrResultContent += L"/t template<typename T>/r/n";	m_wstrResultContent += L"/t static bool GetCell(int x, int y, T& res){/r/n";	m_wstrResultContent += L"if (ISINRANGE(x, 0, ";	m_wstrResultContent += ItoWStatic(m_RowCount-1);	m_wstrResultContent += L") && ISINRANGE(y, 0, ";	m_wstrResultContent += ItoWStatic(m_ColumnCount - 1);	m_wstrResultContent += L")){/r/n";	m_wstrResultContent += L"res = ((T*)s_pColounm[y])[x];/r/n";	m_wstrResultContent += L"return true;";	m_wstrResultContent += L"}else{/r/n";	m_wstrResultContent += L"return false; }/r/n";	m_wstrResultContent += L"}/r/n";	m_wstrResultContent += L"};/r/n";		return true;}
开发者ID:layerfsd,项目名称:TestProjectJar,代码行数:53,


示例13: GetCaptureScreenDCRGBbits

char* GetCaptureScreenDCRGBbits(int& rWidth,int& rHeight, int& rPixelBitSize){    HDC compatibleHDC = NULL;    HBITMAP compatibleHbitmap = NULL;    compatibleHDC = NULL;    compatibleHbitmap = NULL;    GetCurDisplay(compatibleHDC, compatibleHbitmap);    ASSERT_NOTNULL(compatibleHDC);    ASSERT_NOTNULL(compatibleHbitmap);    BITMAPINFO rBmpinfo = { 0 };    GetBitmapInfo(rBmpinfo, compatibleHbitmap);    rWidth = rBmpinfo.bmiHeader.biWidth;    rHeight = rBmpinfo.bmiHeader.biHeight;    rPixelBitSize = rBmpinfo.bmiHeader.biBitCount;    char* lpRGBBits = GetBMPBinaryData(&rBmpinfo, compatibleHbitmap, compatibleHDC);    ASSERT_NOTNULL(lpRGBBits);    DeleteDC(compatibleHDC);    DeleteObject(compatibleHbitmap);    return lpRGBBits;}
开发者ID:wp4398151,项目名称:TestProjectJar,代码行数:21,


示例14: test_cwmp_session_create_addobject

static void test_cwmp_session_create_addobject(abts_case *tc, void *data){    cwmp_t * cwmp = (cwmp_t*)data;    pool_t * pool = pool_create(POOL_DEFAULT_SIZE);    xmldoc_t *  doc, *newdoc;    char * message = "<SOAP-ENV:Envelope xmlns:SOAP-ENV=/"http://schemas.xmlsoap.org/soap/envelope//" xmlns:SOAP-ENC=/"http://schemas.xmlsoap.org/soap/encoding//" xmlns:xsi=/"http://www.w3.org/2001/XMLSchema-instance/" /                       xmlns:xsd=/"http://www.w3.org/2001/XMLSchema/" xmlns:cwmp=/"urn:dslforum-org:cwmp-1-0/" xmlns=/"urn:dslforum-org:cwmp-1-0/"><SOAP-ENV:Header><cwmp:ID soap:mustUnderstand=/"1/">1234</cwmp:ID></SOAP-ENV:Header>  /                       <SOAP-ENV:Body><cwmp:AddObject><ObjectName>InternetGatewayDevice.WANDevice.</ObjectName><ParameterKey></ParameterKey></cwmp:AddObject></SOAP-ENV:Body></SOAP-ENV:Envelope>"    ;      printf("create session/n");     cwmp_session_t * session = cwmp_session_create(cwmp);    pool_create(POOL_DEFAULT_SIZE);   pool_create(POOL_DEFAULT_SIZE);  pool_create(POOL_DEFAULT_SIZE); pool_create(POOL_DEFAULT_SIZE);pool_create(POOL_DEFAULT_SIZE);pool_create(POOL_DEFAULT_SIZE);pool_create(POOL_DEFAULT_SIZE);pool_create(POOL_DEFAULT_SIZE); printf("open session /n");     cwmp_session_open(session);                cwmp_uint32_t msglength = strlen(message);    size_t len;    char *xmlbuf = pool_palloc(pool, msglength+32);    len = sprintf(xmlbuf,"<cwmp>");    strncpy(xmlbuf + len, message, msglength);    strcpy(xmlbuf + len + msglength, "</cwmp>");//    strcat(xmlbuf, "</cwmp>"); //   xmlbuf[len+msglength+7] = '/0';    printf("agent analyse xml: /n%s", xmlbuf);    doc = XmlParseBuffer(pool, xmlbuf);    ASSERT_NOTNULL(doc);        newdoc = cwmp_session_create_addobject_response_message(session, doc, pool);        cwmp_write_doc_to_chunk(newdoc, session->writers,  pool);        cwmp_chunk_print(session->writers);        pool_destroy(pool);}
开发者ID:HankMa,项目名称:netcwmp,代码行数:52,


示例15: HandleProc

            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)            {                PreventDefaultAction();                Unit* caster = eventInfo.GetActor();                caster->CastSpell(nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, aurEff);                Unit* target = eventInfo.GetProcTarget();                if (!target->CanHaveThreatList())                    return;                float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount());                target->GetThreatManager().AddThreat(caster, addThreat, GetSpellInfo(), false, true);            }
开发者ID:Refuge89,项目名称:TrinityCore,代码行数:13,


示例16: InitGlobalPrefPath

void CGameDialog::Init(){  InitGlobalPrefPath();  LoadPrefs();  ScanForGames();  if (mGames.empty())  {	  Error("Didn't find any valid game file descriptions, aborting/n");  }  else  {	  std::list<CGameDescription *>::iterator iGame, iPrevGame;	  for(iGame=mGames.begin(), iPrevGame = mGames.end(); iGame!=mGames.end(); iPrevGame = iGame, ++iGame)	  {		  if(iPrevGame != mGames.end())			  if(strcmp((*iGame)->getRequiredKeyValue("name"), (*iPrevGame)->getRequiredKeyValue("name")) < 0)			  {				  CGameDescription *h = *iGame;				  *iGame = *iPrevGame;				  *iPrevGame = h;			  }	  }  }   CGameDescription* currentGameDescription = 0;  if (!m_bGamePrompt)  {    // search by .game name    std::list<CGameDescription *>::iterator iGame;    for(iGame=mGames.begin(); iGame!=mGames.end(); ++iGame)    {      if ((*iGame)->mGameFile == m_sGameFile)      {        currentGameDescription = (*iGame);        break;      }    }  }  if (m_bGamePrompt || !currentGameDescription)  {    Create();    DoGameDialog();    // use m_nComboSelect to identify the game to run as and set the globals    currentGameDescription = GameDescriptionForComboItem();    ASSERT_NOTNULL(currentGameDescription);  }  g_pGameDescription = currentGameDescription;  g_pGameDescription->Dump();}
开发者ID:clbr,项目名称:netradiant,代码行数:51,


示例17: ASSERT_NOTNULL

void Channel::GetChannelName(std::string& channelName, uint32 channelId, LocaleConstant locale, AreaTableEntry const* zoneEntry){    if (channelId)    {        ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId);        if (!(channelEntry->Flags & CHANNEL_DBC_FLAG_GLOBAL))        {            if (channelEntry->Flags & CHANNEL_DBC_FLAG_CITY_ONLY)                channelName = Trinity::StringFormat(channelEntry->Name->Str[locale], sObjectMgr->GetTrinityString(LANG_CHANNEL_CITY, locale));            else                channelName = Trinity::StringFormat(channelEntry->Name->Str[locale], ASSERT_NOTNULL(zoneEntry)->AreaName->Str[locale]);        }        else            channelName = channelEntry->Name->Str[locale];    }}
开发者ID:Lyill,项目名称:TrinityCore,代码行数:16,


示例18: ASSERT_NOTNULL

EntityClass *Eclass_ForName(const char *name, bool has_brushes){	ASSERT_NOTNULL(name);  if(string_empty(name))  {    return eclass_bad;  }  EntityClasses::iterator i = g_entityClasses.find(name);  if(i != g_entityClasses.end() && string_equal((*i).first, name))  {    return (*i).second;  }	EntityClass* e = EntityClass_Create_Default(name, has_brushes);	return Eclass_InsertAlphabetized(e);}
开发者ID:clbr,项目名称:netradiant,代码行数:18,


示例19: MapResource_loadFile

bool MapResource_loadFile(const MapFormat& format, scene::Node& root, const char* filename){  globalOutputStream() << "Open file " << filename << " for read...";  TextFileInputStream file(filename);  if(!file.failed())  {    globalOutputStream() << "success/n";    ScopeDisableScreenUpdates disableScreenUpdates(path_get_filename_start(filename), "Loading Map");    ASSERT_NOTNULL(g_entityCreator);    format.readGraph(root, file, *g_entityCreator);    return true;  }  else  {    globalErrorStream() << "failure/n";    return false;  }}
开发者ID:clbr,项目名称:netradiant,代码行数:18,


示例20: importData

EMessageBoxReturn Dialog::DoModal(){  importData();  PreModal();  EMessageBoxReturn ret = modal_dialog_show(m_window, m_modal);  ASSERT_NOTNULL(m_window);  if(ret == eIDOK)  {    exportData();  }  gtk_widget_hide(GTK_WIDGET(m_window));  PostModal(m_modal.ret);  return m_modal.ret;}
开发者ID:clbr,项目名称:netradiant,代码行数:19,


示例21: EntityClassDoom3_findOrInsert

EntityClass* EntityClassDoom3_findOrInsert( const char *name, bool has_brushes ){	ASSERT_NOTNULL( name );	if ( string_empty( name ) ) {		return g_EntityClassDoom3_bad;	}	EntityClasses::iterator i = g_EntityClassDoom3_classes.find( name );	if ( i != g_EntityClassDoom3_classes.end()	     //&& string_equal((*i).first, name)		 ) {		return ( *i ).second;	}	EntityClass* e = EntityClass_Create_Default( name, has_brushes );	EntityClass* inserted = EntityClassDoom3_insertUnique( e );	ASSERT_MESSAGE( inserted == e, "" );	return inserted;}
开发者ID:xonotic,项目名称:netradient,代码行数:19,


示例22: TEST_F

TEST_F(IlGenTest, Return3) {    auto trees = parseString("(block (ireturn (iconst 3)))");    TR::TypeDictionary types;    auto Int32 = types.PrimitiveType(TR::Int32);    TR::IlType* argTypes[] = {Int32};    auto injector = Tril::TRLangBuilder{trees, &types};    TR::ResolvedMethod compilee{__FILE__, LINETOSTR(__LINE__), "Return3InIL", sizeof(argTypes)/sizeof(TR::IlType*), argTypes, Int32, 0, &injector};    TR::IlGeneratorMethodDetails methodDetails{&compilee};    int32_t rc = 0;    auto entry_point = compileMethodFromDetails(NULL, methodDetails, warm, rc);    ASSERT_EQ(0, rc) << "Compilation failed";    ASSERT_NOTNULL(entry_point) << "Entry point of compiled body cannot be null";    auto entry = reinterpret_cast<int32_t(*)(void)>(entry_point);    ASSERT_EQ(3, entry()) << "Compiled body did not return expected value";}
开发者ID:bjornvar,项目名称:omr,代码行数:19,


示例23: PreModal

EMessageBoxReturn Dialog::DoModal (){	// Import the values from the registry before showing the dialog	_registryConnector.importValues();	PreModal();	EMessageBoxReturn ret = modal_dialog_show(m_window, m_modal);	ASSERT_NOTNULL(m_window);	if (ret == eIDOK) {		_registryConnector.exportValues();	}	gtk_widget_hide(GTK_WIDGET(m_window));	PostModal(m_modal.ret);	return m_modal.ret;}
开发者ID:chrisglass,项目名称:ufoai,代码行数:19,


示例24: TEST_F

TEST_F(VectorTest, VDoubleAdd) {    auto inputTrees = "(method return= NoType args=[Address,Address,Address]           "                     "  (block                                                        "                     "     (vstorei type=VectorDouble offset=0                        "                     "         (aload parm=0)                                         "                     "            (vadd                                               "                     "                 (vloadi type=VectorDouble (aload parm=1))      "                     "                 (vloadi type=VectorDouble (aload parm=2))))    "                     "     (return)))                                                 ";    auto trees = parseString(inputTrees);    ASSERT_NOTNULL(trees);    //TODO: Re-enable this test on S390 after issue #1843 is resolved.     //    // This test is currently disabled on Z platforms because not all Z platforms    // have vector support. Determining whether a specific platform has the support    // at runtime is currently not possible in tril. So the test is being disabled altogether    // on Z for now.#ifndef TR_TARGET_S390    Tril::DefaultCompiler compiler{trees};    ASSERT_EQ(0, compiler.compile()) << "Compilation failed unexpectedly/n" << "Input trees: " << inputTrees;    auto entry_point = compiler.getEntryPoint<void (*)(double[],double[],double[])>();    //TODO: What do we query to determine vector width?      // -- This test currently assumes 128bit SIMD      double output[] =  {0.0, 0.0};    double inputA[] =  {1.0, 2.0};    double inputB[] =  {1.0, 2.0};    entry_point(output,inputA,inputB);     EXPECT_DOUBLE_EQ(inputA[0] + inputB[0], output[0]); // Epsilon = 4ULP -- is this necessary?     EXPECT_DOUBLE_EQ(inputA[1] + inputB[1], output[1]); // Epsilon = 4ULP -- is this necessary? #endif}
开发者ID:LinHu2016,项目名称:omr,代码行数:38,


示例25: FindBaseMap

Map* MapManager::CreateBaseMap(uint32 id){    Map* map = FindBaseMap(id);    if (!map)    {        MapEntry const* entry = sMapStore.AssertEntry(id);        if (entry->ParentMapID != -1)        {            CreateBaseMap(entry->ParentMapID);            // must have been created by parent map            map = FindBaseMap(id);            return ASSERT_NOTNULL(map);        }        std::lock_guard<std::mutex> lock(_mapsLock);        map = CreateBaseMap_i(entry);    }    ASSERT(map);    return map;}
开发者ID:090809,项目名称:TrinityCore,代码行数:23,


示例26: sizeof

bool C2DimensionFile::Generate(wstring& wstrMetaRow, int row, int colounm, list<wstring>& contentStrList){	m_ConvertFunc = (ValueFunc*)malloc(colounm * sizeof(ValueFunc));	m_RowCount = row;	m_ColumnCount = colounm;	m_wstrMetaRow = wstrMetaRow;	m_wstrMetaRow.replace(m_wstrMetaRow.find(L"/r"), 1, L"/t");	GenerateHeader();	wstring* wstrColoumnName = new wstring[colounm];	ASSERT_NOTNULL(wstrColoumnName);	GenerateType(wstrColoumnName);	GenerateFill(wstrColoumnName, contentStrList);		delete[] wstrColoumnName;	OutputDebugStringW(m_wstrResultContent.c_str());	return true;}
开发者ID:layerfsd,项目名称:TestProjectJar,代码行数:23,


示例27: test_kstr_creation

static int test_kstr_creation(struct ymd_mach *vm) {	const struct kstr *kz = kstr_fetch(vm, "abcdef", 6);	ASSERT_EQ(int, kz->marked, vm->gc.white);	ASSERT_NOTNULL(kz);	ASSERT_EQ(int, kz->type, T_KSTR);	ASSERT_STREQ(kz->land, "abcdef");	ASSERT_EQ(int, kz->len, 6);	kz = kstr_fetch(vm, "abcdef", 3);	ASSERT_EQ(int, kz->marked, vm->gc.white);	ASSERT_STREQ(kz->land, "abc");	ASSERT_EQ(int, kz->len, 3);	kz = kstr_fetch(vm, "abcdef", 0);	ASSERT_EQ(int, kz->marked, vm->gc.white);	ASSERT_STREQ(kz->land, "");	ASSERT_EQ(int, kz->len, 0);	kz = kstr_fetch(vm, "abcdefgh", -1);	ASSERT_EQ(int, kz->marked, vm->gc.white);	ASSERT_STREQ(kz->land, "abcdefgh");	ASSERT_EQ(int, kz->len, 8);	return 0;}
开发者ID:emptyland,项目名称:ymd,代码行数:24,



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


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