这篇教程C++ ASSERT_MESSAGE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ASSERT_MESSAGE函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_MESSAGE函数的具体用法?C++ ASSERT_MESSAGE怎么用?C++ ASSERT_MESSAGE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ASSERT_MESSAGE函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ASSERT_MESSAGEvoid FaceInstance::update_move_planepts_vertex2(std::size_t index, std::size_t other){ ASSERT_MESSAGE(index < m_face->getWinding().size(), "select_vertex: invalid index"); const std::size_t opposite = m_face->getWinding().opposite(index, other); if (triangle_reversed(index, other, opposite)) { std::swap(index, other); } ASSERT_MESSAGE( triangles_same_winding( m_face->getWinding()[opposite].vertex, m_face->getWinding()[index].vertex, m_face->getWinding()[other].vertex, m_face->getWinding()[0].vertex, m_face->getWinding()[1].vertex, m_face->getWinding()[2].vertex ), "update_move_planepts_vertex2: error" ) m_face->m_move_planepts[0] = m_face->getWinding()[opposite].vertex; m_face->m_move_planepts[1] = m_face->getWinding()[index].vertex; m_face->m_move_planepts[2] = m_face->getWinding()[other].vertex; planepts_quantise(m_face->m_move_planepts, GRID_MIN); // winding points are very inaccurate}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:27,
示例2: Buttons_releasebool Buttons_release(ButtonMask& buttons, guint button, guint state){ if(buttons != 0 && bitfield_disable(buttons, ButtonMask_for_event_button(button)) == 0) { ASSERT_MESSAGE(!g_accel_enabled, "Buttons_release: accelerators are enabled"); g_accel_enabled = true; for(WindowSet::iterator i = g_accel_windows.begin(); i != g_accel_windows.end(); ++i) { GtkWindow* toplevel = *i; ASSERT_MESSAGE(!window_has_accel(toplevel), "ERROR"); ASSERT_MESSAGE(GTK_WIDGET_TOPLEVEL(toplevel), "enabling accel for non-toplevel window"); gtk_window_add_accel_group(toplevel, global_accel);#if 0 globalOutputStream() << reinterpret_cast<unsigned int>(toplevel) << ": enabled global accelerators/n";#endif#if 0 accel_group_test(toplevel, global_accel);#endif } GlobalQueuedAccelerators_commit(); } buttons = bitfield_disable(buttons, ButtonMask_for_event_button(button));#if 0 globalOutputStream() << "Buttons_release: "; print_buttons(buttons);#endif return false;}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:28,
示例3: Buttons_pressbool Buttons_press(ButtonMask& buttons, guint button, guint state){ if(buttons == 0 && bitfield_enable(buttons, ButtonMask_for_event_button(button)) != 0) { ASSERT_MESSAGE(g_accel_enabled, "Buttons_press: accelerators not enabled"); g_accel_enabled = false; for(WindowSet::iterator i = g_accel_windows.begin(); i != g_accel_windows.end(); ++i) { GtkWindow* toplevel = *i; ASSERT_MESSAGE(window_has_accel(toplevel), "ERROR"); ASSERT_MESSAGE(GTK_WIDGET_TOPLEVEL(toplevel), "disabling accel for non-toplevel window"); gtk_window_remove_accel_group(toplevel, global_accel);#if 0 globalOutputStream() << reinterpret_cast<unsigned int>(toplevel) << ": disabled global accelerators/n";#endif#if 0 accel_group_test(toplevel, global_accel);#endif } } buttons = bitfield_enable(buttons, ButtonMask_for_event_button(button));#if 0 globalOutputStream() << "Buttons_press: "; print_buttons(buttons);#endif return false;}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:27,
示例4: ASSERT_MESSAGEvoid CCBinaryFile::setPosition(const uint pos){ ASSERT_MESSAGE( m_File != NULL, "File::Position(...) : ERROR! File not open" ); ASSERT_MESSAGE( pos < m_Size, "File::Position(...) : ERROR! Invalid file position" ); fseek( m_File, pos, SEEK_SET ); m_Position = pos;}
开发者ID:Orange-OpenSource,项目名称:2c,代码行数:8,
示例5: logMsgvoid example_test_class::test_assert_message(){ logMsg("ASSERT_MESSAGE example"); /* Wrapper of void assertTrue(const char * msg, bool expression , const char* file, int line); */ ASSERT_MESSAGE(1 < 2, "ASSERT_MESSAGE example (true)"); ASSERT_MESSAGE(1 > 2, "ASSERT_MESSAGE example (fail) - EXPECTED failure");}
开发者ID:hossainmurad,项目名称:mycppcgi,代码行数:11,
示例6: ASSERTbool Cx_CfgRecord::AddFieldValue(const std::wstring& wstrField, const std::wstring& wstrValue){ ASSERT(IsValid() && !wstrValue.empty()); ASSERT_MESSAGE(DbFunc::IsDBName(wstrField.c_str()), "Invalid field name."); ASSERT_MESSAGE(!HasFieldValue(wstrField), "The field has already set value."); m_arrValue.push_back(FieldValue(wstrField, wstrValue)); return true;}
开发者ID:killvxk,项目名称:WebbrowserLock,代码行数:11,
示例7: seteuidvoid ApplicationContextImpl::initialise(int argc, char* argv[]) { // Give away unnecessary root privileges. // Important: must be done before calling gtk_init(). char *loginname; struct passwd *pw; seteuid(getuid()); if (geteuid() == 0 && (loginname = getlogin()) != 0 && (pw = getpwnam(loginname)) != 0) { setuid(pw->pw_uid); } initArgs(argc, argv); // Initialise the home directory path std::string home = os::standardPathWithSlash(g_get_home_dir()) + ".darkradiant/"; os::makeDirectory(home); _homePath = home; { char real[PATH_MAX]; _appPath = getexename(real, argv); ASSERT_MESSAGE(!_appPath.empty(), "failed to deduce app path"); } // Initialise the relative paths initPaths();}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:30,
示例8: ASSERT_MESSAGEvoid Dialog::Destroy(){ ASSERT_MESSAGE(m_window != 0, "dialog cannot be destroyed"); gtk_widget_destroy(GTK_WIDGET(m_window)); m_window = 0;}
开发者ID:clbr,项目名称:netradiant,代码行数:7,
示例9: unrealise ~ModelResource () { if (realised()) { unrealise(); } ASSERT_MESSAGE(!realised(), "ModelResource::~ModelResource: resource reference still realised: " << m_name); }
开发者ID:kevlund,项目名称:ufoai,代码行数:7,
示例10: Winding_Oppositestd::size_t Winding_Opposite(const Winding& winding, const std::size_t index, const std::size_t other){ ASSERT_MESSAGE(index < winding.numpoints && other < winding.numpoints, "Winding_Opposite: index out of range"); double dist_best = 0; std::size_t index_best = c_brush_maxFaces; Ray edge(ray_for_points(winding[index].vertex, winding[other].vertex)); for(std::size_t i=0; i<winding.numpoints; ++i) { if(i == index || i == other) { continue; } double dist_squared = ray_squared_distance_to_point(edge, winding[i].vertex); if(dist_squared > dist_best) { dist_best = dist_squared; index_best = i; } } return index_best;}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:26,
示例11: ASSERT_MESSAGEvoid CCJNI::BillingRequestPurchase(const char *productID, CCLambdaCallback *callback){ if( billingCallback != NULL ) { delete billingCallback; } billingCallback = callback; CCText androidProductID = productID; androidProductID.toLowercase(); // JNI Java call JNIEnv *jEnv = gView->jniEnv; jclass jniClass = jEnv->FindClass( "com/android2c/CCJNI" ); ASSERT_MESSAGE( jniClass != 0, "Could not find Java class." ); // Get the method ID of our method "startVideoView", which takes one parameter of type string, and returns void static jmethodID mid = jEnv->GetStaticMethodID( jniClass, "BillingRequestPurchase", "(Ljava/lang/String;)V" ); ASSERT( mid != 0 ); // Call the function jstring javaURL = jEnv->NewStringUTF( androidProductID.buffer ); jEnv->CallStaticVoidMethod( jniClass, mid, javaURL ); //jEnv->DeleteLocalRef( javaURL );}
开发者ID:Geek365,项目名称:PhoneWarsDemo,代码行数:26,
示例12: mergeSelectedBrushesvoid mergeSelectedBrushes(const cmd::ArgumentList& args){ // Get the current selection BrushPtrVector brushes = selection::algorithm::getSelectedBrushes(); if (brushes.empty()) { rMessage() << _("CSG Merge: No brushes selected.") << std::endl; wxutil::Messagebox::ShowError(_("CSG Merge: No brushes selected.")); return; } if (brushes.size() < 2) { rMessage() << "CSG Merge: At least two brushes have to be selected./n"; wxutil::Messagebox::ShowError("CSG Merge: At least two brushes have to be selected."); return; } rMessage() << "CSG Merge: Merging " << brushes.size() << " brushes." << std::endl; UndoableCommand undo("mergeSelectedBrushes"); // Take the last selected node as reference for layers and parent scene::INodePtr merged = GlobalSelectionSystem().ultimateSelected(); scene::INodePtr parent = merged->getParent(); assert(parent != NULL); // Create a new BrushNode scene::INodePtr node = GlobalBrushCreator().createBrush(); // Insert the newly created brush into the (same) parent entity parent->addChildNode(node); // Move the new brush to the same layers as the merged one node->assignToLayers(merged->getLayers()); // Get the contained brush Brush* brush = Node_getBrush(node); // Attempt to merge the selected brushes into the new one if (!Brush_merge(*brush, brushes, true)) { rWarning() << "CSG Merge: Failed - result would not be convex." << std::endl; return; } ASSERT_MESSAGE(!brush->empty(), "brush left with no faces after merge"); // Remove the original brushes for (BrushPtrVector::iterator i = brushes.begin(); i != brushes.end(); ++i) { scene::removeNodeFromParent(*i); } // Select the new brush Node_setSelected(node, true); rMessage() << "CSG Merge: Succeeded." << std::endl; SceneChangeNotify();}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:60,
示例13: ASSERT_MESSAGEvoid GroupDlg::Create(GtkWindow* parent){ ASSERT_MESSAGE(m_window == 0, "dialog already created"); GtkWindow* window = create_persistent_floating_window("Entities", parent); global_accel_connect_window(window); window_connect_focus_in_clear_focus_widget(window); m_window = window;#ifdef WIN32 if( g_multimon_globals.m_bStartOnPrimMon ) { WindowPosition pos(m_position_tracker.getPosition()); PositionWindowOnPrimaryScreen(pos); m_position_tracker.setPosition(pos); }#endif m_position_tracker.connect(window); { GtkWidget* notebook = gtk_notebook_new(); gtk_widget_show(notebook); gtk_container_add (GTK_CONTAINER (window), notebook); gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook), GTK_POS_BOTTOM); m_pNotebook = notebook; g_signal_connect(G_OBJECT(notebook), "switch_page", G_CALLBACK(switch_page), window); }}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:32,
示例14: ASSERT_MESSAGEvoid Clipper::getPlanePoints(Vector3 planepts[3], const AABB& bounds) const { ASSERT_MESSAGE(valid(), "clipper points not initialised"); planepts[0] = _clipPoints[0]._coords; planepts[1] = _clipPoints[1]._coords; planepts[2] = _clipPoints[2]._coords; Vector3 maxs(bounds.origin + bounds.extents); Vector3 mins(bounds.origin - bounds.extents); if (!_clipPoints[2].isSet()) { int n = (_viewType == XY) ? 2 : (_viewType == YZ) ? 0 : 1; int x = (n == 0) ? 1 : 0; int y = (n == 2) ? 1 : 2; if (n == 1) // on viewtype XZ, flip clip points { planepts[0][n] = maxs[n]; planepts[1][n] = maxs[n]; planepts[2][x] = _clipPoints[0]._coords[x]; planepts[2][y] = _clipPoints[0]._coords[y]; planepts[2][n] = mins[n]; } else { planepts[0][n] = mins[n]; planepts[1][n] = mins[n]; planepts[2][x] = _clipPoints[0]._coords[x]; planepts[2][y] = _clipPoints[0]._coords[y]; planepts[2][n] = maxs[n]; } }}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:32,
示例15: GetListInternalstatic GSList* GetListInternal (const char *refdir, const char *ext, bool directories, std::size_t depth){ GSList* files = 0; ASSERT_MESSAGE(refdir[strlen(refdir) - 1] == '/', "search path does not end in '/'"); if(directories) { for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) { DirectoryListVisitor visitor(files, refdir); (*i).archive->forEachFile(Archive::VisitorFunc(visitor, Archive::eDirectories, depth), refdir); } } else { for(archives_t::iterator i = g_archives.begin(); i != g_archives.end(); ++i) { FileListVisitor visitor(files, refdir, ext); (*i).archive->forEachFile(Archive::VisitorFunc(visitor, Archive::eFiles, depth), refdir); } } files = g_slist_reverse(files); return files;}
开发者ID:clbr,项目名称:netradiant,代码行数:27,
示例16: _sigSelectionChanged// greebo: This should be called "onComponentSelectionChanged", as it is a similar function of the above one// Updates the internal list of component nodes if the component selection gets changedvoid RadiantSelectionSystem::onComponentSelection(const scene::INodePtr& node, const Selectable& selectable) { int delta = selectable.isSelected() ? +1 : -1; _countComponent += delta; _sigSelectionChanged(selectable); _selectionInfo.totalCount += delta; _selectionInfo.componentCount += delta; // If the instance got selected, add it to the list, otherwise remove it if (selectable.isSelected()) { _componentSelection.append(node); } else { _componentSelection.erase(node); } // Notify observers, TRUE => this is a component selection change notifyObservers(node, true); // Check if the number of selected components in the list matches the value of the selection counter ASSERT_MESSAGE(_componentSelection.size() == _countComponent, "component selection-tracking error"); // Schedule an idle callback requestIdleCallback(); _requestWorkZoneRecalculation = true; _requestSceneGraphChange = true;}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:32,
示例17: ASSERT_MESSAGE const detail::DeviceBuffer& Vector<Index>::deviceBuffer(const detail::Device& /*device*/) const { ASSERT_MESSAGE(false, "This function should never be called!"); static detail::DeviceBuffer db; return db; }
开发者ID:skelcl,项目名称:skelcl,代码行数:7,
示例18: ASSERT_MESSAGEstd::size_t Winding::opposite(const std::size_t index, const std::size_t other) const{ ASSERT_MESSAGE(index < size() && other < size(), "Winding::opposite: index out of range"); float dist_best = 0; std::size_t index_best = c_brush_maxFaces; Ray edge = Ray::createForPoints((*this)[index].vertex, (*this)[other].vertex); for (std::size_t i=0; i < size(); ++i) { if (i == index || i == other) { continue; } float dist_squared = edge.getSquaredDistance((*this)[i].vertex); if (dist_squared > dist_best) { dist_best = dist_squared; index_best = i; } } return index_best;}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:25,
示例19: _selectionChangedCallbacks// This is called if the selection changes, so that the local list of selected instances can be updatedvoid RadiantSelectionSystem::onSelectedChanged(scene::Instance& instance, const Selectable& selectable) { // Cache the selection state bool isSelected = selectable.isSelected(); _countPrimitive += (isSelected) ? +1 : -1; _selectionChangedCallbacks(selectable); // legacy _selectionInfo.totalCount += (isSelected) ? +1 : -1; if (Instance_getBrush(instance) != NULL) { _selectionInfo.brushCount += (isSelected) ? +1 : -1; } else { _selectionInfo.entityCount += (isSelected) ? +1 : -1; } // If the selectable is selected, add it to the local selection list, otherwise remove it if (isSelected) { _selection.append(instance); } else { _selection.erase(instance); } // Notify observers, FALSE = primitive selection change notifyObservers(instance, false); // Check if the number of selected primitives in the list matches the value of the selection counter ASSERT_MESSAGE(_selection.size() == _countPrimitive, "selection-tracking error"); // Schedule an idle callback requestIdleCallback(); _requestWorkZoneRecalculation = true;}
开发者ID:AresAndy,项目名称:ufoai,代码行数:36,
示例20: ASSERT_MESSAGEbool Cx_CfgRecord::GetDateTime(const wchar_t* pszEntry, int& year, int& month, int& day, int& hour, int& minute, int& second){ ASSERT_MESSAGE(m_pRs != NULL, "The record is write-only."); if (m_pRs != NULL) { try { _variant_t var(m_pRs->GetFields()->GetItem(pszEntry)->GetValue()); COleDateTime dt; if (DbFunc::GetDateTime(dt, var)) { year = dt.GetYear(); month = dt.GetMonth(); day = dt.GetDay(); hour = dt.GetHour(); minute = dt.GetMinute(); second = dt.GetSecond(); return true; } } CATCH_DB_STR_ERROR } return false;}
开发者ID:killvxk,项目名称:WebbrowserLock,代码行数:29,
示例21: ASSERT_MESSAGEvoid Node::evaluateBounds() const{ if (_boundsChanged) { ASSERT_MESSAGE(!_boundsMutex, "re-entering bounds evaluation"); _boundsMutex = true; _bounds = childBounds(); _bounds.includeAABB( AABB::createFromOrientedAABBSafe(localAABB(), localToWorld()) ); _boundsMutex = false; _boundsChanged = false; // Now that our bounds are re-calculated, notify the scenegraph GraphPtr sceneGraph = _sceneGraph.lock(); if (sceneGraph) { sceneGraph->nodeBoundsChanged(const_cast<Node*>(this)->shared_from_this()); } }}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:25,
示例22: window_get_positionvoid window_get_position(ui::Window window, WindowPosition &position){ ASSERT_MESSAGE( window , "error saving window position" ); gtk_window_get_position( window, &position.x, &position.y ); gtk_window_get_size( window, &position.w, &position.h );}
开发者ID:xonotic,项目名称:netradient,代码行数:7,
示例23: bitmap_initvoidbitmap_init(Bitmap *bitmap, i32 width, i32 height, void *pixels, int bpp){ Palette *palette = &CORE->palette; u32 size = width * height; bitmap->width = width; bitmap->height = height; bitmap->pixels = (u8 *)bank_push(CORE->storage, size); if (pixels) { if (bpp == BITMAP_32) { Color pixel; Color *pixels_end = ((Color *)pixels) + size; Color *pixels_it = (Color *)pixels; u8 *it = bitmap->pixels; u8 ix; for (; pixels_it != pixels_end; ++pixels_it) { if (pixels_it->a < 0x7F) { ix = COLOR_TRANSPARENT; // pixels_it->a = 0; goto next; } pixel = *pixels_it; // TODO: This is just for Windows, need to be done a bit better. pixel.b = pixels_it->r; pixel.r = pixels_it->b; pixel.a = 0xFF; for (ix = 1; ix < palette->colors_count; ix++) { if (palette->colors[ix].rgba == pixel.rgba) goto next; } // Add the color. ASSERT(palette->colors_count != 0xFF); if (palette->colors_count != 0xFF) { ix = palette->colors_count; palette->colors[ix] = pixel; palette->colors_count++; // printf("[palette] + #%0.2x %0.2x%0.2x%0.2x%0.2x/n", // ix, pixel.r, pixel.g, pixel.b, pixel.a); } next: // Write the indexed color. *it++ = ix; } } else if (bpp == BITMAP_8) { memcpy(bitmap->pixels, pixels, size); } else { ASSERT_MESSAGE(0, "bitmap_init: Invalid bpp specified."); } } // if pixels}
开发者ID:gingerBill,项目名称:LD35,代码行数:59,
示例24: ASSERT_MESSAGEvoid OpenGLRenderSystem::forEachRenderable(const RenderableCallback& callback) const { ASSERT_MESSAGE(!m_traverseRenderablesMutex, "for-each during traversal"); m_traverseRenderablesMutex = true; for (Renderables::const_iterator i = m_renderables.begin(); i != m_renderables.end(); ++i) { callback(*(*i)); } m_traverseRenderablesMutex = false;}
开发者ID:codereader,项目名称:DarkRadiant,代码行数:8,
示例25: CXTPWinDwmWrapperbool CFrameWndFactory::CreateFrameWnd(LPCWSTR factoryFile){ CXTPWinDwmWrapper().SetProcessDPIAware(); // Support high DPI on Vista or above. std::wstring xtpfile(getTranslationsPath(L"ToolkitPro.Resource.xml")); if (PathFileExistsW(xtpfile.c_str())) XTPResourceManager()->SetResourceFile(xtpfile.c_str()); else TRACE1("Warning: no translation file '%s'/n", xtpfile.c_str()); Object<IConfigXml> xmlfile(x3::clsidXmlFile); ASSERT_MESSAGE(xmlfile, "Need the configxml plugin."); xmlfile->SetFileName((getConfigPath() + factoryFile).c_str()); ASSERT_MESSAGE(xmlfile->Reload(), "No xml file or need to setup MSXML4."); ConfigSection root(xmlfile->GetData()->GetSection(L"")); ConfigSection mainframe(root.GetSection(L"mainframe")); bool mdi = root->GetBool(L"mdi", false); g_factoryRoot = root; g_factoryRoot->SetString(L"_appid", m_appid.c_str()); Object<IUIOptionsInit> initOptions(clsidUIOptions); initOptions->setFileName((getConfigPath() + root->GetString(L"optionsFile", L"uioptions.xml")).c_str()); RegisterDocTemplate(mdi, mainframe, root.GetSection(L"views")); if (mdi) { CMainMDIFrame* pFrame = new CMainMDIFrame; if (!pFrame->LoadFrame(0)) return FALSE; std::vector<ViewItem>::const_iterator it = s_views.begin(); for (; it != s_views.end(); ++it) { if (!it->caption.empty()) { CDocument* pDoc = it->pTemplate->OpenDocumentFile(NULL); pDoc->SetTitle(it->caption.c_str()); } } } return ProcessShellCommand();}
开发者ID:cw2018,项目名称:xtpui,代码行数:46,
示例26: unrealise ~ModelResource() { if(realised()) { unrealise(); } ASSERT_MESSAGE(!realised(), "ModelResource::~ModelResource: resource reference still realised: " << makeQuoted(m_name.c_str())); }
开发者ID:clbr,项目名称:netradiant,代码行数:8,
注:本文中的ASSERT_MESSAGE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ASSERT_MSG函数代码示例 C++ ASSERT_MAIN_THREAD函数代码示例 |