source: tests/SystemQueue-tests.cc@ 12748

Last change on this file since 12748 was 12748, checked in by hock@…, 11 years ago

added 2 simple real test for the SystemQueue

File size: 783 bytes
Line 
1#include "gtest/gtest.h"
2#include "ariba/utility/system/SystemQueue.h"
3
4using namespace ::testing;
5using namespace ariba::utility;
6
7
8/**
9 * Tests if the SystemQueue is initialized empty and not running.
10 */
11TEST(SystemQueue, Instantiation)
12{
13 SystemQueue& sysq = SystemQueue::instance();
14
15 EXPECT_FALSE( sysq.isRunning() );
16 EXPECT_TRUE( sysq.isEmpty() );
17}
18
19
20/**
21 * Tests whether calling the SystemQueue::instance() always returns the same object.
22 *
23 * NOTE: This is an easy case, since this is the same compile unit..
24 * But can't hurt to test it anyway.
25 */
26TEST(SystemQueue, Singleton)
27{
28 SystemQueue& sysq = SystemQueue::instance();
29 SystemQueue& sysq2 = SystemQueue::instance();
30
31// cout << &sysq << endl;
32 ASSERT_TRUE( &sysq == &sysq2 );
33}
34
35
Note: See TracBrowser for help on using the repository browser.