Silenced some unused parameter warnings.

This commit is contained in:
Armin Novak 2019-05-08 12:20:43 +02:00
parent beac1f50ff
commit ca4a1d19a5
29 changed files with 358 additions and 228 deletions

View File

@ -74,6 +74,9 @@ fail:
int TestFreeRDPCodecClear(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
/* Example 1 needs a filled glyph cache
if (!test_ClearDecompressExample(1, 8, 9, TEST_CLEAR_EXAMPLE_1,
sizeof(TEST_CLEAR_EXAMPLE_1)))

View File

@ -156,6 +156,8 @@ int TestFreeRDPCodecInterleaved(int argc, char* argv[])
{
BITMAP_INTERLEAVED_CONTEXT* encoder, * decoder;
int rc = -1;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
encoder = bitmap_interleaved_context_new(TRUE);
decoder = bitmap_interleaved_context_new(FALSE);

View File

@ -694,48 +694,48 @@ static const BYTE TEST_MPPC_BELLS[] = "for.whom.the.bell.tolls,.the.bell.tolls.f
/* Flags: 0x0060 Length: 33 */
static const BYTE TEST_MPPC_BELLS_RDP4[] =
"\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c"
"\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xf4\x37\x2e\x66\xfa\x1f\x19\x94"
"\x84";
"\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c"
"\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xf4\x37\x2e\x66\xfa\x1f\x19\x94"
"\x84";
/* Flags: 0x0061 Length: 34 */
static const BYTE TEST_MPPC_BELLS_RDP5[] =
"\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c"
"\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xfa\x1b\x97\x33\x7e\x87\xe3\x32"
"\x90\x80";
"\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62\x65\x6c"
"\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\xfa\x1b\x97\x33\x7e\x87\xe3\x32"
"\x90\x80";
static const BYTE TEST_ISLAND_DATA[] =
"No man is an island entire of itself; every man "
"is a piece of the continent, a part of the main; "
"if a clod be washed away by the sea, Europe "
"is the less, as well as if a promontory were, as"
"well as any manner of thy friends or of thine "
"own were; any man's death diminishes me, "
"because I am involved in mankind. "
"And therefore never send to know for whom "
"the bell tolls; it tolls for thee.";
"No man is an island entire of itself; every man "
"is a piece of the continent, a part of the main; "
"if a clod be washed away by the sea, Europe "
"is the less, as well as if a promontory were, as"
"well as any manner of thy friends or of thine "
"own were; any man's death diminishes me, "
"because I am involved in mankind. "
"And therefore never send to know for whom "
"the bell tolls; it tolls for thee.";
static const BYTE TEST_ISLAND_DATA_RDP5[] =
"\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2\xdc\xc8"
"\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6\xca\xd8"
"\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65\x63\xfc"
"\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2\x40\xe0"
"\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b\x37\xd7"
"\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2\x10\x30"
"\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20\x45\x75"
"\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69\xcc\x81"
"\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2\xb3\x7f"
"\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96\xe6\x57"
"\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f\xd2\xb6"
"\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49\x3b\x99"
"\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96\xce\x64"
"\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30\xb6\x90"
"\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69\x6e\x64"
"\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd\xbf\x04"
"\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81\x03\xbb"
"\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec\xf3\xa7"
"\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80";
"\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2\xdc\xc8"
"\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6\xca\xd8"
"\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65\x63\xfc"
"\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2\x40\xe0"
"\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b\x37\xd7"
"\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2\x10\x30"
"\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20\x45\x75"
"\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69\xcc\x81"
"\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2\xb3\x7f"
"\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96\xe6\x57"
"\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f\xd2\xb6"
"\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49\x3b\x99"
"\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96\xce\x64"
"\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30\xb6\x90"
"\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69\x6e\x64"
"\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd\xbf\x04"
"\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81\x03\xbb"
"\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec\xf3\xa7"
"\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80";
static int test_MppcCompressBellsRdp5(void)
{
@ -750,6 +750,7 @@ static int test_MppcCompressBellsRdp5(void)
UINT32 expectedSize;
BYTE OutputBuffer[65536];
mppc = mppc_context_new(1, TRUE);
if (!mppc)
return -1;
@ -759,13 +760,16 @@ static int test_MppcCompressBellsRdp5(void)
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
if (status < 0)
goto fail;
printf("Flags: 0x%08"PRIX32" DstSize: %"PRIu32"\n", Flags, DstSize);
if (DstSize != expectedSize)
{
printf("MppcCompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcCompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -780,7 +784,6 @@ static int test_MppcCompressBellsRdp5(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -798,8 +801,8 @@ static int test_MppcCompressBellsRdp4(void)
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
mppc = mppc_context_new(0, TRUE);
if (!mppc)
return -1;
@ -809,6 +812,7 @@ static int test_MppcCompressBellsRdp4(void)
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
if (status < 0)
goto fail;
@ -816,7 +820,8 @@ static int test_MppcCompressBellsRdp4(void)
if (DstSize != expectedSize)
{
printf("MppcCompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcCompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -831,7 +836,6 @@ static int test_MppcCompressBellsRdp4(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -848,8 +852,8 @@ static int test_MppcDecompressBellsRdp5(void)
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE* pDstData = NULL;
mppc = mppc_context_new(1, FALSE);
if (!mppc)
return -1;
@ -858,6 +862,7 @@ static int test_MppcDecompressBellsRdp5(void)
Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1;
expectedSize = sizeof(TEST_MPPC_BELLS) - 1;
status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags);
if (status < 0)
goto fail;
@ -865,7 +870,8 @@ static int test_MppcDecompressBellsRdp5(void)
if (DstSize != expectedSize)
{
printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcDecompressBellsRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -876,7 +882,6 @@ static int test_MppcDecompressBellsRdp5(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -894,6 +899,7 @@ static int test_MppcDecompressBellsRdp4(void)
UINT32 expectedSize;
BYTE* pDstData = NULL;
mppc = mppc_context_new(0, FALSE);
if (!mppc)
return -1;
@ -902,6 +908,7 @@ static int test_MppcDecompressBellsRdp4(void)
Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 0;
expectedSize = sizeof(TEST_MPPC_BELLS) - 1;
status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags);
if (status < 0)
goto fail;
@ -909,7 +916,8 @@ static int test_MppcDecompressBellsRdp4(void)
if (DstSize != expectedSize)
{
printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcDecompressBellsRdp4: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -920,7 +928,6 @@ static int test_MppcDecompressBellsRdp4(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -938,8 +945,8 @@ static int test_MppcCompressIslandRdp5(void)
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
mppc = mppc_context_new(1, TRUE);
if (!mppc)
return -1;
@ -949,6 +956,7 @@ static int test_MppcCompressIslandRdp5(void)
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
if (status < 0)
goto fail;
@ -956,7 +964,8 @@ static int test_MppcCompressIslandRdp5(void)
if (DstSize != expectedSize)
{
printf("MppcCompressIslandRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcCompressIslandRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -971,7 +980,6 @@ static int test_MppcCompressIslandRdp5(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -989,8 +997,8 @@ static int test_MppcCompressBufferRdp5(void)
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
mppc = mppc_context_new(1, TRUE);
if (!mppc)
return -1;
@ -1000,6 +1008,7 @@ static int test_MppcCompressBufferRdp5(void)
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
if (status < 0)
goto fail;
@ -1007,7 +1016,8 @@ static int test_MppcCompressBufferRdp5(void)
if (DstSize != expectedSize)
{
printf("MppcCompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcCompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -1018,7 +1028,6 @@ static int test_MppcCompressBufferRdp5(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -1035,8 +1044,8 @@ static int test_MppcDecompressBufferRdp5(void)
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE* pDstData = NULL;
mppc = mppc_context_new(1, FALSE);
if (!mppc)
return -1;
@ -1045,6 +1054,7 @@ static int test_MppcDecompressBufferRdp5(void)
Flags = PACKET_AT_FRONT | PACKET_COMPRESSED | 1;
expectedSize = sizeof(TEST_RDP5_UNCOMPRESSED_DATA);
status = mppc_decompress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, Flags);
if (status < 0)
goto fail;
@ -1052,7 +1062,8 @@ static int test_MppcDecompressBufferRdp5(void)
if (DstSize != expectedSize)
{
printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("MppcDecompressBufferRdp5: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
goto fail;
}
@ -1063,7 +1074,6 @@ static int test_MppcDecompressBufferRdp5(void)
}
rc = 0;
fail:
mppc_context_free(mppc);
return rc;
@ -1071,6 +1081,9 @@ fail:
int TestFreeRDPCodecMppc(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
if (test_MppcCompressIslandRdp5() < 0)
return -1;

View File

@ -113,6 +113,9 @@ fail:
int TestFreeRDPCodecNCrush(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
if (!test_NCrushCompressBells())
return -1;

View File

@ -3052,6 +3052,8 @@ fail:
int TestFreeRDPCodecPlanar(int argc, char* argv[])
{
UINT32 x;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
for (x = 0; x < colorFormatCount; x++)
{

View File

@ -926,6 +926,8 @@ int TestFreeRDPCodecProgressive(int argc, char* argv[])
char* ms_sample_path;
char name[8192];
SYSTEMTIME systemTime;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
GetSystemTime(&systemTime);
sprintf_s(name, sizeof(name),
"EGFX_PROGRESSIVE_MS_SAMPLE-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16,

View File

@ -6,42 +6,42 @@
static const BYTE TEST_BELLS_DATA[] = "for.whom.the.bell.tolls,.the.bell.tolls.for.thee!";
static const BYTE TEST_BELLS_DATA_XCRUSH[] =
"\x12\x00\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62"
"\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\x2e\x74\x68\x65\x2e\x62"
"\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2e\x66\x6f\x72\x2e\x74\x68"
"\x65";
"\x12\x00\x66\x6f\x72\x2e\x77\x68\x6f\x6d\x2e\x74\x68\x65\x2e\x62"
"\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2c\x2e\x74\x68\x65\x2e\x62"
"\x65\x6c\x6c\x2e\x74\x6f\x6c\x6c\x73\x2e\x66\x6f\x72\x2e\x74\x68"
"\x65";
static const BYTE TEST_ISLAND_DATA[] =
"No man is an island entire of itself; every man "
"is a piece of the continent, a part of the main; "
"if a clod be washed away by the sea, Europe "
"is the less, as well as if a promontory were, as"
"well as any manner of thy friends or of thine "
"own were; any man's death diminishes me, "
"because I am involved in mankind. "
"And therefore never send to know for whom "
"the bell tolls; it tolls for thee.";
"No man is an island entire of itself; every man "
"is a piece of the continent, a part of the main; "
"if a clod be washed away by the sea, Europe "
"is the less, as well as if a promontory were, as"
"well as any manner of thy friends or of thine "
"own were; any man's death diminishes me, "
"because I am involved in mankind. "
"And therefore never send to know for whom "
"the bell tolls; it tolls for thee.";
static const BYTE TEST_ISLAND_DATA_XCRUSH[] =
"\x12\x61\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2"
"\xdc\xc8\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6"
"\xca\xd8\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65"
"\x63\xfc\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2"
"\x40\xe0\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b"
"\x37\xd7\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2"
"\x10\x30\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20"
"\x45\x75\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69"
"\xcc\x81\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2"
"\xb3\x7f\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96"
"\xe6\x57\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f"
"\xd2\xb6\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49"
"\x3b\x99\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96"
"\xce\x64\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30"
"\xb6\x90\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69"
"\x6e\x64\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd"
"\xbf\x04\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81"
"\x03\xbb\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec"
"\xf3\xa7\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80";
"\x12\x61\x4e\x6f\x20\x6d\x61\x6e\x20\x69\x73\x20\xf8\xd2\xd8\xc2"
"\xdc\xc8\x40\xca\xdc\xe8\xd2\xe4\xca\x40\xde\xcc\x40\xd2\xe8\xe6"
"\xca\xd8\xcc\x76\x40\xca\xec\xca\xe4\xf3\xfa\x71\x20\x70\x69\x65"
"\x63\xfc\x12\xe8\xd0\xca\x40\xc6\xdf\xfb\xcd\xdf\xd0\x58\x40\xc2"
"\x40\xe0\xc2\xe4\xe9\xfe\x63\xec\xc3\x6b\x0b\x4b\x71\xd9\x03\x4b"
"\x37\xd7\x31\xb6\x37\xb2\x10\x31\x32\x90\x3b\xb0\xb9\xb4\x32\xb2"
"\x10\x30\xbb\xb0\xbc\x90\x31\x3c\x90\x7e\x68\x73\x65\x61\x2c\x20"
"\x45\x75\x72\x6f\x70\x65\xf2\x34\x7d\x38\x6c\x65\x73\x73\xf0\x69"
"\xcc\x81\xdd\x95\xb1\xb0\x81\x85\xcf\xc0\x94\xe0\xe4\xde\xdb\xe2"
"\xb3\x7f\x92\x4e\xec\xae\x4c\xbf\x86\x3f\x06\x0c\x2d\xde\x5d\x96"
"\xe6\x57\x2f\x1e\x53\xc9\x03\x33\x93\x4b\x2b\x73\x23\x99\x03\x7f"
"\xd2\xb6\x96\xef\x38\x1d\xdb\xbc\x24\x72\x65\x3b\xf5\x5b\xf8\x49"
"\x3b\x99\x03\x23\x2b\x0b\xa3\x41\x03\x23\x4b\x6b\x4b\x73\x4f\x96"
"\xce\x64\x0d\xbe\x19\x31\x32\xb1\xb0\xba\xb9\xb2\x90\x24\x90\x30"
"\xb6\x90\x34\xb7\x3b\x37\xb6\x3b\x79\xd4\xd2\xdd\xec\x18\x6b\x69"
"\x6e\x64\x2e\x20\x41\xf7\x33\xcd\x47\x26\x56\x66\xff\x74\x9b\xbd"
"\xbf\x04\x0e\x7e\x31\x10\x3a\x37\x90\x35\xb7\x37\xbb\x90\x7d\x81"
"\x03\xbb\x43\x7b\x6f\xa8\xe5\x8b\xd0\xf0\xe8\xde\xd8\xd8\xe7\xec"
"\xf3\xa7\xe4\x7c\xa7\xe2\x9f\x01\x99\x4b\x80";
int test_XCrushCompressBells()
{
@ -66,7 +66,8 @@ int test_XCrushCompressBells()
if (DstSize != expectedSize)
{
printf("XCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("XCrushCompressBells: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
printf("Actual\n");
BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0);
printf("Expected\n");
@ -111,7 +112,8 @@ int test_XCrushCompressIsland()
if (DstSize != expectedSize)
{
printf("XCrushCompressIsland: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n", DstSize, expectedSize);
printf("XCrushCompressIsland: output size mismatch: Actual: %"PRIu32", Expected: %"PRIu32"\n",
DstSize, expectedSize);
printf("Actual\n");
BitDump(__FUNCTION__, WLOG_INFO, pDstData, DstSize * 8, 0);
printf("Expected\n");
@ -135,6 +137,9 @@ int test_XCrushCompressIsland()
int TestFreeRDPCodecXCrush(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
//if (test_XCrushCompressBells() < 0)
// return -1;
if (test_XCrushCompressIsland() < 0)

View File

@ -251,6 +251,9 @@ fail:
int TestFreeRDPCodecZGfx(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
if (test_ZGfxCompressFox() < 0)
return -1;

View File

@ -912,6 +912,8 @@ int TestFreeRDPRegion(int argc, char* argv[])
{
int i, testNb = 0;
int retCode = -1;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
for (i = 0; tests[i].func; i++)
{

View File

@ -168,7 +168,10 @@ fail:
int TestCommonAssistance(int argc, char* argv[])
{
wLog* log = WLog_Get(__FUNCTION__);
wLog* log;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
log = WLog_Get(__FUNCTION__);
winpr_InitializeSSL(WINPR_SSL_INIT_DEFAULT);
if (!test_msrsc_incident_file_type1(log))

View File

@ -282,6 +282,8 @@ int TestConnect(int argc, char* argv[])
{
int randomPort;
int random;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
winpr_RAND((BYTE*)&random, sizeof(random));
randomPort = 3389 + (random % 200);

View File

@ -2,25 +2,29 @@
int TestSettings(int argc, char* argv[])
{
rdpSettings *settings = NULL;
rdpSettings *cloned;
rdpSettings* settings = NULL;
rdpSettings* cloned;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
settings = freerdp_settings_new(0);
if (!settings)
{
printf("Couldn't create settings\n");
return -1;
}
settings->Username = _strdup("abcdefg");
settings->Password = _strdup("xyz");
cloned = freerdp_settings_clone(settings);
if (!cloned)
{
printf("Problem cloning settings\n");
freerdp_settings_free(settings);
return -1;
}
freerdp_settings_free(cloned);
freerdp_settings_free(settings);
return 0;

View File

@ -19,22 +19,24 @@
#include <freerdp/crypto/crypto.h>
struct Encode64test {
const char *input;
struct Encode64test
{
const char* input;
int len;
const char *output;
const char* output;
};
struct Encode64test encodeTests[] = {
{"\x00", 1, "AA=="},
{"\x00\x00", 2, "AAA="},
{"\x00\x00\x00", 3, "AAAA"},
{"0123456", 7, "MDEyMzQ1Ng=="},
{"90123456", 8, "OTAxMjM0NTY="},
{"890123456", 9, "ODkwMTIzNDU2"},
{"7890123456", 10, "Nzg5MDEyMzQ1Ng=="},
struct Encode64test encodeTests[] =
{
{"\x00", 1, "AA=="},
{"\x00\x00", 2, "AAA="},
{"\x00\x00\x00", 3, "AAAA"},
{"0123456", 7, "MDEyMzQ1Ng=="},
{"90123456", 8, "OTAxMjM0NTY="},
{"890123456", 9, "ODkwMTIzNDU2"},
{"7890123456", 10, "Nzg5MDEyMzQ1Ng=="},
{NULL, -1, NULL}, /* /!\ last one /!\ */
{NULL, -1, NULL}, /* /!\ last one /!\ */
};
@ -42,14 +44,15 @@ int TestBase64(int argc, char* argv[])
{
int i, testNb = 0;
int outLen;
BYTE *decoded;
BYTE* decoded;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
testNb++;
fprintf(stderr, "%d:encode base64...", testNb);
for (i = 0; encodeTests[i].input; i++)
{
char *encoded = crypto_base64_encode((const BYTE *)encodeTests[i].input, encodeTests[i].len);
char* encoded = crypto_base64_encode((const BYTE*)encodeTests[i].input, encodeTests[i].len);
if (strcmp(encodeTests[i].output, encoded))
{
@ -59,10 +62,11 @@ int TestBase64(int argc, char* argv[])
free(encoded);
}
fprintf(stderr, "ok\n");
fprintf(stderr, "ok\n");
testNb++;
fprintf(stderr, "%d:decode base64...", testNb);
for (i = 0; encodeTests[i].input; i++)
{
crypto_base64_decode(encodeTests[i].output, strlen(encodeTests[i].output), &decoded, &outLen);
@ -75,11 +79,12 @@ int TestBase64(int argc, char* argv[])
free(decoded);
}
fprintf(stderr, "ok\n");
fprintf(stderr, "ok\n");
testNb++;
fprintf(stderr, "%d:decode base64 errors...", testNb);
crypto_base64_decode("000", 3, &decoded, &outLen);
if (decoded)
{
fprintf(stderr, "ko, badly padded string\n");
@ -87,6 +92,7 @@ int TestBase64(int argc, char* argv[])
}
crypto_base64_decode("0=00", 4, &decoded, &outLen);
if (decoded)
{
fprintf(stderr, "ko, = in a wrong place\n");
@ -94,13 +100,13 @@ int TestBase64(int argc, char* argv[])
}
crypto_base64_decode("00=0", 4, &decoded, &outLen);
if (decoded)
{
fprintf(stderr, "ko, = in a wrong place\n");
return -1;
}
fprintf(stderr, "ok\n");
return 0;
}

View File

@ -102,7 +102,8 @@ int TestKnownHosts(int argc, char* argv[])
char sname[8192];
char dname[8192];
SYSTEMTIME systemTime;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
GetSystemTime(&systemTime);
sprintf_s(sname, sizeof(sname),
"TestKnownHostsCurrent-%04"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%02"PRIu16"%04"PRIu16,

View File

@ -6,7 +6,7 @@ typedef struct
{
enum
{
DISABLED, ENABLED,
DISABLED, ENABLED,
} status;
const char* field_description;
get_field_pr get_field;
@ -26,18 +26,18 @@ char* certificate_path()
Assume that __FILE__ will be a valid path to this file, even from the current working directory where the tests are run.
(ie. no chdir occurs between compilation and test running, or __FILE__ is an absolute path).
*/
#if defined(_WIN32)
static const char dirsep = '\\';
#else
static const char dirsep = '/';
#endif
static const char * filename = "Test_x509_cert_info.pem";
const char * file = __FILE__;
const char * last_dirsep = strrchr(file, dirsep);
static const char* filename = "Test_x509_cert_info.pem";
const char* file = __FILE__;
const char* last_dirsep = strrchr(file, dirsep);
if (last_dirsep)
{
char * result = malloc(last_dirsep - file + 1 + strlen(filename) + 1);
char* result = malloc(last_dirsep - file + 1 + strlen(filename) + 1);
strncpy(result, file, (last_dirsep - file + 1));
strcpy(result + (last_dirsep - file + 1), filename);
return result;
@ -50,7 +50,7 @@ char* certificate_path()
}
const certificate_test_t certificate_tests[] =
{
{
{
ENABLED,
@ -150,6 +150,7 @@ int TestCertificateFile(const char* certificate_path, const certificate_test_t*
certificate_tests[i].expected_result);
success = -1;
}
free(result);
}
else
@ -168,7 +169,10 @@ fail:
int Test_x509_cert_info(int argc, char* argv[])
{
char* cert_path = certificate_path();
int ret = TestCertificateFile(cert_path, certificate_tests, ARRAYSIZE(certificate_tests));
int ret;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
ret = TestCertificateFile(cert_path, certificate_tests, ARRAYSIZE(certificate_tests));
free(cert_path);
return ret;
}

View File

@ -583,6 +583,8 @@ int TestGdiBitBlt(int argc, char* argv[])
PIXEL_FORMAT_XBGR32
};
const UINT32 listSize = sizeof(formatList) / sizeof(formatList[0]);
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
for (x = 0; x < listSize; x++)
{

View File

@ -159,11 +159,9 @@ static int test_gdi_ClipCoords(void)
rc = 0;
fail:
gdi_DeleteObject((HGDIOBJECT)rgn1);
gdi_DeleteObject((HGDIOBJECT)rgn2);
gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteDC(hdc);
return rc;
}
@ -326,17 +324,17 @@ static int test_gdi_InvalidateRegion(void)
rc = 0;
fail:
gdi_DeleteObject((HGDIOBJECT)rgn1);
gdi_DeleteObject((HGDIOBJECT)rgn2);
gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteDC(hdc);
return 0;
}
int TestGdiClip(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
fprintf(stderr, "test_gdi_ClipCoords()\n");
if (test_gdi_ClipCoords() < 0)

View File

@ -530,6 +530,8 @@ fail:
int TestGdiCreate(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
fprintf(stderr, "test_gdi_GetDC()\n");
if (test_gdi_GetDC() < 0)

View File

@ -103,6 +103,8 @@ int TestGdiEllipse(int argc, char* argv[])
};
const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]);
gdiPalette g;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
for (i = 0; i < number_formats; i++)
{

View File

@ -625,6 +625,8 @@ int TestGdiLine(int argc, char* argv[])
PIXEL_FORMAT_BGRX32
};
const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]);
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
for (i = 0; i < number_formats; i++)
{

View File

@ -155,6 +155,9 @@ fail:
int TestGdiRect(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
if (test_gdi_PtInRect() < 0)
return -1;

View File

@ -207,6 +207,8 @@ static const char* test_ROP3[] =
int TestGdiRop3(int argc, char* argv[])
{
size_t index;
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
for (index = 0; index < sizeof(test_ROP3) / sizeof(test_ROP3[0]); index++)
{

View File

@ -299,6 +299,8 @@ static INLINE void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstForma
const INT16* r, const INT16* g, const INT16* b, DWORD width)
{
DWORD x;
WINPR_UNUSED(formatSize);
WINPR_UNUSED(DstFormat);
for (x = 0; x < width; x++)
{
@ -315,6 +317,8 @@ static INLINE void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstForma
const INT16* r, const INT16* g, const INT16* b, DWORD width)
{
DWORD x;
WINPR_UNUSED(formatSize);
WINPR_UNUSED(DstFormat);
for (x = 0; x < width; x++)
{
@ -331,6 +335,8 @@ static INLINE void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstForm
const INT16* r, const INT16* g, const INT16* b, DWORD width)
{
DWORD x;
WINPR_UNUSED(formatSize);
WINPR_UNUSED(DstFormat);
for (x = 0; x < width; x++)
{
@ -348,6 +354,8 @@ static INLINE void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstForm
const INT16* r, const INT16* g, const INT16* b, DWORD width)
{
DWORD x;
WINPR_UNUSED(formatSize);
WINPR_UNUSED(DstFormat);
for (x = 0; x < width; x++)
{
@ -365,6 +373,8 @@ static INLINE void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstForm
const INT16* r, const INT16* g, const INT16* b, DWORD width)
{
DWORD x;
WINPR_UNUSED(formatSize);
WINPR_UNUSED(DstFormat);
for (x = 0; x < width; x++)
{
@ -382,6 +392,8 @@ static INLINE void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstForm
const INT16* r, const INT16* g, const INT16* b, DWORD width)
{
DWORD x;
WINPR_UNUSED(formatSize);
WINPR_UNUSED(DstFormat);
for (x = 0; x < width; x++)
{

View File

@ -48,6 +48,8 @@
static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format,
BYTE R, BYTE G, BYTE B, BYTE A)
{
WINPR_UNUSED(formatSize);
WINPR_UNUSED(format);
*dst++ = B;
*dst++ = G;
*dst++ = R;
@ -58,6 +60,8 @@ static INLINE BYTE* writePixelBGRX(BYTE* dst, DWORD formatSize, UINT32 format,
static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format,
BYTE R, BYTE G, BYTE B, BYTE A)
{
WINPR_UNUSED(formatSize);
WINPR_UNUSED(format);
*dst++ = R;
*dst++ = G;
*dst++ = B;
@ -68,6 +72,8 @@ static INLINE BYTE* writePixelRGBX(BYTE* dst, DWORD formatSize, UINT32 format,
static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format,
BYTE R, BYTE G, BYTE B, BYTE A)
{
WINPR_UNUSED(formatSize);
WINPR_UNUSED(format);
*dst++ = A;
*dst++ = B;
*dst++ = G;
@ -78,6 +84,8 @@ static INLINE BYTE* writePixelXBGR(BYTE* dst, DWORD formatSize, UINT32 format,
static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format,
BYTE R, BYTE G, BYTE B, BYTE A)
{
WINPR_UNUSED(formatSize);
WINPR_UNUSED(format);
*dst++ = A;
*dst++ = R;
*dst++ = G;

View File

@ -39,6 +39,9 @@ static INIT_ONCE primitives_InitOnce = INIT_ONCE_STATIC_INIT;
/* ------------------------------------------------------------------------- */
static BOOL CALLBACK primitives_init_generic(PINIT_ONCE once, PVOID param, PVOID* context)
{
WINPR_UNUSED(once);
WINPR_UNUSED(param);
WINPR_UNUSED(context);
primitives_init_add(&pPrimitivesGeneric);
primitives_init_andor(&pPrimitivesGeneric);
primitives_init_alphaComp(&pPrimitivesGeneric);
@ -55,6 +58,9 @@ static BOOL CALLBACK primitives_init_generic(PINIT_ONCE once, PVOID param, PVOID
#if defined(HAVE_OPTIMIZED_PRIMITIVES)
static BOOL CALLBACK primitives_init(PINIT_ONCE once, PVOID param, PVOID* context)
{
WINPR_UNUSED(once);
WINPR_UNUSED(param);
WINPR_UNUSED(context);
/* Now call each section's initialization routine. */
primitives_init_add_opt(&pPrimitives);
primitives_init_andor_opt(&pPrimitives);

View File

@ -102,7 +102,8 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(prim_size_t roi, DWORD DstFormat)
}
}
printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, FreeRDPGetColorFormatName(DstFormat));
printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height,
FreeRDPGetColorFormatName(DstFormat));
PROFILER_PRINT_HEADER
PROFILER_PRINT(genericProf)
PROFILER_PRINT(optProf)
@ -274,6 +275,8 @@ int TestPrimitivesColors(int argc, char* argv[])
};
DWORD x;
prim_size_t roi = { 1920, 1080};
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
prim_test_setup(FALSE);
for (x = 0; x < sizeof(formats) / sizeof(formats[0]); x++)

View File

@ -28,7 +28,6 @@ static BOOL test_copy8u_func(void)
BYTE ALIGN(data[COPY_TESTSIZE + 15]);
int i, soff;
BYTE ALIGN(dest[COPY_TESTSIZE + 15]);
winpr_RAND(data, sizeof(data));
for (soff = 0; soff < 16; ++soff)
@ -42,6 +41,7 @@ static BOOL test_copy8u_func(void)
for (length = 1; length <= COPY_TESTSIZE - doff; ++length)
{
memset(dest, 0, sizeof(dest));
if (prims->copy_8u(data + soff, dest + doff, length) != PRIMITIVES_SUCCESS)
return FALSE;
@ -70,15 +70,15 @@ static BOOL test_copy8u_speed(void)
BYTE ALIGN(dst[MAX_TEST_SIZE + 4]);
if (!speed_test("copy_8u", "aligned", g_Iterations,
(speed_test_fkt)generic->copy_8u,
(speed_test_fkt)optimized->copy_8u,
src, dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->copy_8u,
(speed_test_fkt)optimized->copy_8u,
src, dst, MAX_TEST_SIZE))
return FALSE;
if (!speed_test("copy_8u", "unaligned", g_Iterations,
(speed_test_fkt)generic->copy_8u,
(speed_test_fkt)optimized->copy_8u,
src+1, dst+1, MAX_TEST_SIZE))
(speed_test_fkt)generic->copy_8u,
(speed_test_fkt)optimized->copy_8u,
src + 1, dst + 1, MAX_TEST_SIZE))
return FALSE;
return TRUE;
@ -86,6 +86,8 @@ static BOOL test_copy8u_speed(void)
int TestPrimitivesCopy(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
prim_test_setup(FALSE);
if (!test_copy8u_func())

View File

@ -269,6 +269,8 @@ static BOOL test_set32s_speed(void)
int TestPrimitivesSet(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
prim_test_setup(FALSE);
if (!test_set8u_func())

View File

@ -24,28 +24,31 @@
static BOOL test_lShift_16s_func(void)
{
pstatus_t status;
INT16 ALIGN(src[FUNC_TEST_SIZE+3]);
INT16 ALIGN(d1[FUNC_TEST_SIZE+3]);
INT16 ALIGN(src[FUNC_TEST_SIZE + 3]);
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]);
UINT32 val;
winpr_RAND((BYTE*)&val, sizeof(val));
winpr_RAND((BYTE*)src, sizeof(src));
val = (val % (FUNC_TEST_SIZE - 1)) + 1;
/* Aligned */
status = generic->lShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE);
status = generic->lShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->lShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE);
status = optimized->lShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
/* Unaligned */
status = generic->lShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE);
status = generic->lShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->lShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE);
status = optimized->lShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
@ -55,28 +58,31 @@ static BOOL test_lShift_16s_func(void)
static BOOL test_lShift_16u_func(void)
{
pstatus_t status;
UINT16 ALIGN(src[FUNC_TEST_SIZE+3]);
UINT16 ALIGN(d1[FUNC_TEST_SIZE+3]);
UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]);
UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]);
UINT32 val;
winpr_RAND((BYTE*)&val, sizeof(val));
winpr_RAND((BYTE*)src, sizeof(src));
val = (val % (FUNC_TEST_SIZE - 1)) + 1;
/* Aligned */
status = generic->lShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE);
status = generic->lShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->lShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE);
status = optimized->lShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
/* Unaligned */
status = generic->lShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE);
status = generic->lShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->lShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE);
status = optimized->lShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
@ -86,28 +92,31 @@ static BOOL test_lShift_16u_func(void)
static BOOL test_rShift_16s_func(void)
{
pstatus_t status;
INT16 ALIGN(src[FUNC_TEST_SIZE+3]);
INT16 ALIGN(d1[FUNC_TEST_SIZE+3]);
INT16 ALIGN(src[FUNC_TEST_SIZE + 3]);
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]);
UINT32 val;
winpr_RAND((BYTE*)&val, sizeof(val));
winpr_RAND((BYTE*)src, sizeof(src));
val = (val % (FUNC_TEST_SIZE - 1)) + 1;
/* Aligned */
status = generic->rShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE);
status = generic->rShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->rShiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE);
status = optimized->rShiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
/* Unaligned */
status = generic->rShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE);
status = generic->rShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->rShiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE);
status = optimized->rShiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
@ -117,28 +126,31 @@ static BOOL test_rShift_16s_func(void)
static BOOL test_rShift_16u_func(void)
{
pstatus_t status;
UINT16 ALIGN(src[FUNC_TEST_SIZE+3]);
UINT16 ALIGN(d1[FUNC_TEST_SIZE+3]);
UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]);
UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]);
UINT32 val;
winpr_RAND((BYTE*)&val, sizeof(val));
winpr_RAND((BYTE*)src, sizeof(src));
val = (val % (FUNC_TEST_SIZE - 1)) + 1;
/* Aligned */
status = generic->rShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE);
status = generic->rShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->rShiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE);
status = optimized->rShiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
/* Unaligned */
status = generic->rShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE);
status = generic->rShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->rShiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE);
status = optimized->rShiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
@ -148,42 +160,52 @@ static BOOL test_rShift_16u_func(void)
static BOOL test_ShiftWrapper_16s_func(void)
{
pstatus_t status;
INT16 ALIGN(src[FUNC_TEST_SIZE+3]);
INT16 ALIGN(d1[FUNC_TEST_SIZE+3]);
INT16 ALIGN(src[FUNC_TEST_SIZE + 3]);
INT16 ALIGN(d1[FUNC_TEST_SIZE + 3]);
UINT32 tmp;
INT32 val;
winpr_RAND((BYTE*)&tmp, sizeof(tmp));
winpr_RAND((BYTE*)src, sizeof(src));
val = (tmp % (FUNC_TEST_SIZE - 1)) + 1;
/* Aligned */
status = generic->shiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16s(src+1, val, d1+1, FUNC_TEST_SIZE);
status = generic->shiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = generic->shiftC_16s(src+1, -val, d1+1, FUNC_TEST_SIZE);
status = optimized->shiftC_16s(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16s(src+1, -val, d1+1, FUNC_TEST_SIZE);
status = generic->shiftC_16s(src + 1, -val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16s(src + 1, -val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
/* Unaligned */
status = generic->shiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE);
status = generic->shiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16s(src+1, val, d1+2, FUNC_TEST_SIZE);
status = optimized->shiftC_16s(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = generic->shiftC_16s(src+1, -val, d1+2, FUNC_TEST_SIZE);
status = generic->shiftC_16s(src + 1, -val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16s(src+1, -val, d1+2, FUNC_TEST_SIZE);
status = optimized->shiftC_16s(src + 1, -val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
@ -193,42 +215,52 @@ static BOOL test_ShiftWrapper_16s_func(void)
static BOOL test_ShiftWrapper_16u_func(void)
{
pstatus_t status;
UINT16 ALIGN(src[FUNC_TEST_SIZE+3]);
UINT16 ALIGN(d1[FUNC_TEST_SIZE+3]);
UINT16 ALIGN(src[FUNC_TEST_SIZE + 3]);
UINT16 ALIGN(d1[FUNC_TEST_SIZE + 3]);
UINT32 tmp;
INT32 val;
winpr_RAND((BYTE*)&tmp, sizeof(tmp));
winpr_RAND((BYTE*)src, sizeof(src));
val = (tmp % (FUNC_TEST_SIZE - 1)) + 1;
/* Aligned */
status = generic->shiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16u(src+1, val, d1+1, FUNC_TEST_SIZE);
status = generic->shiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = generic->shiftC_16u(src+1, -val, d1+1, FUNC_TEST_SIZE);
status = optimized->shiftC_16u(src + 1, val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16u(src+1, -val, d1+1, FUNC_TEST_SIZE);
status = generic->shiftC_16u(src + 1, -val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16u(src + 1, -val, d1 + 1, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
/* Unaligned */
status = generic->shiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE);
status = generic->shiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16u(src+1, val, d1+2, FUNC_TEST_SIZE);
status = optimized->shiftC_16u(src + 1, val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = generic->shiftC_16u(src+1, -val, d1+2, FUNC_TEST_SIZE);
status = generic->shiftC_16u(src + 1, -val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
status = optimized->shiftC_16u(src+1, -val, d1+2, FUNC_TEST_SIZE);
status = optimized->shiftC_16u(src + 1, -val, d1 + 2, FUNC_TEST_SIZE);
if (status != PRIMITIVES_SUCCESS)
return FALSE;
@ -239,21 +271,20 @@ static BOOL test_ShiftWrapper_16u_func(void)
static BOOL test_lShift_16s_speed(void)
{
UINT32 val;
INT16 ALIGN(src[MAX_TEST_SIZE+1]), ALIGN(dst[MAX_TEST_SIZE+1]);
INT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]);
winpr_RAND((BYTE*)src, sizeof(src));
winpr_RAND((BYTE*)&val, sizeof(val));
if (!speed_test("lShift_16s", "aligned", g_Iterations,
(speed_test_fkt)generic->lShiftC_16s,
(speed_test_fkt)optimized->lShiftC_16s, src, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->lShiftC_16s,
(speed_test_fkt)optimized->lShiftC_16s, src, val,
dst, MAX_TEST_SIZE))
return FALSE;
if (!speed_test("lShift_16s", "unaligned", g_Iterations,
(speed_test_fkt)generic->lShiftC_16s,
(speed_test_fkt)optimized->lShiftC_16s, src + 1, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->lShiftC_16s,
(speed_test_fkt)optimized->lShiftC_16s, src + 1, val,
dst, MAX_TEST_SIZE))
return FALSE;
return TRUE;
@ -264,20 +295,19 @@ static BOOL test_lShift_16u_speed(void)
{
UINT32 val;
UINT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]);
winpr_RAND((BYTE*)&val, sizeof(val));
winpr_RAND((BYTE*)src, sizeof(src));
if (!speed_test("lShift_16u", "aligned", g_Iterations,
(speed_test_fkt)generic->lShiftC_16u,
(speed_test_fkt)optimized->lShiftC_16u, src, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->lShiftC_16u,
(speed_test_fkt)optimized->lShiftC_16u, src, val,
dst, MAX_TEST_SIZE))
return FALSE;
if (!speed_test("lShift_16u", "unaligned", g_Iterations,
(speed_test_fkt)generic->lShiftC_16u,
(speed_test_fkt)optimized->lShiftC_16u, src + 1, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->lShiftC_16u,
(speed_test_fkt)optimized->lShiftC_16u, src + 1, val,
dst, MAX_TEST_SIZE))
return FALSE;
return TRUE;
@ -287,20 +317,20 @@ static BOOL test_lShift_16u_speed(void)
static BOOL test_rShift_16s_speed(void)
{
UINT32 val;
INT16 ALIGN(src[MAX_TEST_SIZE+1]), ALIGN(dst[MAX_TEST_SIZE+1]);
INT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]);
winpr_RAND((BYTE*)src, sizeof(src));
winpr_RAND((BYTE*)&val, sizeof(val));
if (!speed_test("rShift_16s", "aligned", g_Iterations,
(speed_test_fkt)generic->rShiftC_16s,
(speed_test_fkt)optimized->rShiftC_16s, src, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->rShiftC_16s,
(speed_test_fkt)optimized->rShiftC_16s, src, val,
dst, MAX_TEST_SIZE))
return FALSE;
if (!speed_test("rShift_16s", "unaligned", g_Iterations,
(speed_test_fkt)generic->rShiftC_16s,
(speed_test_fkt)optimized->rShiftC_16s, src + 1, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->rShiftC_16s,
(speed_test_fkt)optimized->rShiftC_16s, src + 1, val,
dst, MAX_TEST_SIZE))
return FALSE;
return TRUE;
@ -311,20 +341,19 @@ static BOOL test_rShift_16u_speed(void)
{
UINT32 val;
UINT16 ALIGN(src[MAX_TEST_SIZE + 1]), ALIGN(dst[MAX_TEST_SIZE + 1]);
winpr_RAND((BYTE*)&val, sizeof(val));
winpr_RAND((BYTE*)src, sizeof(src));
if (!speed_test("rShift_16u", "aligned", g_Iterations,
(speed_test_fkt)generic->rShiftC_16u,
(speed_test_fkt)optimized->rShiftC_16u, src, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->rShiftC_16u,
(speed_test_fkt)optimized->rShiftC_16u, src, val,
dst, MAX_TEST_SIZE))
return FALSE;
if (!speed_test("rShift_16u", "unaligned", g_Iterations,
(speed_test_fkt)generic->rShiftC_16u,
(speed_test_fkt)optimized->rShiftC_16u, src + 1, val,
dst, MAX_TEST_SIZE))
(speed_test_fkt)generic->rShiftC_16u,
(speed_test_fkt)optimized->rShiftC_16u, src + 1, val,
dst, MAX_TEST_SIZE))
return FALSE;
return TRUE;
@ -332,6 +361,8 @@ static BOOL test_rShift_16u_speed(void)
int TestPrimitivesShift(int argc, char* argv[])
{
WINPR_UNUSED(argc);
WINPR_UNUSED(argv);
prim_test_setup(FALSE);
if (!test_lShift_16s_func())