summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-03-17 12:01:06 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-03-17 17:22:00 +0100
commit5a2ee82f2ccb79a9bd8c9309a0ad1532045e79a6 (patch)
treed08bf8a9bd371c0dda1c3a182ffa738babdd9931
parentfac23d695f9b9f9b172467eaa7f94102dac4dc25 (diff)
Disable security warnings from MSVC in tests
MSVC generates the following for those tests: warning C4996: '_open': This function or variable may be unsafe. Consider using _sopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. We need to set the define before any C runtime headers are included, so do it right away, it doesn't do any harm on other compilers. Change-Id: Ia25afb87934058c3f27e63820eeb2db063a627f1 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--tests/auto/corelib/io/qfile/tst_qfile.cpp2
-rw-r--r--tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp
index bdfcc2d350..188e3fdc25 100644
--- a/tests/auto/corelib/io/qfile/tst_qfile.cpp
+++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp
@@ -27,6 +27,8 @@
**
****************************************************************************/
+#define _CRT_SECURE_NO_WARNINGS 1
+
#include <QTest>
#include <QScopedValueRollback>
#include <qplatformdefs.h>
diff --git a/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp b/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp
index 5f99cec3af..60b0c697c5 100644
--- a/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp
+++ b/tests/auto/corelib/io/qipaddress/tst_qipaddress.cpp
@@ -26,6 +26,8 @@
**
****************************************************************************/
+#define _CRT_SECURE_NO_WARNINGS 1
+
#include <QtCore/QString>
#include <QTest>
#include <QtCore/private/qipaddress_p.h>