Tests: Fix compile with MSVC2015

Change-Id: Ic9a1839325febeb6bde0b656dce88342f3955c53
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Stenger
2017-12-13 14:38:19 +01:00
parent 300041cc6e
commit 299d0f0e4f

View File

@@ -273,7 +273,7 @@ void tst_Algorithm::transform()
std::vector<int> v({1, 2, 3, 4}); std::vector<int> v({1, 2, 3, 4});
const std::vector<BaseStruct *> trans const std::vector<BaseStruct *> trans
= Utils::transform<std::vector<BaseStruct *>>(v, [](int i) { return new Struct(i); }); = Utils::transform<std::vector<BaseStruct *>>(v, [](int i) { return new Struct(i); });
QCOMPARE(trans.size(), 4ul); QCOMPARE(trans.size(), static_cast<std::vector<int>::size_type>(4ul));
QCOMPARE(trans.at(0)->member, 1); QCOMPARE(trans.at(0)->member, 1);
QCOMPARE(trans.at(1)->member, 2); QCOMPARE(trans.at(1)->member, 2);
QCOMPARE(trans.at(2)->member, 3); QCOMPARE(trans.at(2)->member, 3);
@@ -287,7 +287,7 @@ void tst_Algorithm::transform()
= Utils::transform<std::vector<BaseStruct *, std::allocator<BaseStruct *>>>(v, [](int i) { = Utils::transform<std::vector<BaseStruct *, std::allocator<BaseStruct *>>>(v, [](int i) {
return new Struct(i); return new Struct(i);
}); });
QCOMPARE(trans.size(), 4ul); QCOMPARE(trans.size(), static_cast<std::vector<int>::size_type>(4ul));
QCOMPARE(trans.at(0)->member, 1); QCOMPARE(trans.at(0)->member, 1);
QCOMPARE(trans.at(1)->member, 2); QCOMPARE(trans.at(1)->member, 2);
QCOMPARE(trans.at(2)->member, 3); QCOMPARE(trans.at(2)->member, 3);