2 * PROJECT: ReactOS Spooler Router API Tests
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Tests for MarshallUpStructuresArray
5 * COPYRIGHT: Copyright 2018 Colin Finck (colin@reactos.org)
10 #define WIN32_NO_STATUS
13 #include <marshalling/marshalling.h>
15 START_TEST(MarshallUpStructuresArray
)
17 // Setting cElements to zero should yield success.
18 SetLastError(0xDEADBEEF);
19 ok(MarshallUpStructuresArray(0, NULL
, 0, NULL
, 0, FALSE
), "MarshallUpStructuresArray returns FALSE!\n");
20 ok(GetLastError() == 0xDEADBEEF, "GetLastError returns %lu!\n", GetLastError());
22 // Setting cElements non-zero should fail with ERROR_INVALID_PARAMETER.
23 SetLastError(0xDEADBEEF);
24 ok(!MarshallUpStructuresArray(0, NULL
, 1, NULL
, 0, FALSE
), "MarshallUpStructuresArray returns TRUE!\n");
25 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError returns %lu!\n", GetLastError());
27 // This is triggered by both pStructuresArray and pInfo.
28 SetLastError(0xDEADBEEF);
29 ok(!MarshallUpStructuresArray(0, (PVOID
)0xDEADDEAD, 1, NULL
, 0, FALSE
), "MarshallUpStructuresArray returns TRUE!\n");
30 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError returns %lu!\n", GetLastError());
32 SetLastError(0xDEADBEEF);
33 ok(!MarshallUpStructuresArray(0, NULL
, 1, (const MARSHALLING_INFO
*)0xDEADDEAD, 0, FALSE
), "MarshallUpStructuresArray returns TRUE!\n");
34 ok(GetLastError() == ERROR_INVALID_PARAMETER
, "GetLastError returns %lu!\n", GetLastError());
36 // More testing is conducted in the MarshallDownStructuresArray test.