forked from organicmaps/organicmaps
[tests] Fixed variable names for std::promises.
This commit is contained in:
parent
5ffdcac537
commit
e412a4d0cf
2 changed files with 12 additions and 12 deletions
|
@ -16,8 +16,8 @@ UNIT_TEST(Cancellable_Smoke)
|
|||
{
|
||||
Cancellable cancellable;
|
||||
|
||||
promise<void> promise;
|
||||
auto future = promise.get_future();
|
||||
promise<void> syncPromise;
|
||||
auto syncFuture = promise.get_future();
|
||||
|
||||
double x = 0.123;
|
||||
|
||||
|
@ -30,12 +30,12 @@ UNIT_TEST(Cancellable_Smoke)
|
|||
x = cos(x);
|
||||
}
|
||||
|
||||
promise.set_value();
|
||||
syncPromise.set_value();
|
||||
};
|
||||
|
||||
threads::SimpleThread thread(fn);
|
||||
cancellable.Cancel();
|
||||
future.wait();
|
||||
syncFuture.wait();
|
||||
thread.join();
|
||||
|
||||
TEST(cancellable.IsCancelled(), ());
|
||||
|
@ -49,8 +49,8 @@ UNIT_TEST(Cancellable_Deadline)
|
|||
chrono::steady_clock::duration kTimeout = chrono::milliseconds(20);
|
||||
cancellable.SetDeadline(chrono::steady_clock::now() + kTimeout);
|
||||
|
||||
promise<void> promise;
|
||||
auto future = promise.get_future();
|
||||
promise<void> syncPromise;
|
||||
auto syncFuture = syncPromise.get_future();
|
||||
|
||||
double x = 0.123;
|
||||
|
||||
|
@ -63,11 +63,11 @@ UNIT_TEST(Cancellable_Deadline)
|
|||
x = cos(x);
|
||||
}
|
||||
|
||||
promise.set_value();
|
||||
syncPromise.set_value();
|
||||
};
|
||||
|
||||
threads::SimpleThread thread(fn);
|
||||
future.wait();
|
||||
syncFuture.wait();
|
||||
thread.join();
|
||||
|
||||
TEST(cancellable.IsCancelled(), ());
|
||||
|
|
|
@ -152,8 +152,8 @@ UNIT_CLASS_TEST(SearchAPITest, BookmarksSearch)
|
|||
|
||||
auto runTest = [&](string const & query, kml::MarkGroupId const & groupId,
|
||||
vector<kml::MarkId> const & expected) {
|
||||
promise<vector<kml::MarkId>> promise;
|
||||
auto future = promise.get_future();
|
||||
promise<vector<kml::MarkId>> idsPromise;
|
||||
auto idsFuture = idsPromise.get_future();
|
||||
|
||||
BookmarksSearchParams params;
|
||||
params.m_query = query;
|
||||
|
@ -161,13 +161,13 @@ UNIT_CLASS_TEST(SearchAPITest, BookmarksSearch)
|
|||
BookmarksSearchParams::Status status) {
|
||||
if (status != BookmarksSearchParams::Status::Completed)
|
||||
return;
|
||||
promise.set_value(results);
|
||||
idsPromise.set_value(results);
|
||||
};
|
||||
params.m_groupId = groupId;
|
||||
|
||||
m_api.SearchInBookmarks(params);
|
||||
|
||||
auto const ids = future.get();
|
||||
auto const ids = idsFuture.get();
|
||||
TEST_EQUAL(ids, expected, ());
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue