当前位置: 首页>>代码示例>>C++>>正文


C++ ASSERT_DEBUG函数代码示例

本文整理汇总了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;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:27,代码来源:bulkserver.cpp

示例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");
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:41,代码来源:abc.c

示例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--;
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:11,代码来源:filectrl.c

示例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");
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:31,代码来源:abc.c

示例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);
}
开发者ID:Sinhyub,项目名称:GooRoomShared,代码行数:9,代码来源:ScheduledTickQueue.cpp

示例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);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:22,代码来源:filectrl.c

示例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);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:19,代码来源:abc.c

示例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
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:15,代码来源:ExtractorVisitor.cpp

示例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);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:33,代码来源:rmap.c

示例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);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:35,代码来源:pset_fod.c

示例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);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:39,代码来源:rmap.c

示例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);
        }
    }
}
开发者ID:Sinhyub,项目名称:GooRoomClient,代码行数:33,代码来源:StageMapLayer.cpp

示例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);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:14,代码来源:pset_fod.c

示例14: ASSERT_DEBUG

void CBulkReceiver::Receive()
	{
	LOG_FUNC
	ASSERT_DEBUG(iRemConBulk);
	iRemConBulk->Receive(iStatus, iInterfaceUid, iOperationId, iData);
	SetActive();
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:7,代码来源:bulkreceiver.cpp

示例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();
    }
  }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:31,代码来源:CUsbObexClassController.cpp


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