mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-10 21:20:07 +00:00
Fix warnings.
This commit is contained in:
parent
90986824a4
commit
c240a129a2
@ -28,6 +28,8 @@
|
|||||||
// Disable useless MSVC warnings.
|
// Disable useless MSVC warnings.
|
||||||
#undef _CRT_SECURE_NO_WARNINGS
|
#undef _CRT_SECURE_NO_WARNINGS
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#undef _SCL_SECURE_NO_WARNINGS
|
||||||
|
#define _SCL_SECURE_NO_WARNINGS
|
||||||
|
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
// Disable useless MSVC warnings.
|
// Disable useless MSVC warnings.
|
||||||
#undef _CRT_SECURE_NO_WARNINGS
|
#undef _CRT_SECURE_NO_WARNINGS
|
||||||
#define _CRT_SECURE_NO_WARNINGS
|
#define _CRT_SECURE_NO_WARNINGS
|
||||||
|
#undef _SCL_SECURE_NO_WARNINGS
|
||||||
|
#define _SCL_SECURE_NO_WARNINGS
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
@ -456,7 +458,8 @@ TEST(FormatterTest, RuntimePrecision) {
|
|||||||
EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << -1l,
|
EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << -1l,
|
||||||
FormatError, "negative precision in format");
|
FormatError, "negative precision in format");
|
||||||
if (sizeof(long) > sizeof(int)) {
|
if (sizeof(long) > sizeof(int)) {
|
||||||
EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (INT_MAX + 1l),
|
long value = INT_MAX;
|
||||||
|
EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (value + 1),
|
||||||
FormatError, "number is too big in format");
|
FormatError, "number is too big in format");
|
||||||
}
|
}
|
||||||
EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (INT_MAX + 1ul),
|
EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (INT_MAX + 1ul),
|
||||||
|
Loading…
Reference in New Issue
Block a user