Commit 4ec00cb2 authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

setupapi/tests: Use BOOL type where appropriate.

parent a0636366
......@@ -29,6 +29,8 @@
#include "wine/test.h"
static BOOL is_win9x;
static void test_SetupCreateDiskSpaceListA(void)
{
HDSKSPC ret;
......@@ -149,8 +151,6 @@ static void test_SetupCreateDiskSpaceListW(void)
static void test_SetupDuplicateDiskSpaceListA(void)
{
HDSKSPC handle, duplicate;
int is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) &&
GetLastError() == ERROR_CALL_NOT_IMPLEMENTED;
if (is_win9x)
win_skip("SetupDuplicateDiskSpaceListA crashes with NULL disk space handle on Win9x\n");
......@@ -305,8 +305,6 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void)
BOOL ret;
HDSKSPC handle;
LONGLONG space;
int is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) &&
GetLastError() == ERROR_CALL_NOT_IMPLEMENTED;
if (is_win9x)
win_skip("SetupQuerySpaceRequiredOnDriveA crashes with NULL disk space handle on Win9x\n");
......@@ -476,6 +474,8 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void)
START_TEST(diskspace)
{
is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) &&
GetLastError() == ERROR_CALL_NOT_IMPLEMENTED;
test_SetupCreateDiskSpaceListA();
test_SetupCreateDiskSpaceListW();
test_SetupDuplicateDiskSpaceListA();
......
......@@ -103,36 +103,36 @@ static const struct
const char *data;
DWORD error;
UINT err_line;
int todo;
BOOL todo;
} invalid_files[] =
{
/* file contents expected error (or 0) errline todo */
{ "\r\n", ERROR_WRONG_INF_STYLE, 0, 0 },
{ "abcd\r\n", ERROR_WRONG_INF_STYLE, 0, 1 },
{ "[Version]\r\n", ERROR_WRONG_INF_STYLE, 0, 0 },
{ "[Version]\nSignature=", ERROR_WRONG_INF_STYLE, 0, 0 },
{ "[Version]\nSignature=foo", ERROR_WRONG_INF_STYLE, 0, 0 },
{ "[version]\nsignature=$chicago$", 0, 0, 0 },
{ "[VERSION]\nSIGNATURE=$CHICAGO$", 0, 0, 0 },
{ "[Version]\nSignature=$chicago$,abcd", 0, 0, 0 },
{ "[Version]\nabc=def\nSignature=$chicago$", 0, 0, 0 },
{ "[Version]\nabc=def\n[Version]\nSignature=$chicago$", 0, 0, 0 },
{ STD_HEADER, 0, 0, 0 },
{ STD_HEADER "[]\r\n", 0, 0, 0 },
{ STD_HEADER "]\r\n", 0, 0, 0 },
{ STD_HEADER "[" A255 "]\r\n", 0, 0, 0 },
{ STD_HEADER "[ab\r\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 },
{ STD_HEADER "\n\n[ab\x1a]\n", ERROR_BAD_SECTION_NAME_LINE, 5, 0 },
{ STD_HEADER "[" A256 "]\r\n", ERROR_SECTION_NAME_TOO_LONG, 3, 0 },
{ "[abc]\n" STD_HEADER, 0, 0, 0 },
{ "abc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 1, 0 },
{ ";\n;\nabc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, 0 },
{ ";\n;\nab\nab\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, 0 },
{ ";aa\n;bb\n" STD_HEADER, 0, 0, 0 },
{ STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 },
{ STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 },
{ STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 },
{ STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 },
{ "\r\n", ERROR_WRONG_INF_STYLE, 0, FALSE },
{ "abcd\r\n", ERROR_WRONG_INF_STYLE, 0, TRUE },
{ "[Version]\r\n", ERROR_WRONG_INF_STYLE, 0, FALSE },
{ "[Version]\nSignature=", ERROR_WRONG_INF_STYLE, 0, FALSE },
{ "[Version]\nSignature=foo", ERROR_WRONG_INF_STYLE, 0, FALSE },
{ "[version]\nsignature=$chicago$", 0, 0, FALSE },
{ "[VERSION]\nSIGNATURE=$CHICAGO$", 0, 0, FALSE },
{ "[Version]\nSignature=$chicago$,abcd", 0, 0, FALSE },
{ "[Version]\nabc=def\nSignature=$chicago$", 0, 0, FALSE },
{ "[Version]\nabc=def\n[Version]\nSignature=$chicago$", 0, 0, FALSE },
{ STD_HEADER, 0, 0, FALSE },
{ STD_HEADER "[]\r\n", 0, 0, FALSE },
{ STD_HEADER "]\r\n", 0, 0, FALSE },
{ STD_HEADER "[" A255 "]\r\n", 0, 0, FALSE },
{ STD_HEADER "[ab\r\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE },
{ STD_HEADER "\n\n[ab\x1a]\n", ERROR_BAD_SECTION_NAME_LINE, 5, FALSE },
{ STD_HEADER "[" A256 "]\r\n", ERROR_SECTION_NAME_TOO_LONG, 3, FALSE },
{ "[abc]\n" STD_HEADER, 0, 0, FALSE },
{ "abc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 1, FALSE },
{ ";\n;\nabc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, FALSE },
{ ";\n;\nab\nab\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, FALSE },
{ ";aa\n;bb\n" STD_HEADER, 0, 0, FALSE },
{ STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE },
{ STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE },
{ STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE },
{ STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE },
};
static void test_invalid_files(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment