本文整理汇总了C++中ASSERT_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ ASSERT_DEBUG函数的具体用法?C++ ASSERT_DEBUG怎么用?C++ ASSERT_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ASSERT_DEBUG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOG1
// called by session when session is closed.
void CRemConBulkServer::ClientClosed(CRemConBulkSession& aSession)
{
LOG_FUNC;
LOG1(_L8("\t&aSession = 0x%08x"), &aSession);
LOGSESSIONS;
// Find this session in the array and remove it (if it's there).
const TUint sessCount = iSessions.Count();
for(TUint ix = 0; ix < sessCount; ++ix)
{
if(iSessions[ix] == &aSession)
{
// We've found the session in our array.
ASSERT_DEBUG(aSession.Id() != KNullClientId);
ASSERT_DEBUG(iBulkBearerInterface);
iBulkBearerInterface->BulkClientRemoved(aSession.Id());
// Remove the session from our array.
iSessions.Remove(ix);
break;
}
}
StartShutdownTimerIfNoSessions();
LOGSESSIONS;
}
示例2: age_buf
/*
* age_buf()
* Find the next available buf header, flush and free it
*
* Since this is basically a paging algorithm, it can become arbitrarily
* complex. The algorithm here tries to be simple, yet somewhat fair.
*/
static void
age_buf(void)
{
struct llist *l;
struct buf *b;
/*
* Pick the oldest buf which isn't locked.
*/
for (l = allbufs.l_back; l != &allbufs; l = l->l_back) {
/*
* Only skip if wired or active
*/
b = l->l_data;
if (b->b_locks || BUSY(b)) {
continue;
}
ASSERT_DEBUG(b->b_lock == 0, "age_buf: lock");
if (!(b->b_flags & B_DIRTY)) {
/*
* Remove from list, update data structures
*/
free_buf(b);
return;
}
/*
* Sync out data in background
*/
qio(b, Q_FLUSHBUF);
}
ASSERT_DEBUG(bufsize <= coresec, "age_buf: buffers too large");
}
示例3: ino_deref
/*
* ino_deref()
* Bump reference down on inode object
*/
void
ino_deref(struct inode *i)
{
ASSERT_DEBUG(i != NULL, "bfs: ino_ref: null inode");
ASSERT_DEBUG(i->i_refs != 0, "bfs ino_deref: wrapped");
i->i_refs--;
}
示例4: exec_qio
/*
* exec_qio()
* Do the actions specified by a qio operation
*/
static void
exec_qio(struct buf *b, int op)
{
ASSERT_DEBUG(BUSY(b), "exec_qio: !busy");
switch (op) {
case Q_FILLBUF:
if (b->b_flags & B_SEC0) {
read_secs(b->b_start + 1,
(char *)b->b_data + SECSZ,
b->b_nsec - 1);
} else {
read_secs(b->b_start,
b->b_data, b->b_nsec);
}
b->b_flags |= (B_SEC0|B_SECS);
break;
case Q_FLUSHBUF:
_sync_buf(b, 1);
break;
default:
ASSERT_DEBUG(0, "bg_thread: qio");
break;
}
ASSERT_DEBUG(BUSY(b), "exec_qio: went !busy");
}
示例5: ASSERT_DEBUG
void ScheduledTickQueue::AddTickAt(const ServerTime& serverTimePoint, ScheduledTick* scheduledTick)
{
ASSERT_DEBUG(scheduledTick!=nullptr);
ASSERT_DEBUG(scheduledTick->GetScheduledTime() == milliseconds(0) );
scheduledTick->SetScheduledTime(serverTimePoint);
m_Queue.push(scheduledTick);
}
示例6: ino_clear
/*
* ino_clear()
* Indicate that an inode is no longer needed and can be cleared down.
*
* Before we erase anything we check that the inode is not in use elsewhere
* as we'd like to keep it if it is still needed :-) We shouldn't have
* any blocks allocated to the inode when we get here - they should have
* already been "blk_trunc"'d!
*/
void
ino_clear(struct inode *i)
{
ASSERT_DEBUG(i->i_num != ROOTINODE, "bfs ino_clear: root inode");
ASSERT_DEBUG(i->i_prev == I_FREE, "bfs: ino_clear: i_prev used");
ASSERT_DEBUG(i->i_next == I_FREE, "bfs: ino_clear: i_next used");
if (i->i_refs > 0)
return;
ilist[i->i_num] = NULL;
free(i);
}
示例7: free_buf
/*
* free_buf()
* Release buffer storage, remove from hash
*/
static void
free_buf(struct buf *b)
{
ASSERT_DEBUG(b->b_list, "free_buf: null b_list");
ASSERT_DEBUG(b->b_locks == 0, "free_buf: locks");
ll_delete(b->b_list);
(void)hash_delete(bufpool, b->b_start);
bufsize -= b->b_nsec;
ASSERT_DEBUG(b->b_data, "free_buf: null b_data");
free(b->b_data);
if (b->b_handles) {
free(b->b_handles);
}
free(b);
}
示例8: ASSERT_DEBUG
EXPORT_C void CSdpAttrIdMatchList::__DbgTestInvariant() const
{
#ifdef _DEBUG
TInt count = iList->Count();
for (TInt i = 0; i < count; ++i)
{
TAttrRange& range = iList->At(i);
ASSERT_DEBUG(range.iStart <= range.iEnd);
if (i < count - 1)
{
ASSERT_DEBUG(range.iEnd + 1 < iList->At(i+1).iStart);
}
}
#endif
}
示例9: makespace
/*
* makespace()
* Insert room for a new slot at the given position
*
* Returns 1 if there isn't room to insert the element, 0 on success.
*/
static int
makespace(struct rmap *rmap, struct rmap *r)
{
struct rmap *rlim = &rmap[rmap->r_off];
/*
* If no room to insert slot, return failure
*/
if (rmap->r_size == rmap->r_off) {
return(1);
}
rmap->r_off += 1;
/*
* If inserting in middle, slide up entries
*/
if (r <= rlim) {
bcopy(r, r+1, sizeof(struct rmap) * ((rlim-r)+1));
return(0);
}
/*
* Otherwise it's added at the end
*/
ASSERT_DEBUG(r == rlim+1, "rmap makespace: invalid insert");
return(0);
}
示例10: fod_fillslot
/*
* fod_fillslot()
* Fill pset slot from a port
*/
static int
fod_fillslot(struct pset *ps, struct perpage *pp, uint idx)
{
uint pg;
ASSERT_DEBUG(!(pp->pp_flags & (PP_V|PP_BAD)),
"fod_fillslot: valid");
pg = alloc_page();
set_core(pg, ps, idx);
if (pageio(pg, ps->p_data, ptob(idx+ps->p_off),
NBPG, FS_ABSREAD)) {
free_page(pg);
return(1);
}
/*
* Fill in the new page's value, leave one reference for
* our caller, and another for our cache atl
*/
pp->pp_flags |= PP_V;
pp->pp_refs = 2;
pp->pp_flags &= ~(PP_M|PP_R);
pp->pp_pfn = pg;
/*
* Add the cache reference
*/
add_atl(pp, ps, idx, ATL_CACHE);
return(0);
}
示例11: rmap_alloc
/*
* rmap_alloc()
* Allocate some space from a resource map
*
* Returns 0 on failure. Thus, you can't store index 0 in a resource map
*/
uint
rmap_alloc(struct rmap *rmap, uint size)
{
struct rmap *r, *rlim;
uint idx;
ASSERT_DEBUG(size > 0, "rmap_alloc: zero size");
/*
* Find first slot with a fit, return failure if we run
* off the end of the list without finding a fit.
*/
rlim = &rmap[rmap->r_off];
for (r = &rmap[1]; r <= rlim; ++r) {
if (r->r_size >= size)
break;
}
if (r > rlim) {
return(0);
}
/*
* Trim the resource element if it still has some left,
* otherwise delete from the list.
*/
idx = r->r_off;
if (r->r_size > size) {
r->r_off += size;
r->r_size -= size;
} else {
collapse(rmap, r);
}
return(idx);
}
示例12: fabs
void StageMapLayer::UpdateMyPlayer(float delta)
{
const CCSize winSize = CCDirector::sharedDirector()->getWinSize();
m_LastUpdatedMyPlayerPosition = m_MyPlayer->getPosition();
const float mapHeight = -(m_LastUpdatedMapPosition.y/*-winSize.height*0.4f*/);
const float turningInDistance = winSize.height*1.f;
const float maxScale = 1.35f;
{ // Update Player Position and Scale
const float playerOffset = fabs(m_MyPlayer->getPositionY()-mapHeight);
float playerScale = maxScale;
if( playerOffset >= turningInDistance )
{
playerScale = 0.f;
}
else
{
playerScale = maxScale - (playerOffset/turningInDistance);
}
m_MyPlayer->setScale(playerScale);
if( m_SelectedStageMapPointIndex >=0 && m_SelectedStageMapPointIndex <m_StageMapPointList.size() )
{
this->MoveMyPlayerToSelectedIndex(delta);
}
else
{
ASSERT_DEBUG(false);
}
}
}
示例13: fod_writeslot
/*
* fod_writeslot()
* Write pset slot out to its underlying port
*
* We don't have coherent mapped files, so extremely unclear what
* this condition would mean. Panic for now.
*/
static int
fod_writeslot(struct pset *ps, struct perpage *pp, uint idx, voidfun iodone)
{
ASSERT_DEBUG(pp->pp_flags & PP_V, "fod_writeslot: invalid");
ASSERT(!(pp->pp_flags & PP_M), "fod_writeslot: dirty file");
return(0);
}
示例14: ASSERT_DEBUG
void CBulkReceiver::Receive()
{
LOG_FUNC
ASSERT_DEBUG(iRemConBulk);
iRemConBulk->Receive(iStatus, iInterfaceUid, iOperationId, iData);
SetActive();
}
示例15: LOG1
// ---------------------------------------------------------------------------
// From class CUsbClassControllerPlugIn.
// Called by UsbMan to stop this class.
// ---------------------------------------------------------------------------
//
void CUsbObexClassController::Stop(TRequestStatus& aStatus)
{
LOG_FUNC
LOG1("CUsbObexClassController::Stop iState = %d", iState);
//Stop() should never be called if stopping or starting (or in state EUsbServiceFatalError)
ASSERT_DEBUG(iState == EUsbServiceStarted || iState == EUsbServiceIdle, EBadApiCallStop );
//state may be idle after Cancel
if ( iState == EUsbServiceIdle )
{
TRequestStatus* status = &aStatus;
User::RequestComplete(status, KErrNone);
}
else
{
// Stop OBEX SM
iRequestStatus = &aStatus;
iState = EUsbServiceStopping;
aStatus = KRequestPending;
LOG("CUsbObexClassController::Stop() calling ManageUSBService(EFalse)");
iObexSM->ManageUSBServices(EFalse, iStatus);
SetActive();
}
}