2 * Copyright 2002 Andriy Palamarchuk
4 * Conformance test of the network buffer function.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "wine/test.h"
29 void run_apibuf_tests(void)
34 /* test normal logic */
35 ok(NetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success,
37 ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
38 ok(dwSize >= 1024, "The size is correct");
40 ok(NetApiBufferReallocate(p, 1500, (LPVOID *) &p) == NERR_Success,
42 ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
43 ok(dwSize >= 1500, "The size is correct");
45 ok(NetApiBufferFree(p) == NERR_Success, "Freed");
47 /* test errors handling */
48 ok(NetApiBufferFree(p) == NERR_Success, "Freed");
50 ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
51 ok(dwSize >= 0, "The size");
52 ok(NetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer");
55 ok(NetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success,
57 ok(NetApiBufferSize(p, &dwSize) == NERR_Success, "Got size");
58 ok((dwSize >= 0) && (dwSize < 0xFFFFFFFF),"The size of the 0-length buffer");
59 ok(NetApiBufferFree(p) == NERR_Success, "Freed");