source: tests/SystemQueue-tests.cc@ 12748

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

added 2 simple real test for the SystemQueue

File size: 783 bytes
RevLine 
[12747]1#include "gtest/gtest.h"
2#include "ariba/utility/system/SystemQueue.h"
3
4using namespace ::testing;
5using namespace ariba::utility;
6
7
[12748]8/**
9 * Tests if the SystemQueue is initialized empty and not running.
10 */
11TEST(SystemQueue, Instantiation)
[12747]12{
13 SystemQueue& sysq = SystemQueue::instance();
[12748]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();
[12747]29 SystemQueue& sysq2 = SystemQueue::instance();
[12748]30
31// cout << &sysq << endl;
[12747]32 ASSERT_TRUE( &sysq == &sysq2 );
33}
[12748]34
35
Note: See TracBrowser for help on using the repository browser.