• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OP_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetFullPathName

OP_STATUS PlatformGadgetUtils::GetAbsolutePath(const OpString& file_path,
		OpString& absolute_path)
{
	const int abs_pathname_length =
			GetFullPathName(file_path, 0, NULL, NULL) - 1;
	if (0 != abs_pathname_length)
	{
		if (NULL != absolute_path.Reserve(abs_pathname_length))
		{
			const int actual_length =
					GetFullPathName(file_path, abs_pathname_length + 1,
							absolute_path.DataPtr(), NULL);
			if (0 != actual_length)
			{
				OP_ASSERT(abs_pathname_length == actual_length);
				OP_ASSERT(abs_pathname_length == absolute_path.Length());
				return OpStatus::OK;
			}
		}
	}
	return OpStatus::ERR;
}
开发者ID:prestocore,项目名称:browser,代码行数:22,代码来源:WindowsGadgetUtils.cpp


示例2: OP_ASSERT

void OpNumberEdit::OnChange(OpWidget *widget, BOOL changed_by_mouse /*= FALSE */)
{
	OP_ASSERT(widget == m_edit);
//	if (widget == m_edit)
	{
		if (listener)
		{
			listener->OnChange(this);
		}

		UpdateButtonState();
	}
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:OpNumberEdit.cpp


示例3: if

INT32 OpHotlistView::GetRootID()
{
	if (IsContacts())
		return HotlistModel::ContactRoot;
	else if (IsNotes())
		return HotlistModel::NoteRoot;
#ifdef WEBSERVER_SUPPORT
	else if (IsUniteServices())
		return HotlistModel::UniteServicesRoot;
#endif // WEBSERVER_SUPPORT
	OP_ASSERT(!"Unkown view type");
	return 0;
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:OpHotlistView.cpp


示例4: ShowProgress

void SyncPasswordImprovementDialog::OnInit()
{
	ShowProgress(FALSE);

	OpEdit* edit = static_cast<OpEdit*>(GetWidgetByName(SyncConstant::OLD_PASSWD_EDIT));
	OP_ASSERT(edit);
	if (edit)
		edit->SetPasswordMode(TRUE);

	BindEditWithPasswordStrength(SyncConstant::NEW_PASSWD_EDIT, SyncConstant::NEW_PASSWD_STRENGTH);

	OpIcon* warning_icon = static_cast<OpIcon*>(GetWidgetByName(SyncConstant::WARNING_ICON));
	OP_ASSERT(warning_icon);
	if (warning_icon)
	{
		warning_icon->SetImage("Dialog Warning");
	}

	OpLabel* header_label = static_cast<OpLabel*>(GetWidgetByName(SyncConstant::HEADER_LABEL));
	OP_ASSERT(header_label);
	if (header_label)
	{
		header_label->SetRelativeSystemFontSize(SyncConstant::HEADER_LABEL_REL_SIZE);
		SetLabelInBold(SyncConstant::HEADER_LABEL);
	}

	OpLabel* error_label = static_cast<OpLabel*>(GetWidgetByName(SyncConstant::ERROR_LABEL));
	OP_ASSERT(error_label);
	if (error_label)
	{
		error_label->SetForegroundColor(OP_RGB(255, 0, 0));
	}

	OpEdit* confirm_passwd_edit =
			static_cast<OpEdit*>(GetWidgetByName(SyncConstant::CONFIRM_NEW_PASSWD_EDIT));
	OP_ASSERT(confirm_passwd_edit);
	if (confirm_passwd_edit)
		confirm_passwd_edit->SetPasswordMode(TRUE);
}
开发者ID:prestocore,项目名称:browser,代码行数:39,代码来源:SyncPasswordImprovementDialog.cpp


示例5: OP_ASSERT

OP_STATUS PlatformGadgetList::Create(PlatformGadgetList** gadget_list)
{
	OP_ASSERT(NULL != gadget_list);
	if (NULL == gadget_list)
	{
		return OpStatus::ERR;
	}

	*gadget_list = OP_NEW(UnixGadgetList, ());
	RETURN_OOM_IF_NULL(*gadget_list);

	return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:unix_gadgetlist.cpp


示例6: OP_NEW_DBG

void
MediaSourceImpl::PauseBuffering()
{
	OP_NEW_DBG("PauseBuffering", "MediaSource");
	OP_DBG((""));

	OP_ASSERT(m_state == LOADING && IsStreaming());

	m_use_url->SetAttribute(URL::KPauseDownload, TRUE);
	m_state = PAUSED;
	for (OpListenersIterator iter(m_listeners); m_listeners.HasNext(iter);)
		m_listeners.GetNext(iter)->OnIdle(this);
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:mediasource.cpp


示例7: OP_ASSERT

OP_STATUS
ChatFileTransferManager::AddTransferItem(	ChatFileTransfer&	chat_transfer)
{
	OP_ASSERT(GetTransferItem(chat_transfer) == 0);

	OpString file_name;

	RETURN_IF_ERROR(chat_transfer.GetFileName(file_name));

	// Figure out where to save the file if we are receiving the file.
	OpFileLength dummy_resume;
	return AddTransferItem(chat_transfer, SEND, file_name, dummy_resume);
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:chat-filetransfer.cpp


示例8: GetTransferItem

OP_STATUS
ChatFileTransferManager::FileSendBegin(const ChatFileTransfer& chat_transfer)
{
	OpTransferItem* item = GetTransferItem(chat_transfer);
	if (item == 0)
		return OpStatus::ERR;

	TransferItem* transfer_item = (TransferItem *)(item);
	OP_ASSERT(transfer_item != 0);

	// Update status.
	return transfer_item->GetURL()->SetAttribute(URL::KLoadStatus, URL_LOADING);
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:chat-filetransfer.cpp


示例9: OP_ASSERT

SSL_KEA_ACTION SSL_Certificate_st::ProcessMessage(SSL_ConnectionState *pending)
{
    OP_ASSERT(pending && pending->session && pending->key_exchange);

    pending->session->Site_Certificate = *this;
    if(pending->session->Site_Certificate.Error())
        return SSL_KEA_Handle_Errors;
#ifndef TLS_NO_CERTSTATUS_EXTENSION
    if(pending->session->sent_ocsp_extensions.GetLength() != 0 || pending->session->ocsp_extensions_sent)
        return SSL_KEA_No_Action;
#endif
    return pending->key_exchange->ReceivedCertificate();
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:cert_message.cpp


示例10: OP_NEW

void ExtensionsManagerDevListView::OnDeveloperExtensionAdded(
		const ExtensionsModelItem& model_item)
{
	ExtensionsManagerDevListViewItem* item = 
			OP_NEW(ExtensionsManagerDevListViewItem, (model_item));
	OP_ASSERT(item);
	if (!item)
	{
		return;
	}

	RETURN_VOID_IF_ERROR(AddToList(item));
}
开发者ID:prestocore,项目名称:browser,代码行数:13,代码来源:ExtensionsManagerDevListView.cpp


示例11: PrintfTofile

URL_DataDescriptor::~URL_DataDescriptor()
{
#ifdef DEBUG_LOAD_STATUS
	g_main_message_handler->UnsetCallBacks(this);
#endif
#ifdef _DEBUG_DD1
	/*
	if(position != url.ContentLoaded() || url.Status(FALSE) == URL_LOADING)
		int stop = 1;
		*/
#endif
#ifdef _DEBUG_DD1
	OpFileLength registered_len=0;
	url.GetAttribute(URL::KContentLoaded, &registered_len);
	PrintfTofile("urldd1.txt","\nDD Destructor- %s - %s - %lu:%lu (%u:%u)\n",
		DebugGetURLstring(url), (url.GetAttribute(URL::KLoadStatus) == URL_LOADING ? "Not Loaded" : "Loaded"),
		(unsigned long) position, (unsigned long) registered_len, buffer_used, buffer_len
		);
#endif
	OP_DELETE(sub_desc);

	if(is_using_file && storage)
		storage->DecFileCount();

	if(InList())
		Out();

	if(buffer)
	{
		if(url.GetAttribute(URL::KCachePolicy_NoStore))
			OPERA_cleanse_heap(buffer, buffer_len);
		else
			op_memset(buffer, 0, buffer_len);

		OP_DELETEA(buffer);
	}
	g_charsetManager->DecrementCharsetIDReference(charset_id);
	g_charsetManager->DecrementCharsetIDReference(parent_charset);
#ifdef DEBUG_LOAD_STATUS
	OP_ASSERT(dd_counter >0);
	dd_counter --;
#endif

#ifdef SELFTEST
	Context_Manager *mng=urlManager->FindContextManager(url.GetContextId());

	if(mng)
		mng->RemoveDataDescriptorForStats(this);
#endif // SELFTEST

}
开发者ID:prestocore,项目名称:browser,代码行数:51,代码来源:url_dd.cpp


示例12: SetSkinned

OP_STATUS GenericThumbnail::Init(const Config& config)
{
    m_config = config;

    SetSkinned(TRUE);

    RETURN_IF_ERROR(OpButton::Construct(&m_title_button, OpButton::TYPE_CUSTOM, OpButton::STYLE_IMAGE));
    OP_ASSERT(m_title_button != NULL);
    AddChild(m_title_button);
    m_title_button->SetEllipsis(g_pcui->GetIntegerPref(PrefsCollectionUI::EllipsisInCenter) == 1 ? ELLIPSIS_CENTER : ELLIPSIS_END);
    m_title_button->SetJustify(JUSTIFY_CENTER, FALSE);
    m_title_button->GetBorderSkin()->SetImage(m_config.m_title_border_image);
    m_title_button->SetIgnoresMouse(TRUE);

    RETURN_IF_ERROR(OpButton::Construct(&m_close_button, OpButton::TYPE_CUSTOM, OpButton::STYLE_IMAGE));
    OP_ASSERT(m_close_button != NULL);
    AddChild(m_close_button);
    m_close_button->GetBorderSkin()->SetImage(m_config.m_close_border_image);
    m_close_button->GetForegroundSkin()->SetImage(m_config.m_close_foreground_image);
    m_close_button->SetIgnoresMouse(TRUE);
    m_close_button->SetVisibility(FALSE);

    RETURN_IF_ERROR(OpProgressBar::Construct(&m_busy_spinner));
    OP_ASSERT(m_busy_spinner != NULL);
    AddChild(m_busy_spinner);
    m_busy_spinner->GetBorderSkin()->SetImage(m_config.m_busy_border_image);
    m_busy_spinner->SetSpinnerImage(m_config.m_busy_foreground_image);
    m_busy_spinner->SetType(OpProgressBar::Spinner);
    m_busy_spinner->SetIgnoresMouse(TRUE);
    m_busy_spinner->SetVisibility(FALSE);

    SetListener(this);

    m_blend.AddWidgetToBlend(this);
    m_blend.AddWidgetToBlend(m_title_button);

    return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:38,代码来源:GenericThumbnail.cpp


示例13: OP_ASSERT

OP_STATUS
ES_TimeoutTimerEvent::SetCallable(ES_Object *callable_, ES_Value* argv_, int argc_)
{
	OP_ASSERT(callable_);
	OP_ASSERT(!callable);
	OP_ASSERT(!program);

	callable = callable_;

	if (!runtime->Protect(callable))
	{
		callable = NULL;
		return OpStatus::ERR_NO_MEMORY;
	}

	if ((callable_argc = argc_) > 0)
	{
		if (!(callable_argv = OP_NEWA(ES_Value, argc_)))
		{
			callable_argc = 0;
			return OpStatus::ERR_NO_MEMORY;
		}

		for ( int i=0 ; i < argc_ ; i++ )
		{
			callable_argv[i] = argv_[i];

			if (callable_argv[i].type == VALUE_OBJECT && !runtime->Protect(callable_argv[i].value.object) ||
			    callable_argv[i].type == VALUE_STRING && !(callable_argv[i].value.string = SetNewStr(callable_argv[i].value.string)))
			{
				callable_argv[i].type = VALUE_UNDEFINED;
				return OpStatus::ERR_NO_MEMORY;
			}
		}
	}

	return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:38,代码来源:estimerevent.cpp


示例14: OP_NEW_DBG

void OpSpeedDialView::HandleCallback(OpMessage msg, MH_PARAM_1 par1, MH_PARAM_2 par2)
{
	OP_NEW_DBG("OpSpeedDialView::HandleCallback", "speeddial");
	OP_DBG(("msg = %i", msg));
	OP_DBG(("this = %p", this));
	OP_DBG(("par1 = %i", par1));

	switch (msg)
	{
		case MSG_SCROLL_SPEED_DIAL_PAGE_TO_VIEW:
		{
			g_main_message_handler->UnsetCallBack(this, MSG_SCROLL_SPEED_DIAL_PAGE_TO_VIEW, MH_PARAM_1(this));

			const INT32 pos = par2;
			OP_ASSERT(0 <= pos && unsigned(pos) < m_thumbnails.GetCount());

			const OpRect r = m_thumbnails.Get(pos)->GetRect();
			if (m_content)
				m_content->SetScroll(r.y, TRUE);

			g_main_message_handler->SetCallBack(this, MSG_ANIMATE_THUMBNAIL, par1);
			g_main_message_handler->PostDelayedMessage(MSG_ANIMATE_THUMBNAIL, par1, pos, 100);
			return;
		}

		case MSG_ANIMATE_THUMBNAIL:
		{
			g_main_message_handler->UnsetCallBack(this, MSG_ANIMATE_THUMBNAIL, par1);

			const INT32 pos = par2;
			OP_ASSERT(0 <= pos && unsigned(pos) < m_thumbnails.GetCount());
			m_thumbnails.Get(pos)->AnimateThumbnailIn();
			return;
		}
	}

	OpWidget::HandleCallback(msg, par1, par2);
}
开发者ID:prestocore,项目名称:browser,代码行数:38,代码来源:OpSpeedDialView.cpp


示例15: OP_ASSERT

void
Link::IntoStart(Head* list)
{
	OP_ASSERT(!InList());

    suc = list->first;
	if (suc)
		suc->pred = this;
	else
		list->last = this;

    list->first = this;
	parent = list;
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:simset.cpp


示例16: switch

OP_STATUS PageBasedAutocompleteItem::GetContents(OpTreeModelItem::ItemData* item_data)
{
	switch(item_data->column_query_data.column)
	{
		case 0:
			return GetIcon(item_data);
		case 1:
			return GetTextContent(item_data);
		default:
			OP_ASSERT(!"Unknown value");
	}

	return OpStatus::OK;
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:HistoryAutocompleteModel.cpp


示例17: OP_ASSERT

HistorySiteFolder* HistorySiteFolder::Create(const OpStringC& title,
											 HistoryKey * key)
{
	OP_ASSERT(key);

	OpAutoPtr<HistorySiteFolder> site_folder(OP_NEW(HistorySiteFolder, (key)));

	if(!site_folder.get())
		return 0;

	RETURN_VALUE_IF_ERROR(site_folder->SetTitle(title), 0);

	return site_folder.release();
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:HistorySiteFolder.cpp


示例18: OP_ASSERT

void OpSpeedDialView::OnSpeedDialsLoaded()
{
	// This is for the case when Opera delays loading of speeddial.ini
	// until it gets IP-based country code (DSK-351304). Speed dial
	// tabs created before country check is finished will be initially
	// empty and have to be initialized when speeddial.ini is loaded.
	OP_ASSERT(m_thumbnails.GetCount() == 0);
	CreateThumbnails();
	if (!IsReadOnly())
	{
		m_config_button->Show();
	}
	// Plus button and background image are shown during relayout.
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:OpSpeedDialView.cpp


示例19: OP_ASSERT

/* static */ void
ES_DebugBuiltins::PopulateDebugClass(ES_Context *context, ES_Class_Singleton *prototype_class)
{
    OP_ASSERT(prototype_class->GetPropertyTable()->Capacity() >= ES_DebugBuiltinsCount);

    ES_Layout_Info layout;

    #define DECLARE_DEBUG_PROPERTY(class, property, attributes, type) prototype_class->AddL(context, JString::Make(context, #property), ES_Property_Info(attributes | CP), type, FALSE)

    DECLARE_DEBUG_PROPERTY(ES_DebugBuiltins, getHeapInformation,    DE | DD | RO, ES_STORAGE_OBJECT);
    DECLARE_DEBUG_PROPERTY(ES_DebugBuiltins, getObjectDemographics, DE | DD | RO, ES_STORAGE_OBJECT);

    #undef DECLARE_DEBUG_PROPERTY
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:es_debug_builtins.cpp


示例20: OP_ASSERT

OP_STATUS OperaInstallerUI::Show()
{
	OP_ASSERT(m_opera_installer && !m_dialog);

	m_dialog = OP_NEW(InstallerWizard, (m_opera_installer));
	RETURN_OOM_IF_NULL(m_dialog);
	
	RETURN_IF_ERROR(m_dialog->AddListener(this));

	if (m_opera_installer->GetOperation() == OperaInstaller::OpUninstall)
		return m_dialog->Init(InstallerWizard::INSTALLER_DLG_UNINSTALL);

	return m_dialog->Init(InstallerWizard::INSTALLER_DLG_STARTUP);
}
开发者ID:prestocore,项目名称:browser,代码行数:14,代码来源:OperaInstallerUI.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OR函数代码示例发布时间:2022-05-30
下一篇:
C++ OPT__VERBOSE函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap