mirror of
https://github.com/aria2/aria2.git
synced 2025-02-26 08:22:11 +00:00
Move sleep functions to Util class: * src/Util.cc (sleep): New function. (usleep): New function. * src/DownloadCommand.cc: sleep -> Util::sleep * test/TimeSeedCriteriaTest.cc: sleep -> Util::sleep MinGW build enhancements. The following files are added: * src/timegm.{c,h} Changes to support the above new files: * configure.ac * src/Makefile.am * src/a2time.h * src/Util.cc: * src/strptime.c: Added support for %Z option. Miscellenous build fixes/enhancements. * configure.ac: Added summary report. * src/Platform.h: Tweaked #include's. * src/a2netcompat.h: Tweaked #include's. * src/strptime.h: Tweaked #include's. * src/gai_strerror.c: Tweaked #include's. * src/gai_strerror.h: _D_GETADDRINFO_H -> _D_GAI_STRERROR_H * src/getaddrinfo.h: Moved #ifndef __MINGW32__ * src/gettimeofday.h: Added HAVE_CONFIG_H
28 lines
568 B
C++
28 lines
568 B
C++
#include "TimeSeedCriteria.h"
|
|
#include "Util.h"
|
|
|
|
#include <cppunit/extensions/HelperMacros.h>
|
|
#include <stdlib.h>
|
|
|
|
class TimeSeedCriteriaTest:public CppUnit::TestFixture {
|
|
|
|
CPPUNIT_TEST_SUITE(TimeSeedCriteriaTest);
|
|
CPPUNIT_TEST(testEvaluate);
|
|
CPPUNIT_TEST_SUITE_END();
|
|
|
|
public:
|
|
void testEvaluate();
|
|
};
|
|
|
|
|
|
CPPUNIT_TEST_SUITE_REGISTRATION(TimeSeedCriteriaTest);
|
|
|
|
void TimeSeedCriteriaTest::testEvaluate() {
|
|
TimeSeedCriteria cri(1);
|
|
Util::sleep(1);
|
|
CPPUNIT_ASSERT(cri.evaluate());
|
|
cri.reset();
|
|
cri.setDuration(10);
|
|
CPPUNIT_ASSERT(!cri.evaluate());
|
|
}
|