summaryrefslogtreecommitdiff
path: root/cpp/src/tests/TimerTest.cpp
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-09-09 19:46:56 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-09-09 19:46:56 +0000
commitfbddf29b719cd610b01b2459c4827d636cda6c73 (patch)
tree4f1a87c509b151d428eca8c3c01c1bea0cd205a4 /cpp/src/tests/TimerTest.cpp
parentfd40457f6f471d10c3c804202d2329c93b2cb29e (diff)
downloadqpid-python-fbddf29b719cd610b01b2459c4827d636cda6c73.tar.gz
Tidied up namespace usage
Miscelleneous whitespace fixes git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@813094 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/TimerTest.cpp')
-rw-r--r--cpp/src/tests/TimerTest.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/cpp/src/tests/TimerTest.cpp b/cpp/src/tests/TimerTest.cpp
index 2642c980ba..1552421ba0 100644
--- a/cpp/src/tests/TimerTest.cpp
+++ b/cpp/src/tests/TimerTest.cpp
@@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -32,6 +32,9 @@ using namespace qpid::sys;
using boost::intrusive_ptr;
using boost::dynamic_pointer_cast;
+namespace qpid {
+namespace tests {
+
class Counter
{
Mutex lock;
@@ -44,7 +47,7 @@ class Counter
return ++counter;
}
};
-
+
class TestTask : public TimerTask
{
const AbsTime start;
@@ -56,7 +59,7 @@ class TestTask : public TimerTask
Counter& counter;
public:
- TestTask(Duration timeout, Counter& _counter)
+ TestTask(Duration timeout, Counter& _counter)
: TimerTask(timeout), start(now()), expected(timeout), end(start), fired(false), counter(_counter) {}
void fire()
@@ -106,14 +109,14 @@ QPID_AUTO_TEST_CASE(testGeneral)
intrusive_ptr<TestTask> task2(new TestTask(Duration(1 * TIME_SEC), counter));
intrusive_ptr<TestTask> task3(new TestTask(Duration(4 * TIME_SEC), counter));
intrusive_ptr<TestTask> task4(new TestTask(Duration(2 * TIME_SEC), counter));
-
+
timer.add(task1);
timer.add(task2);
timer.add(task3);
timer.add(task4);
-
+
dynamic_pointer_cast<TestTask>(task3)->wait(Duration(6 * TIME_SEC));
-
+
dynamic_pointer_cast<TestTask>(task1)->check(3);
dynamic_pointer_cast<TestTask>(task2)->check(1);
dynamic_pointer_cast<TestTask>(task3)->check(4);
@@ -121,3 +124,5 @@ QPID_AUTO_TEST_CASE(testGeneral)
}
QPID_AUTO_TEST_SUITE_END()
+
+}} // namespace qpid::tests