* testsuite/30_threads/unique_lock/locking/4.cc: Template test functions so they can be used to test both steady_clock and system_clock. --- libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc | 12 +++++-- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc index f10cd3f..1c544be 100644 --- a/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc +++ b/libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc @@ -26,17 +26,18 @@ #include <system_error> #include <testsuite_hooks.h> -int main() +template <typename clock_type> +void test() { typedef std::timed_mutex mutex_type; typedef std::unique_lock<mutex_type> lock_type; - typedef std::chrono::system_clock clock_type; try { mutex_type m; lock_type l(m, std::defer_lock); - clock_type::time_point t = clock_type::now() + std::chrono::seconds(1); + const typename clock_type::time_point t = clock_type::now() + + std::chrono::seconds(1); try { @@ -61,6 +62,11 @@ int main() { VERIFY( false ); } +} +int main() +{ + test<std::chrono::system_clock>(); + test<std::chrono::steady_clock>(); return 0; } -- git-series 0.9.1