Exemple #1
0
TEST(VQueueTest, Initialize) {
  VQueue* q = new VQueue();

  EXPECT_EQ(0, q->size());
  EXPECT_EQ(1, q->isEmpty());
  delete q;
}
void VQueueDoubleAddProblem::compute()
{
	VQueue<double> queue;
	m_outputData.clear();
	for (auto it = m_inputData.begin(); it != m_inputData.end(); it++)
		queue.enqueue(*it);
}
Exemple #3
0
TEST(VQueueTest, Enqueue) {
  VQueue* q = new VQueue();
  q->enqueue(5);

  EXPECT_EQ(0, q->isEmpty());
  EXPECT_EQ(1, q->size());
  EXPECT_EQ(5, q->dequeue());
  delete q;
}
Exemple #4
0
TEST(VQueueTest, IsEmpty) {
  VQueue* q = new VQueue();
  
  EXPECT_EQ(1, q->isEmpty());

  q->enqueue(1);

  EXPECT_EQ(0, q->isEmpty());
  delete q;
}
Exemple #5
0
TEST(VQueueTest, Dequeue) {
  VQueue* q = new VQueue();
  q->enqueue(5);
  q->enqueue(10);
  q->enqueue(15);

  EXPECT_EQ(5, q->dequeue());
  EXPECT_EQ(10, q->dequeue());
  EXPECT_EQ(15, q->dequeue());
  delete q;
}
Exemple #6
0
TEST(VQueueTest, Size) {
  VQueue* q = new VQueue();
  
  EXPECT_EQ(0, q->size());

  q->enqueue(5);
  q->enqueue(10);
  q->enqueue(15);

  EXPECT_EQ(3, q->size());

  q->dequeue();

  EXPECT_EQ(2, q->size());

  delete q;
}