[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [6602] Expunge an erroneous test
From: |
gchicares |
Subject: |
[lmi-commits] [6602] Expunge an erroneous test |
Date: |
Wed, 18 May 2016 02:26:28 +0000 (UTC) |
Revision: 6602
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6602
Author: chicares
Date: 2016-05-18 02:26:28 +0000 (Wed, 18 May 2016)
Log Message:
-----------
Expunge an erroneous test
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/timer_test.cpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2016-05-18 02:25:18 UTC (rev 6601)
+++ lmi/trunk/ChangeLog 2016-05-18 02:26:28 UTC (rev 6602)
@@ -39209,3 +39209,13 @@
skeleton.cpp
Rework 20160511T2355Z behavior change: less DWIM, not more.
+20160518T0225Z <address@hidden> [451]
+
+ Makefile.am
+Remove a needless dependency.
+
+20160518T0226Z <address@hidden> [451]
+
+ timer_test.cpp
+Expunge an erroneous test.
+
Modified: lmi/trunk/timer_test.cpp
===================================================================
--- lmi/trunk/timer_test.cpp 2016-05-18 02:25:18 UTC (rev 6601)
+++ lmi/trunk/timer_test.cpp 2016-05-18 02:26:28 UTC (rev 6602)
@@ -36,10 +36,7 @@
# include <boost/bind.hpp>
#endif // !defined __BORLANDC__
-#include <cfloat>
-#include <climits>
#include <cmath>
-#include <ctime>
inline void do_nothing()
{}
@@ -68,7 +65,6 @@
{
static void WaitTenMsec();
static void SleepOneSec();
- static void TestResolution();
static void TestExceptions();
static void TestAliquotTimer();
};
@@ -87,45 +83,6 @@
lmi_sleep(1);
}
-/// Roughly validate accuracy of high-resolution timer.
-///
-/// Time an interval of about one second with both std::clock() and
-/// the high-resolution timer, and make sure the relative error is
-/// within a reasonable range.
-
-void TimerTest::TestResolution()
-{
- std::clock_t first = std::clock();
- std::clock_t last;
- double clock_resolution;
- for(;;)
- {
- last = std::clock();
- clock_resolution = double(last - first) / CLOCKS_PER_SEC;
- if(0.0 != clock_resolution)
- {
- break;
- }
- }
-
- Timer timer;
- first = std::clock();
- double interval = 1.0;
- for(;;)
- {
- last = std::clock();
- double elapsed = (last - first) / CLOCKS_PER_SEC;
- if(interval <= elapsed)
- {
- break;
- }
- }
- double observed = timer.stop().elapsed_seconds();
- double relative_error = std::fabs(observed - interval) / interval;
-
- BOOST_TEST_RELATION(relative_error,<,2.0*clock_resolution);
-}
-
void TimerTest::TestExceptions()
{
Timer timer;
@@ -184,7 +141,6 @@
int test_main(int, char*[])
{
- TimerTest::TestResolution();
TimerTest::TestExceptions();
TimerTest::TestAliquotTimer();
return EXIT_SUCCESS;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [6602] Expunge an erroneous test,
gchicares <=