Rev | Line | |
---|
[12747] | 1 | #include "gtest/gtest.h"
|
---|
| 2 | #include "ariba/utility/system/SystemQueue.h"
|
---|
| 3 |
|
---|
| 4 | using namespace ::testing;
|
---|
| 5 | using namespace ariba::utility;
|
---|
| 6 |
|
---|
| 7 |
|
---|
[12748] | 8 | /**
|
---|
| 9 | * Tests if the SystemQueue is initialized empty and not running.
|
---|
| 10 | */
|
---|
| 11 | TEST(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 | */
|
---|
| 26 | TEST(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.