| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| * Copyright (C) 2014 Named Data Networking Project |
| * See COPYING for copyright and distribution information. |
| #ifndef NFD_TEST_CORE_LIMITED_IO_HPP |
| #define NFD_TEST_CORE_LIMITED_IO_HPP |
| #include "core/scheduler.hpp" |
| /** \brief provides IO operations limit and/or time limit for unit testing |
| /// indicates why .run returns |
| /// g_io.run() runs normally because there's no work to do |
| /// .afterOp() has been invoked nOpsLimit times |
| /// nTimeLimit has elapsed |
| /// an exception is thrown |
| /** \brief g_io.run() with operation count and/or time limit |
| * \param nOpsLimit operation count limit, pass UNLIMITED_OPS for no limit |
| * \param nTimeLimit time limit, pass UNLIMITED_TIME for no limit |
| run(int nOpsLimit, const time::nanoseconds& nTimeLimit); |
| getLastException() const; |
| static const int UNLIMITED_OPS; |
| static const time::nanoseconds UNLIMITED_TIME; |
| std::exception m_lastException; |
| #endif // NFD_TEST_CORE_LIMITED_IO_HPP |