From 1985d7544241fee458cc452aec67580392eae0f5 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 8 Nov 2017 00:05:21 +0300 Subject: [PATCH] Improve test coverage for %llx, %Lx, %I64x used with scanf --- test/testio.cpp | 63 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/test/testio.cpp b/test/testio.cpp index 9378936b6..e2985b924 100644 --- a/test/testio.cpp +++ b/test/testio.cpp @@ -1074,10 +1074,31 @@ private: TEST_SCANF_WARN("%llx","unsigned long long","bool"); TEST_SCANF_WARN("%llx","unsigned long long","char"); + TEST_SCANF_WARN("%llx","unsigned long long","signed char"); + TEST_SCANF_WARN("%llx","unsigned long long","unsigned char"); + TEST_SCANF_WARN("%llx","unsigned long long","signed short"); + TEST_SCANF_WARN("%llx","unsigned long long","unsigned short"); + TEST_SCANF_WARN("%llx","unsigned long long","signed int"); + TEST_SCANF_WARN("%llx","unsigned long long","unsigned int"); + TEST_SCANF_WARN("%llx","unsigned long long","signed long"); + TEST_SCANF_WARN("%llx","unsigned long long","unsigned long"); TEST_SCANF_WARN("%llx","unsigned long long","signed long long"); TEST_SCANF_NOWARN("%llx","unsigned long long","unsigned long long"); + TEST_SCANF_WARN("%llx","unsigned long long","float"); + TEST_SCANF_WARN("%llx","unsigned long long","double"); + TEST_SCANF_WARN("%llx","unsigned long long","long double"); TEST_SCANF_WARN("%llx","unsigned long long","void *"); TEST_SCANF_WARN_AKA("%llx","unsigned long long","size_t", "unsigned long", "unsigned long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","ssize_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","ptrdiff_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","unsigned ptrdiff_t", "unsigned long", "unsigned long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","intmax_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","uintmax_t", "unsigned long", "unsigned long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","std::size_t", "unsigned long", "unsigned long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","std::ssize_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","std::ptrdiff_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%llx","unsigned long long","std::intptr_t", "signed long", "signed long long"); + //TODO TEST_SCANF_WARN_AKA("%llx","unsigned long long","std::uintptr_t", "unsigned long long"); TEST_SCANF_WARN("%lld","long long","bool"); TEST_SCANF_WARN("%lld","long long","char"); @@ -1250,10 +1271,31 @@ private: // TODO TEST_SCANF_WARN_AKA("%Lu", "unsigned long long", "std::uintptr_t", "unsigned long", "unsigned long long"); TEST_SCANF_WARN("%Lx", "unsigned long long", "bool"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "char"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "signed char"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "unsigned char"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "signed short"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "unsigned short"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "signed int"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "unsigned int"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "signed long"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "unsigned long"); TEST_SCANF_WARN("%Lx", "unsigned long long", "signed long long"); TEST_SCANF_NOWARN("%Lx", "unsigned long long", "unsigned long long"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "float"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "double"); + TEST_SCANF_WARN("%Lx", "unsigned long long", "long double"); TEST_SCANF_WARN("%Lx", "unsigned long long", "void *"); TEST_SCANF_WARN_AKA_WIN32("%Lx", "unsigned long long", "size_t", "unsigned long"); + TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "ssize_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "ptrdiff_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA_WIN32("%Lx", "unsigned long long", "unsigned ptrdiff_t", "unsigned long"); + TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "intmax_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA_WIN32("%Lx", "unsigned long long", "uintmax_t", "unsigned long"); + TEST_SCANF_WARN_AKA_WIN32("%Lx", "unsigned long long", "std::size_t", "unsigned long"); + TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "std::ssize_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "std::ptrdiff_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "std::intptr_t", "signed long", "signed long long"); // TODO TEST_SCANF_WARN_AKA("%Lx", "unsigned long long", "std::uintptr_t", "unsigned long", "unsigned long long"); TEST_SCANF_WARN("%Ld", "long long", "bool"); @@ -1547,15 +1589,34 @@ private: TEST_SCANF_WARN_AKA_WIN32("%I64u", "unsigned __int64", "std::uintptr_t", "unsigned long"); TEST_SCANF_WARN("%I64x", "unsigned __int64", "bool"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "char"); TEST_SCANF_WARN("%I64x", "unsigned __int64", "signed char"); TEST_SCANF_WARN("%I64x", "unsigned __int64", "unsigned char"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "signed short"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "unsigned short"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "signed int"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "unsigned int"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "signed long"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "unsigned long"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "signed long long"); + TEST_SCANF_NOWARN("%I64x", "unsigned __int64", "unsigned long long"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "float"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "double"); + TEST_SCANF_WARN("%I64x", "unsigned __int64", "long double"); TEST_SCANF_WARN("%I64x", "unsigned __int64", "void *"); //TODO TEST_SCANF_WARN("%I64x", "unsigned __int64", "size_t"); - TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "intmax_t", "signed long", "signed long long"); TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "ssize_t", "signed long", "signed long long"); TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "ptrdiff_t", "signed long", "signed long long"); TEST_SCANF_NOWARN("%I64x", "unsigned __int64", "unsigned __int64"); // TODO TEST_SCANF_WARN("%I64x", "unsigned __int64", "__int64"); + TEST_SCANF_WARN_AKA_WIN32("%I64x", "unsigned __int64", "unsigned ptrdiff_t", "unsigned long"); + TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "intmax_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA_WIN32("%I64x", "unsigned __int64", "uintmax_t", "unsigned long"); + TEST_SCANF_WARN_AKA_WIN32("%I64x", "unsigned __int64", "std::size_t", "unsigned long"); + TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "std::ssize_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "std::ptrdiff_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA("%I64x", "unsigned __int64", "std::intptr_t", "signed long", "signed long long"); + TEST_SCANF_WARN_AKA_WIN32("%I64x", "unsigned __int64", "std::uintptr_t", "unsigned long"); TEST_SCANF_WARN("%I64d", "__int64", "bool"); TEST_SCANF_WARN("%I64d", "__int64", "signed char");