A bunch of future tests got invalidated with the latest updates to thread. Fixed the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131509 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fead2e2de9
commit
932209b344
@ -164,7 +164,7 @@ int main()
|
|||||||
Clock::time_point t1 = Clock::now();
|
Clock::time_point t1 = Clock::now();
|
||||||
assert(t1-t0 < ms(100));
|
assert(t1-t0 < ms(100));
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
{
|
{
|
||||||
std::future<std::unique_ptr<int>> f =
|
std::future<std::unique_ptr<int>> f =
|
||||||
std::async(f4, std::unique_ptr<int>(new int(3)));
|
std::async(f4, std::unique_ptr<int>(new int(3)));
|
||||||
@ -174,4 +174,4 @@ int main()
|
|||||||
Clock::time_point t1 = Clock::now();
|
Clock::time_point t1 = Clock::now();
|
||||||
assert(t1-t0 < ms(100));
|
assert(t1-t0 < ms(100));
|
||||||
}
|
}
|
||||||
}
|
*/}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void func(std::promise<int>& p)
|
void func(std::promise<int> p)
|
||||||
{
|
{
|
||||||
const int i = 5;
|
const int i = 5;
|
||||||
p.set_exception_at_thread_exit(std::make_exception_ptr(3));
|
p.set_exception_at_thread_exit(std::make_exception_ptr(3));
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
void func(std::promise<int&>& p)
|
void func(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
p.set_value_at_thread_exit(i);
|
p.set_value_at_thread_exit(i);
|
||||||
i = 4;
|
i = 4;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
void func(std::promise<std::unique_ptr<int>>& p)
|
void func(std::promise<std::unique_ptr<int>> p)
|
||||||
{
|
{
|
||||||
p.set_value_at_thread_exit(std::unique_ptr<int>(new int(5)));
|
p.set_value_at_thread_exit(std::unique_ptr<int>(new int(5)));
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void func(std::promise<int>& p)
|
void func(std::promise<int> p)
|
||||||
{
|
{
|
||||||
const int i = 5;
|
const int i = 5;
|
||||||
p.set_value_at_thread_exit(i);
|
p.set_value_at_thread_exit(i);
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
void func(std::promise<void>& p)
|
void func(std::promise<void> p)
|
||||||
{
|
{
|
||||||
p.set_value_at_thread_exit();
|
p.set_value_at_thread_exit();
|
||||||
i = 1;
|
i = 1;
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func2(std::promise<int>& p)
|
void func2(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_exception(std::make_exception_ptr(3));
|
p.set_exception(std::make_exception_ptr(3));
|
||||||
@ -32,26 +32,26 @@ void func2(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func4(std::promise<int&>& p)
|
void func4(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_exception(std::make_exception_ptr(3.5));
|
p.set_exception(std::make_exception_ptr(3.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void func6(std::promise<void>& p)
|
void func6(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_exception(std::make_exception_ptr('c'));
|
p.set_exception(std::make_exception_ptr('c'));
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
@ -24,14 +24,14 @@ void func1(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
typedef std::chrono::milliseconds ms;
|
typedef std::chrono::milliseconds ms;
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
typedef std::chrono::milliseconds ms;
|
typedef std::chrono::milliseconds ms;
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
|
@ -26,11 +26,11 @@ public:
|
|||||||
long operator()(long i, long j) const {return data_ + i + j;}
|
long operator()(long i, long j) const {return data_ + i + j;}
|
||||||
};
|
};
|
||||||
|
|
||||||
void func(std::packaged_task<double(int, char)>& p)
|
void func(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void func2(std::packaged_task<double(int, char)>& p)
|
void func2(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
p(3, 'a');
|
p(3, 'a');
|
||||||
}
|
}
|
||||||
|
@ -31,19 +31,19 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void func0(std::packaged_task<double(int, char)>& p)
|
void func0(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.make_ready_at_thread_exit(3, 'a');
|
p.make_ready_at_thread_exit(3, 'a');
|
||||||
}
|
}
|
||||||
|
|
||||||
void func1(std::packaged_task<double(int, char)>& p)
|
void func1(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.make_ready_at_thread_exit(3, 'z');
|
p.make_ready_at_thread_exit(3, 'z');
|
||||||
}
|
}
|
||||||
|
|
||||||
void func2(std::packaged_task<double(int, char)>& p)
|
void func2(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
p.make_ready_at_thread_exit(3, 'a');
|
p.make_ready_at_thread_exit(3, 'a');
|
||||||
try
|
try
|
||||||
@ -56,7 +56,7 @@ void func2(std::packaged_task<double(int, char)>& p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func3(std::packaged_task<double(int, char)>& p)
|
void func3(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -31,19 +31,19 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void func0(std::packaged_task<double(int, char)>& p)
|
void func0(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p(3, 'a');
|
p(3, 'a');
|
||||||
}
|
}
|
||||||
|
|
||||||
void func1(std::packaged_task<double(int, char)>& p)
|
void func1(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p(3, 'z');
|
p(3, 'z');
|
||||||
}
|
}
|
||||||
|
|
||||||
void func2(std::packaged_task<double(int, char)>& p)
|
void func2(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
p(3, 'a');
|
p(3, 'a');
|
||||||
try
|
try
|
||||||
@ -56,7 +56,7 @@ void func2(std::packaged_task<double(int, char)>& p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void func3(std::packaged_task<double(int, char)>& p)
|
void func3(std::packaged_task<double(int, char)> p)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func2(std::promise<int>& p)
|
void func2(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_exception(std::make_exception_ptr(3));
|
p.set_exception(std::make_exception_ptr(3));
|
||||||
@ -32,26 +32,26 @@ void func2(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func4(std::promise<int&>& p)
|
void func4(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_exception(std::make_exception_ptr(3.5));
|
p.set_exception(std::make_exception_ptr(3.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
}
|
}
|
||||||
|
|
||||||
void func6(std::promise<void>& p)
|
void func6(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_exception(std::make_exception_ptr('c'));
|
p.set_exception(std::make_exception_ptr('c'));
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <future>
|
#include <future>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
@ -24,14 +24,14 @@ void func1(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
typedef std::chrono::milliseconds ms;
|
typedef std::chrono::milliseconds ms;
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
typedef std::chrono::milliseconds ms;
|
typedef std::chrono::milliseconds ms;
|
||||||
|
|
||||||
void func1(std::promise<int>& p)
|
void func1(std::promise<int> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value(3);
|
p.set_value(3);
|
||||||
@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
|||||||
|
|
||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
void func3(std::promise<int&>& p)
|
void func3(std::promise<int&> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
j = 5;
|
j = 5;
|
||||||
p.set_value(j);
|
p.set_value(j);
|
||||||
}
|
}
|
||||||
|
|
||||||
void func5(std::promise<void>& p)
|
void func5(std::promise<void> p)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(ms(500));
|
std::this_thread::sleep_for(ms(500));
|
||||||
p.set_value();
|
p.set_value();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user