Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/mfplat/tests/mfplat.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 52470ad577b..8367d6a2646 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -5662,6 +5662,8 @@ static void test_MFCreate2DMediaBuffer(void) ok(hr == S_OK, "Failed to lock buffer, hr %#x.\n", hr); ok(max_length == length, "Unexpected length.\n");
+ memset(data, 0xaa, length); + length = 0; pMFGetPlaneSize(MAKEFOURCC('N','V','1','2'), 2, 3, &length); ok(max_length == length && length == 9, "Unexpected length %u.\n", length); @@ -5715,6 +5717,16 @@ static void test_MFCreate2DMediaBuffer(void) ok(((uintptr_t)data & MF_64_BYTE_ALIGNMENT) == 0, "Data at %p is insufficiently aligned.\n", data); ok(pitch == 64, "Unexpected pitch %d.\n", pitch);
+ ok(data[0] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[0]); + ok(data[1] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[1]); + ok(data[64] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[64]); + ok(data[65] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[65]); + ok(data[128] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[128]); + ok(data[129] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[129]); + ok(data[192] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[192]); + ok(data[193] == 0xaa, "Invalid data 0x%02x instead of 0xaa.\n", data[193]); + memset(data, 0xbb, 194); + hr = IMF2DBuffer_Lock2D(_2dbuffer, &data2, &pitch); ok(hr == S_OK, "Failed to lock buffer, hr %#x.\n", hr); ok(data == data2, "Expected data pointer.\n"); @@ -5741,6 +5753,16 @@ static void test_MFCreate2DMediaBuffer(void) hr = IMF2DBuffer_Unlock2D(_2dbuffer); ok(hr == HRESULT_FROM_WIN32(ERROR_WAS_UNLOCKED), "Unexpected hr %#x.\n", hr);
+ hr = IMFMediaBuffer_Lock(buffer, &data, NULL, NULL); + ok(hr == S_OK, "Failed to lock buffer, hr %#x.\n", hr); + + for (i = 0; i < 8; i++) + todo_wine + ok(data[i] == 0xbb, "Invalid data 0x%02x at position %u instead of 0xbb.\n", data[i], i); + + hr = IMFMediaBuffer_Unlock(buffer); + ok(hr == S_OK, "Failed to unlock buffer, hr %#x.\n", hr); + hr = IMFMediaBuffer_QueryInterface(buffer, &IID_IMF2DBuffer2, (void **)&_2dbuffer2); ok(hr == S_OK || broken(hr == E_NOINTERFACE), "Failed to get interface, hr %#x.\n", hr);