aboutsummaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2012-08-28 08:51:55 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2012-08-28 08:51:55 (GMT)
commit541c8c407b7ba8dd10f85bb48bcb5900270b3f84 (patch)
tree71a6abc0f2a43bcfd33f80b3b30b878f234cbf05 /src/tests
parent60a53113e05db443af4d520883ec3145680642a8 (diff)
downloadfluxbox-541c8c407b7ba8dd10f85bb48bcb5900270b3f84.zip
fluxbox-541c8c407b7ba8dd10f85bb48bcb5900270b3f84.tar.bz2
changed timing functions to use a monotonic increasing clock
gettimeofday() is subject to be changed on daylight-saving or to ntp-related (think leap-seconds). even worse, it is subject to be changed BACK in time. this is hard to fix correctly (see commit 45726d3016e and bug #3560509). it is irrelevant for timers to know the nano-seconds since the epoch anyways.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/testDemandAttention.cc5
-rw-r--r--src/tests/titletest.cc5
2 files changed, 2 insertions, 8 deletions
diff --git a/src/tests/testDemandAttention.cc b/src/tests/testDemandAttention.cc
index 10fadb3..914f369 100644
--- a/src/tests/testDemandAttention.cc
+++ b/src/tests/testDemandAttention.cc
@@ -61,10 +61,7 @@ public:
61 FbTk::RefCount<FbTk::Command<void> > cmd(new FbTk::SimpleCommand<App> 61 FbTk::RefCount<FbTk::Command<void> > cmd(new FbTk::SimpleCommand<App>
62 (*this, 62 (*this,
63 &App::demandAttention)); 63 &App::demandAttention));
64 timeval t; 64 m_timer.setTimeout(5 * FbTk::FbTime::IN_SECONDS);
65 t.tv_sec = 5;
66 t.tv_usec = 0;
67 m_timer.setTimeout(t);
68 m_timer.setCommand(cmd); 65 m_timer.setCommand(cmd);
69 m_timer.fireOnce(false); 66 m_timer.fireOnce(false);
70 m_timer.start(); 67 m_timer.start();
diff --git a/src/tests/titletest.cc b/src/tests/titletest.cc
index 9ea94f1..e16435a 100644
--- a/src/tests/titletest.cc
+++ b/src/tests/titletest.cc
@@ -52,10 +52,7 @@ public:
52 FbTk::RefCount<FbTk::Command> cmd(new FbTk::SimpleCommand<App> 52 FbTk::RefCount<FbTk::Command> cmd(new FbTk::SimpleCommand<App>
53 (*this, 53 (*this,
54 &App::updateTitle)); 54 &App::updateTitle));
55 timeval t; 55 m_timer.setTimeout(150 * FbTk::FbTime::IN_MILLISECONDS);
56 t.tv_sec = 0;
57 t.tv_usec = 150000;
58 m_timer.setTimeout(t);
59 m_timer.setCommand(cmd); 56 m_timer.setCommand(cmd);
60 m_timer.fireOnce(false); 57 m_timer.fireOnce(false);
61 m_timer.start(); 58 m_timer.start();