本文整理汇总了C++中CHECK_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_BOOL函数的具体用法?C++ CHECK_BOOL怎么用?C++ CHECK_BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECK_BOOL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
void CEMSocket::AssertValid() const
{
CEncryptedStreamSocket::AssertValid();
const_cast<CEMSocket*>(this)->sendLocker.Lock();
ASSERT( byConnected==ES_DISCONNECTED || byConnected==ES_NOTCONNECTED || byConnected==ES_CONNECTED );
CHECK_BOOL(m_bProxyConnectFailed);
CHECK_PTR(m_pProxyLayer);
(void)downloadLimit;
CHECK_BOOL(downloadLimitEnable);
CHECK_BOOL(pendingOnReceive);
//char pendingHeader[PACKET_HEADER_SIZE];
pendingHeaderSize;
CHECK_PTR(pendingPacket);
(void)pendingPacketSize;
CHECK_ARR(sendbuffer, sendblen);
(void)sent;
controlpacket_queue.AssertValid();
standartpacket_queue.AssertValid();
CHECK_BOOL(m_currentPacket_is_controlpacket);
//(void)sendLocker;
(void)m_numberOfSentBytesCompleteFile;
(void)m_numberOfSentBytesPartFile;
(void)m_numberOfSentBytesControlPacket;
CHECK_BOOL(m_currentPackageIsFromPartFile);
(void)lastCalledSend;
(void)m_actualPayloadSize;
(void)m_actualPayloadSizeSent;
const_cast<CEMSocket*>(this)->sendLocker.Unlock();
}
示例2: START_TEST
END_TEST
/* Miscellaneous */
START_TEST (test_misc)
{
enum { MAX_BUFFER_SIZE = 512 };
XML_Char buffer[MAX_BUFFER_SIZE] = _XT("");
scew_writer *writer = scew_writer_buffer_create (buffer, MAX_BUFFER_SIZE);
CHECK_PTR (writer, "Unable to create buffer writer");
CHECK_BOOL (scew_writer_end (writer), SCEW_FALSE,
"Writer should be at the beginning");
CHECK_BOOL (scew_writer_error (writer), SCEW_FALSE,
"Writer should have no error (nothing done yet)");
/* Close writer */
scew_writer_close (writer);
CHECK_BOOL (scew_writer_end (writer), SCEW_TRUE,
"Writer is closed, thus at the end");
scew_writer_free (writer);
}
示例3: CHECK_BOOL
void FileAttributes::Load(TiXmlElement * node)
{
CHECK_BOOL(node != NULL,
L"Expected 'fileattributes' node");
CHECK_BOOL(0 == strcmp(node->Value(), "fileattributes"),
L"Expected 'fileattributes' node, got '" << DVLib::string2wstring(node->Value()) << L"'");
TiXmlNode * child = NULL;
while( (child = node->IterateChildren(child)) != NULL )
{
TiXmlElement * child_element = child->ToElement();
if (child_element == NULL)
continue;
if (strcmp(child_element->Value(), "fileattribute") == 0)
{
FileAttributePtr fileattribute(new FileAttribute());
fileattribute->Load(child_element);
(* this)[fileattribute->name] = fileattribute;
}
else
{
THROW_EX(L"Unexpected node '" << child_element->Value() << L"'");
}
}
LOG(L"Read " << size() << L" file attribute(s)");
}
示例4: LOG
void ExeComponent::Wait(DWORD tt)
{
ProcessComponent::Wait(tt);
DWORD exitcode = ProcessComponent::GetProcessExitCode();
LOG(L"Component '" << id << "' return code " << exitcode
<< DVLib::FormatMessage(L" (0x%x).", exitcode));
// check for reboot
if (! returncodes_reboot.empty() && IsReturnCode(exitcode, returncodes_reboot))
{
LOG(L"Component '" << id << "' return code '" << exitcode
<< L", defined as reboot required in '" << returncodes_reboot << L".");
return;
}
// check for explicit success, where defined
if (returncodes_success.empty())
{
CHECK_BOOL(ERROR_SUCCESS == exitcode,
L"Error executing '" << id << "' (" << GetDisplayName() << L"): " << exitcode << DVLib::FormatMessage(L" (0x%x)", exitcode));
}
else
{
CHECK_BOOL(IsReturnCode(exitcode, returncodes_success),
L"Error executing component '" << id << "' (" << GetDisplayName() << L"), return code "
<< exitcode << DVLib::FormatMessage(L" (0x%x)", exitcode)
<< L" is not in '" << returncodes_success << L"'");
LOG(L"Component '" << id << "' (" << GetDisplayName() << L") return code " << exitcode
<< DVLib::FormatMessage(L" (0x%x)", exitcode)
<< L", defined as success in '" << returncodes_success << L"'.");
}
}
示例5: dwc2_check_params
static void dwc2_check_params(struct dwc2_hsotg *hsotg)
{
struct dwc2_hw_params *hw = &hsotg->hw_params;
struct dwc2_core_params *p = &hsotg->params;
bool dma_capable = !(hw->arch == GHWCFG2_SLAVE_ONLY_ARCH);
dwc2_check_param_otg_cap(hsotg);
dwc2_check_param_phy_type(hsotg);
dwc2_check_param_speed(hsotg);
dwc2_check_param_phy_utmi_width(hsotg);
CHECK_BOOL(enable_dynamic_fifo, hw->enable_dynamic_fifo);
CHECK_BOOL(en_multiple_tx_fifo, hw->en_multiple_tx_fifo);
CHECK_BOOL(i2c_enable, hw->i2c_enable);
CHECK_BOOL(reload_ctl, (hsotg->hw_params.snpsid > DWC2_CORE_REV_2_92a));
CHECK_RANGE(max_packet_count,
15, hw->max_packet_count,
hw->max_packet_count);
CHECK_RANGE(max_transfer_size,
2047, hw->max_transfer_size,
hw->max_transfer_size);
if ((hsotg->dr_mode == USB_DR_MODE_HOST) ||
(hsotg->dr_mode == USB_DR_MODE_OTG)) {
CHECK_BOOL(host_dma, dma_capable);
CHECK_BOOL(dma_desc_enable, p->host_dma);
CHECK_BOOL(dma_desc_fs_enable, p->dma_desc_enable);
CHECK_BOOL(host_ls_low_power_phy_clk,
p->phy_type == DWC2_PHY_TYPE_PARAM_FS);
CHECK_RANGE(host_channels,
1, hw->host_channels,
hw->host_channels);
CHECK_RANGE(host_rx_fifo_size,
16, hw->rx_fifo_size,
hw->rx_fifo_size);
CHECK_RANGE(host_nperio_tx_fifo_size,
16, hw->host_nperio_tx_fifo_size,
hw->host_nperio_tx_fifo_size);
CHECK_RANGE(host_perio_tx_fifo_size,
16, hw->host_perio_tx_fifo_size,
hw->host_perio_tx_fifo_size);
}
if ((hsotg->dr_mode == USB_DR_MODE_PERIPHERAL) ||
(hsotg->dr_mode == USB_DR_MODE_OTG)) {
CHECK_BOOL(g_dma, dma_capable);
CHECK_BOOL(g_dma_desc, (p->g_dma && hw->dma_desc_enable));
CHECK_RANGE(g_rx_fifo_size,
16, hw->rx_fifo_size,
hw->rx_fifo_size);
CHECK_RANGE(g_np_tx_fifo_size,
16, hw->dev_nperio_tx_fifo_size,
hw->dev_nperio_tx_fifo_size);
dwc2_check_param_tx_fifo_sizes(hsotg);
}
}
示例6: CHECK_BOOL
void CAbstractFile::AssertValid() const
{
CObject::AssertValid();
(void)m_strFileName;
(void)m_abyFileHash;
(void)m_nFileSize;
(void)m_strComment;
(void)m_uRating;
(void)m_strFileType;
(void)m_uUserRating;
CHECK_BOOL(m_bHasComment);
CHECK_BOOL(m_bCommentLoaded);
taglist.AssertValid();
}
示例7: CHECK_BOOL
void EmbedFile::Load(TiXmlElement * node)
{
CHECK_BOOL(node != NULL,
L"Expected 'embedfile' node");
CHECK_BOOL(0 == strcmp(node->Value(), "embedfile"),
L"Expected 'embedfile' node, got '" << DVLib::string2wstring(node->Value()) << L"'");
sourcefilepath = node->Attribute("sourcefilepath");
targetfilepath = node->Attribute("targetfilepath");
LOG(L"Read 'embedfile', source=" << sourcefilepath
<< L", target=" << targetfilepath);
}
示例8: CHECK_BOOL
void CLanguageSelectorDialog::OnOK()
{
Configuration * p = static_cast<Configuration *>(m_listLanguages.GetItemDataPtr(m_listLanguages.GetCurSel()));
CHECK_BOOL(p != NULL, L"Missing configuration");
CHECK_BOOL(! p->language_id.empty(),
L"Chosen configuration of type '" << p->type << L"' is missing a language_id");
LOG(L"User-chosen language id: " << p->language_id);
InstallerSession::Instance->languageid = DVLib::wstring2long(p->language_id);
InstallerSession::Instance->language = p->GetLanguageString();
CDialog::OnOK();
}
示例9: sizeof
void ConfigFileManager::CreateInstallerWindow(const std::wstring& title)
{
if (m_pInstallerWindow != NULL)
{
delete m_pInstallerWindow;
m_pInstallerWindow = NULL;
}
MONITORINFO mi = { 0 };
mi.cbSize = sizeof(mi);
CHECK_WIN32_BOOL(GetMonitorInfo(MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY), & mi),
L"GetMonitorInfo");
int cx = 640;
int cy = 480;
m_pInstallerWindow = new InstallerWindow(); // deletes itself
m_pInstallerWindow->Create(
(mi.rcWork.left + mi.rcWork.right) / 2 - cx / 2,
(mi.rcWork.top + mi.rcWork.bottom) / 2 - cy / 2,
cx, cy, title.c_str());
CHECK_BOOL(m_pInstallerWindow->hwnd != NULL,
L"InstallerWindow::Create");
}
示例10: ElementFormControlSetAttrdisabled
//setters
int ElementFormControlSetAttrdisabled(lua_State* L)
{
ElementFormControl* efc = LuaType<ElementFormControl>::check(L,1);
LUACHECKOBJ(efc);
efc->SetDisabled(CHECK_BOOL(L,2));
return 0;
}
示例11: CHECK_BOOL
bool ConfigFileManager::OnRunConfiguration(const ConfigurationPtr& config)
{
InstallConfiguration * p_configuration = reinterpret_cast<InstallConfiguration *>(get(config));
CHECK_BOOL(p_configuration != NULL, L"Invalid configuration");
CreateInstallerWindow(p_configuration->dialog_caption);
return m_pInstallerWindow->RunInstallConfiguration(config, config != (* this)[size() - 1]);
}
示例12: CHECK_BOOL
BOOL CDFA::ConstructDFA()
{
BOOL bRet = FALSE;
CHECK_BOOL ( CreateSyntaxTree() );
CHECK_BOOL ( m_pSyntaxNode->CalculateAllFunction() );
m_pSyntaxNode->ShowAllFunction(m_pSyntaxNode);
CHECK_BOOL ( CreateDFA(m_pSyntaxNode) );
CHECK_BOOL ( MinimizeDFA(m_lstSet.size(), m_lstNodeRelation,
m_setAcceptingIdx, m_lstFinalSet) );
assert(m_lstFinalSet.size() <= m_lstSet.size());
bRet = TRUE;
Exit0:
return bRet;
}
示例13: CHECK_WIN32_BOOL
DVLib::FileVersionInfo DVLib::GetFileVersionInfo(const std::wstring& filename)
{
DVLib::FileVersionInfo result = { 0 };
DWORD dwVerHnd = 0;
DWORD dwVerInfoSize = ::GetFileVersionInfoSize(filename.c_str(), & dwVerHnd);
CHECK_WIN32_BOOL(dwVerInfoSize != 0,
L"GetFileVersionInfoSize(" << filename << L")");
std::vector<byte> versioninfo_data;
versioninfo_data.resize(dwVerInfoSize);
dwVerInfoSize = versioninfo_data.size();
CHECK_WIN32_BOOL(::GetFileVersionInfo(filename.c_str(), dwVerHnd, dwVerInfoSize, & * versioninfo_data.begin()),
L"GetFileVersionInfo(" << filename << L")");
// VS_FIXEDFILEINFO
UINT fixed_len = 0;
VS_FIXEDFILEINFO * lpvi = NULL;
CHECK_WIN32_BOOL(0 != ::VerQueryValueW(& * versioninfo_data.begin(), L"\\", reinterpret_cast<LPVOID *>(& lpvi), & fixed_len),
L"VerQueryValue(" << filename << L")");
result.fixed_info = * lpvi;
// translation info
UINT translation_len = 0;
TranslationInfo * lpti = NULL;
CHECK_WIN32_BOOL(0 != ::VerQueryValueW(& * versioninfo_data.begin(), L"\\VarFileInfo\\Translation", reinterpret_cast<LPVOID *>(& lpti), & translation_len),
L"VerQueryValue(" << filename << L", \"\\VarFileInfo\\Translation\")");
CHECK_BOOL(translation_len <= sizeof(TranslationInfo),
L"VerQueryValue(" << filename << L", \"\\VarFileInfo\\Translation\"): invalid size");
result.translation_info = * lpti;
return result;
}
示例14: CHECK_WIN32_DWORD
std::wstring DVLib::RegistryGetStringValue(HKEY root, const std::wstring& key, const std::wstring& name, DWORD ulFlags)
{
HKEY reg = NULL;
CHECK_WIN32_DWORD(::RegOpenKeyEx(root, key.c_str(), 0, ulFlags | KEY_READ, & reg),
L"Error opening " << HKEY2wstring(root) << L"\\" << key);
auto_hkey reg_ptr(reg);
DWORD dwSize = 0;
DWORD dwType = 0;
CHECK_WIN32_DWORD(::RegQueryValueEx(reg, name.c_str(), 0, & dwType, NULL, & dwSize),
L"Error quering '" << HKEY2wstring(root) << L"\\" << key << L"\\" << name << L"' value size:");
CHECK_BOOL(dwType == REG_SZ || dwType == REG_EXPAND_SZ,
L"Error quering '" << HKEY2wstring(root) << L"\\" << key << L"\\" << name << L"' value, unexpected type " << dwType);
std::wstring value;
if (dwSize > 0)
{
value.resize(dwSize / sizeof(WCHAR));
CHECK_WIN32_DWORD(::RegQueryValueEx(reg, name.c_str(), 0, & dwType, reinterpret_cast<LPBYTE>(& * value.begin()), & dwSize),
L"Error quering '" << HKEY2wstring(root) << L"\\" << key << L"\\" << name << L"' value data");
value.resize((dwSize - 1) / sizeof(WCHAR));
}
return value;
}
示例15: CHECK_BOOL
void ProcessComponent::Wait(DWORD tt)
{
CHECK_BOOL(m_process_handle != NULL, L"Invalid process handle")
CHECK_WIN32_BOOL(WAIT_OBJECT_0 == WaitForSingleObject(m_process_handle, tt),
L"WaitForSingleObject");
}