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

C++ ASSERT_DEBUG函数代码示例

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

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



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


示例16: _sync_buf

/*
 * _sync_buf()
 *	Sync back buffer if dirty
 *
 * Write back the 1st sector, or the whole buffer, as appropriate
 */
static void
_sync_buf(struct buf *b, int from_qio)
{
	ASSERT_DEBUG(b->b_flags & (B_SEC0 | B_SECS), "sync_buf: not ref'ed");

	/*
	 * Skip it if not dirty
	 */
	if (!(b->b_flags & B_DIRTY)) {
		return;
	}

	/*
	 * Do the I/O--whole buffer, or just 1st sector if that was
	 * the only sector referenced.
	 */
	if (!from_qio) {
		get(b);
	}
	if (b->b_flags & B_SECS) {
		write_secs(b->b_start, b->b_data, b->b_nsec);
	} else {
		write_secs(b->b_start, b->b_data, 1);
	}
	p_lock(&b->b_lock);
	b->b_flags &= ~B_DIRTY;
	v_lock(&b->b_lock);

	/*
	 * If there are possible handles, clear them too
	 */
	if (b->b_handles) {
		bzero(b->b_handles, b->b_nhandle * sizeof(void *));
	}
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:41,代码来源:abc.c


示例17: init_buf

/*
 * init_buf()
 *	Initialize the buffering system
 */
void
init_buf(port_t arg_ioport, int arg_coresec)
{
	char *p;

	/*
	 * Record args
	 */
	ioport = arg_ioport;
	coresec = arg_coresec;

	/*
	 * Initialize data structures
	 */
	ll_init(&allbufs);
	bufpool = hash_alloc(coresec / 8);
	bufsize = 0;
	ASSERT_DEBUG(bufpool, "init_buf: bufpool");
	fg_pid = gettid();

	/*
	 * Record whether DMA is supported
	 */
	p = rstat(ioport, "dma");
	can_dma = p && atoi(p);

	/*
	 * Spin off background thread
	 */
	bg_pid = tfork(bg_thread, 0);
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:35,代码来源:abc.c


示例18: LOG

void CRemConBulkServer::StartShutdownTimerIfNoSessions()
	{
	LOG_FUNC;

	if ( iSessions.Count() == 0 )
		{
		LOG(_L8("\tno remaining sessions- starting shutdown timer"));
		// Should have been created during our construction.
		ASSERT_DEBUG(iShutdownTimer);
		// Start the shutdown timer. It's actually a CPeriodic- the first 
		// event will be in KShutdownDelay microseconds' time.
		// NB The shutdown timer might already be active, in the following 
		// case: this function is being called by NewSessionL because there 
		// was a failure creating a new session, BUT this function had already 
		// been called by the session's destructor (i.e. the failure was in 
		// the session's ConstructL, NOT its new(ELeave)). To protect against 
		// KERN-EXEC 15 just check for if the timer is already active. 
		if ( !iShutdownTimer->IsActive() )
			{
			iShutdownTimer->Start(KShutdownDelay, 
				// Delay of subsequent firings (will not happen because we kill 
				// ourselves after the first).
				0, 
				TCallBack(CRemConBulkServer::TimerFired, this)
				);
			}
		else
			{
			LOG(_L8("\tshutdown timer was already active"));
			}
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:32,代码来源:bulkserver.cpp


示例19: lockForSerialize

Item* Stash::FindItem(const ItemGroup itemGroup, const ItemID itemID) const
{
    ScopedLock lockForSerialize(m_LockForSerialize);

    Item* theItem = nullptr;
    
    if( itemGroup <= ItemGroup_None || itemGroup >= ItemGroup_Max )
    {
        ASSERT_DEBUG(! (itemGroup <= ItemGroup_None || itemGroup >= ItemGroup_Max) );
        return nullptr;
    }
    
    const ItemList& itemList = m_ItemList[itemGroup];
    ItemList::const_iterator iter = std::find_if(itemList.begin() , itemList.end(), [itemID](Item* item)->bool
        {
            if( item->GetItemID() == itemID )
            {
                return true;
            }
            return false;
        });
    
    if( iter == itemList.end() )
    {
        theItem = nullptr;
    }
    else
    {
        theItem = *iter;
    }
    
    return theItem;
}
开发者ID:Sinhyub,项目名称:GameShared,代码行数:33,代码来源:Stash.cpp


示例20: index_buf

/*
 * index_buf()
 *	Get a pointer to a run of data under a particular buf entry
 *
 * As a side effect, move us to front of list to make us relatively
 * undesirable for aging.
 */
void *
index_buf(struct buf *b, uint index, uint nsec)
{
	ASSERT_DEBUG((index+nsec) <= b->b_nsec, "index_buf: too far");

	get(b);
	ll_movehead(&allbufs, b->b_list);
	if ((index == 0) && (nsec == 1)) {
		/*
		 * Only looking at 1st sector.  See about reading
		 * only 1st sector, if we don't yet have it.
		 */
		if ((b->b_flags & B_SEC0) == 0) {
			/*
			 * Load the sector, mark it as present
			 */
			read_secs(b->b_start, b->b_data, 1);
			b->b_flags |= B_SEC0;
		}
	} else if ((b->b_flags & B_SECS) == 0) {
		/*
		 * Otherwise if we don't have the whole buffer, get
		 * it now.  Don't read in sector 0 if we already
		 * have it.
		 */
		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);
	}
	return((char *)b->b_data + stob(index));
}
开发者ID:JamesLinus,项目名称:vsta,代码行数:42,代码来源:abc.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ASSERT_DOUBLE_EQ函数代码示例发布时间:2022-05-30
下一篇:
C++ ASSERT_BREAK函数代码示例发布时间: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