From 97c3266c6f8fa312d67fcbd24ceb3cbc41c98bdc Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 20 Oct 2020 14:26:43 +0200 Subject: Auto tests: Fix some MSVC warnings about integer conversions Change-Id: Ibab8028ccdb9a4b02cadc6d2e85e8a0472f0d96f Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/collections/tst_collections.cpp | 2 +- tests/auto/testlib/selftests/counting/tst_counting.cpp | 2 +- tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp | 2 +- .../printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp | 2 +- tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp | 2 +- tests/auto/testlib/selftests/silent/tst_silent.cpp | 2 +- tests/auto/testlib/selftests/tst_selftests.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/tools/collections/tst_collections.cpp b/tests/auto/corelib/tools/collections/tst_collections.cpp index 1e01c5a484..f10ecca335 100644 --- a/tests/auto/corelib/tools/collections/tst_collections.cpp +++ b/tests/auto/corelib/tools/collections/tst_collections.cpp @@ -2962,7 +2962,7 @@ public: inline bool operator==(const AlignedClass &other) const { return i == other.i; } inline bool operator<(const AlignedClass &other) const { return i < other.i; } - friend inline int qHash(const AlignedClass &a) { return qHash(a.i); } + friend inline size_t qHash(const AlignedClass &a) { return qHash(a.i); } }; using Aligned4 = AlignedClass<4>; diff --git a/tests/auto/testlib/selftests/counting/tst_counting.cpp b/tests/auto/testlib/selftests/counting/tst_counting.cpp index 56933c78b7..f5fb8dc849 100644 --- a/tests/auto/testlib/selftests/counting/tst_counting.cpp +++ b/tests/auto/testlib/selftests/counting/tst_counting.cpp @@ -292,7 +292,7 @@ int main(int argc, char *argv[]) #ifdef TESTLIB_VERBOSITY_ARG std::vector args(argv, argv + argc); args.push_back(QT_STRINGIFY(TESTLIB_VERBOSITY_ARG)); - argc = args.size(); + argc = int(args.size()); argv = const_cast(&args[0]); #endif diff --git a/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp b/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp index 60a295c0f7..0962bbc952 100644 --- a/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp +++ b/tests/auto/testlib/selftests/printdatatags/tst_printdatatags.cpp @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) { std::vector args(argv, argv + argc); args.push_back("-datatags"); - argc = args.size(); + argc = int(args.size()); argv = const_cast(&args[0]); QTEST_MAIN_IMPL(tst_PrintDataTags) diff --git a/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp b/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp index 6fea34467a..e9456cc110 100644 --- a/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp +++ b/tests/auto/testlib/selftests/printdatatagswithglobaltags/tst_printdatatagswithglobaltags.cpp @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::vector args(argv, argv + argc); args.push_back("-datatags"); - argc = args.size(); + argc = int(args.size()); argv = const_cast(&args[0]); QTEST_MAIN_IMPL(tst_PrintDataTagsWithGlobalTags) diff --git a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp index 8ed9858087..aa38c59d1f 100644 --- a/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp +++ b/tests/auto/testlib/selftests/signaldumper/tst_signaldumper.cpp @@ -428,7 +428,7 @@ int main(int argc, char *argv[]) { std::vector args(argv, argv + argc); args.push_back("-vs"); - argc = args.size(); + argc = int(args.size()); argv = const_cast(&args[0]); QTEST_MAIN_IMPL(tst_Signaldumper) diff --git a/tests/auto/testlib/selftests/silent/tst_silent.cpp b/tests/auto/testlib/selftests/silent/tst_silent.cpp index 7d64efffa2..13a832d0b7 100644 --- a/tests/auto/testlib/selftests/silent/tst_silent.cpp +++ b/tests/auto/testlib/selftests/silent/tst_silent.cpp @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) { std::vector args(argv, argv + argc); args.push_back("-silent"); - argc = args.size(); + argc = int(args.size()); argv = const_cast(&args[0]); QTEST_MAIN_IMPL(tst_Silent) diff --git a/tests/auto/testlib/selftests/tst_selftests.cpp b/tests/auto/testlib/selftests/tst_selftests.cpp index def96e8a65..beda0f739e 100644 --- a/tests/auto/testlib/selftests/tst_selftests.cpp +++ b/tests/auto/testlib/selftests/tst_selftests.cpp @@ -1220,7 +1220,7 @@ int main(int argc, char **argv) rebaseMode = RebaseAll; args.erase(rebaseArgument); - argc = args.size(); + argc = int(args.size()); argv = const_cast(&args[0]); } -- cgit v1.2.3