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)))
{
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);
/* 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)
{
UINT32 expectedSize;
BYTE OutputBuffer[65536];
mppc = mppc_context_new(1, TRUE);
+
if (!mppc)
return -1;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
-
mppc = mppc_context_new(0, TRUE);
+
if (!mppc)
return -1;
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
+
if (status < 0)
goto fail;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE* pDstData = NULL;
-
mppc = mppc_context_new(1, FALSE);
+
if (!mppc)
return -1;
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;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
UINT32 expectedSize;
BYTE* pDstData = NULL;
mppc = mppc_context_new(0, FALSE);
+
if (!mppc)
return -1;
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;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
-
mppc = mppc_context_new(1, TRUE);
+
if (!mppc)
return -1;
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
+
if (status < 0)
goto fail;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE OutputBuffer[65536];
-
mppc = mppc_context_new(1, TRUE);
+
if (!mppc)
return -1;
DstSize = sizeof(OutputBuffer);
pDstData = OutputBuffer;
status = mppc_compress(mppc, pSrcData, SrcSize, &pDstData, &DstSize, &Flags);
+
if (status < 0)
goto fail;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
MPPC_CONTEXT* mppc;
UINT32 expectedSize;
BYTE* pDstData = NULL;
-
mppc = mppc_context_new(1, FALSE);
+
if (!mppc)
return -1;
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;
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;
}
}
rc = 0;
-
fail:
mppc_context_free(mppc);
return rc;
int TestFreeRDPCodecMppc(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
if (test_MppcCompressIslandRdp5() < 0)
return -1;
int TestFreeRDPCodecNCrush(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
if (!test_NCrushCompressBells())
return -1;
int TestFreeRDPCodecPlanar(int argc, char* argv[])
{
UINT32 x;
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
for (x = 0; x < colorFormatCount; x++)
{
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,
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()
{
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");
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");
int TestFreeRDPCodecXCrush(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
//if (test_XCrushCompressBells() < 0)
// return -1;
if (test_XCrushCompressIsland() < 0)
int TestFreeRDPCodecZGfx(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
if (test_ZGfxCompressFox() < 0)
return -1;
{
int i, testNb = 0;
int retCode = -1;
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
for (i = 0; tests[i].func; i++)
{
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))
{
int randomPort;
int random;
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
winpr_RAND((BYTE*)&random, sizeof(random));
randomPort = 3389 + (random % 200);
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;
#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=="},
-
- {NULL, -1, NULL}, /* /!\ last one /!\ */
+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 /!\ */
};
{
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))
{
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);
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");
}
crypto_base64_decode("0=00", 4, &decoded, &outLen);
+
if (decoded)
{
fprintf(stderr, "ko, = in a wrong place\n");
}
crypto_base64_decode("00=0", 4, &decoded, &outLen);
+
if (decoded)
{
fprintf(stderr, "ko, = in a wrong place\n");
return -1;
}
- fprintf(stderr, "ok\n");
-
+ fprintf(stderr, "ok\n");
return 0;
}
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,
{
enum
{
- DISABLED, ENABLED,
+ DISABLED, ENABLED,
} status;
const char* field_description;
get_field_pr get_field;
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;
}
const certificate_test_t certificate_tests[] =
- {
+{
{
ENABLED,
certificate_tests[i].expected_result);
success = -1;
}
+
free(result);
}
else
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;
}
PIXEL_FORMAT_XBGR32
};
const UINT32 listSize = sizeof(formatList) / sizeof(formatList[0]);
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
for (x = 0; x < listSize; x++)
{
rc = 0;
fail:
-
gdi_DeleteObject((HGDIOBJECT)rgn1);
gdi_DeleteObject((HGDIOBJECT)rgn2);
gdi_DeleteObject((HGDIOBJECT)bmp);
-
gdi_DeleteDC(hdc);
return rc;
}
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)
int TestGdiCreate(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
fprintf(stderr, "test_gdi_GetDC()\n");
if (test_gdi_GetDC() < 0)
};
const UINT32 number_formats = sizeof(colorFormats) / sizeof(colorFormats[0]);
gdiPalette g;
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
for (i = 0; i < number_formats; i++)
{
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++)
{
int TestGdiRect(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
+
if (test_gdi_PtInRect() < 0)
return -1;
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++)
{
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++)
{
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++)
{
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++)
{
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++)
{
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++)
{
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++)
{
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;
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;
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;
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;
/* ------------------------------------------------------------------------- */
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);
#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);
}
}
- 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)
};
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++)
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)
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;
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;
int TestPrimitivesCopy(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
prim_test_setup(FALSE);
if (!test_copy8u_func())
int TestPrimitivesSet(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
prim_test_setup(FALSE);
if (!test_set8u_func())
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;
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;
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;
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;
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);
+ 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 = optimized->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 = 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 = 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;
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);
+ 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 = optimized->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 = 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 = 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;
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;
{
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;
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;
{
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;
int TestPrimitivesShift(int argc, char* argv[])
{
+ WINPR_UNUSED(argc);
+ WINPR_UNUSED(argv);
prim_test_setup(FALSE);
if (!test_lShift_16s_func())