mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Extended printf test to verify length sub-specifiers (#2083)
According to work plan for issue #1058
This commit is contained in:
@@ -1491,6 +1491,116 @@ testCase testCaseMixedFormat = { TYPE_MIXED_FORMAT_RANDOM,
|
||||
correctBufferMixedFormat,
|
||||
printMixedFormatGenParameters, NULL };
|
||||
|
||||
|
||||
//=============================================================
|
||||
|
||||
// length sub-specifier format
|
||||
|
||||
//=============================================================
|
||||
|
||||
std::vector<printDataGenParameters> printLenSpecGenParameters = {
|
||||
|
||||
{ { "%hd" }, "32767" },
|
||||
|
||||
{ { "%hhd" }, "127" },
|
||||
|
||||
{ { "%ld" }, "9223372036854775807L" },
|
||||
|
||||
{ { "%hd" }, "-32767" },
|
||||
|
||||
{ { "%hhd" }, "-128" },
|
||||
|
||||
{ { "%ld" }, "-9223372036854775807L" },
|
||||
|
||||
{ { "%hx" }, "32767" },
|
||||
|
||||
{ { "%hhx" }, "127" },
|
||||
|
||||
{ { "%lx" }, "9223372036854775807L" },
|
||||
|
||||
{ { "%hx" }, "-32767" },
|
||||
|
||||
{ { "%hhx" }, "-128" },
|
||||
|
||||
{ { "%lx" }, "-9223372036854775807L" },
|
||||
|
||||
{ { "%ho" }, "32767" },
|
||||
|
||||
{ { "%hho" }, "127" },
|
||||
|
||||
{ { "%lo" }, "9223372036854775807L" },
|
||||
|
||||
{ { "%ho" }, "-32767" },
|
||||
|
||||
{ { "%hho" }, "-128" },
|
||||
|
||||
{ { "%lo" }, "-9223372036854775807L" },
|
||||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
||||
// Lookup table -[string] length specified correct buffer
|
||||
|
||||
//---------------------------------------------------------
|
||||
|
||||
std::vector<std::string> correctBufferLenSpec = {
|
||||
|
||||
"32767",
|
||||
|
||||
"127",
|
||||
|
||||
"9223372036854775807",
|
||||
|
||||
"-32767",
|
||||
|
||||
"-128",
|
||||
|
||||
"-9223372036854775807",
|
||||
|
||||
"7fff",
|
||||
|
||||
"7f",
|
||||
|
||||
"7fffffffffffffff",
|
||||
|
||||
"8001",
|
||||
|
||||
"80",
|
||||
|
||||
"8000000000000001",
|
||||
|
||||
"77777",
|
||||
|
||||
"177",
|
||||
|
||||
"777777777777777777777",
|
||||
|
||||
"100001",
|
||||
|
||||
"200",
|
||||
|
||||
"1000000000000000000001",
|
||||
};
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
// Test case for length specified values
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
testCase testCaseLenSpec = {
|
||||
|
||||
TYPE_LENGTH_SPECIFIER,
|
||||
|
||||
correctBufferLenSpec,
|
||||
|
||||
printLenSpecGenParameters,
|
||||
|
||||
NULL
|
||||
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
|
||||
//All Test cases |
|
||||
@@ -1503,7 +1613,7 @@ std::vector<testCase*> allTestCase = {
|
||||
&testCaseDouble, &testCaseDoubleLimits, &testCaseOctal,
|
||||
&testCaseUnsigned, &testCaseHexadecimal, &testCaseChar,
|
||||
&testCaseString, &testCaseFormatString, &testCaseVector,
|
||||
&testCaseAddrSpace, &testCaseMixedFormat
|
||||
&testCaseAddrSpace, &testCaseMixedFormat, &testCaseLenSpec
|
||||
};
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user