예제 #1
0
void CheckIfQueueEmpty(nsDeque& d)
{
  EXPECT_EQ(0u, d.GetSize())         << "Size should be 0";
  EXPECT_EQ(nullptr, d.Pop())       <<  "Invalid operation should return nullptr";
  EXPECT_EQ(nullptr, d.PopFront())  <<  "Invalid operation should return nullptr";
  EXPECT_EQ(nullptr, d.Peek())      <<  "Invalid operation should return nullptr";
  EXPECT_EQ(nullptr, d.PeekFront()) <<  "Invalid operation should return nullptr";
  EXPECT_EQ(nullptr, d.ObjectAt(0u)) <<  "Invalid operation should return nullptr";
}
/**
 * Pushes all of the tokens in aDeque onto the front of our deque so they
 * get processed before any other tokens.
 *
 * @param aDeque The deque with the tokens in it.
 */
void
nsHTMLTokenizer::PrependTokens(nsDeque& aDeque)
{
  int32_t aCount = aDeque.GetSize();
  
  for (int32_t anIndex = 0; anIndex < aCount; ++anIndex) {
    CToken* theToken = (CToken*)aDeque.Pop();
    PushTokenFront(theToken);
  }
}
예제 #3
0
 void PopAll(F&& aF) {
   while (mDQ.GetSize() != 0) {
     int i = static_cast<int>(reinterpret_cast<uintptr_t>(mDQ.Pop()));
     aF(i);
   }
 }