[ros-dev] [ros-diffs] [hbelusca] 62419: [APITESTS:kernel32] Be more specific about which last error we expect.
Hermès BÉLUSCA - MAÏTO
hermes.belusca at sfr.fr
Wed Mar 5 12:50:13 UTC 2014
Ahah !!
In fact I modified the code according to what was done elsewhere, which was:
ok(GetLastError() == (Error), "Wrong last error, Expected %lu, got %lu\n",
(DWORD)(Error), GetLastError());
Cheers,
H.
-----Message d'origine-----
De : ros-dev-bounces at reactos.org [mailto:ros-dev-bounces at reactos.org] De la
part de Timo Kreuzer
Envoyé : mercredi 5 mars 2014 11:32
À : ros-dev at reactos.org
Objet : Re: [ros-dev] [ros-diffs] [hbelusca] 62419: [APITESTS:kernel32] Be
more specific about which last error we expect.
IIRC, we have something like ok_lasterror()
Am 05.03.2014 02:53, schrieb hbelusca at svn.reactos.org:
> Author: hbelusca
> Date: Wed Mar 5 01:53:46 2014
> New Revision: 62419
>
> URL: http://svn.reactos.org/svn/reactos?rev=62419&view=rev
> Log:
> [APITESTS:kernel32]
> Be more specific about which last error we expect.
>
> Modified:
> trunk/rostests/apitests/kernel32/dosdev.c
>
> Modified: trunk/rostests/apitests/kernel32/dosdev.c
> URL:
> http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/kernel32/do
> sdev.c?rev=62419&r1=62418&r2=62419&view=diff
>
============================================================================
==
> --- trunk/rostests/apitests/kernel32/dosdev.c [iso-8859-1] (original)
> +++ trunk/rostests/apitests/kernel32/dosdev.c [iso-8859-1] Wed Mar 5
01:53:46 2014
> @@ -137,7 +137,7 @@
> ok(Result, "Failed to subst drive\n");
> DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR);
> ok(DriveType1 != SystemDriveType, "subst drive types match when it
shouldn't\n");
> - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports
unexpected error code\n");
> + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error.
> + Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND),
> + GetLastError());
> dwMaskCur = GetLogicalDrives();
> ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n");
> ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is
> not set\n"); @@ -168,7 +168,7 @@
> ok(Result, "Failed to subst drive\n");
> DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR);
> ok(DriveType1 != SystemDriveType, "subst drive types match when it
shouldn't\n");
> - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports
unexpected error code\n");
> + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error.
> + Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND),
> + GetLastError());
> dwMaskCur = GetLogicalDrives();
> ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n");
> ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is
> not set\n"); @@ -203,7 +203,7 @@
> ok(Result, "Failed to subst drive\n");
> DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR);
> ok(DriveType1 != SystemDriveType, "subst drive types match when it
shouldn't\n");
> - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports
unexpected error code\n");
> + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error.
> + Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND),
> + GetLastError());
> dwMaskCur = GetLogicalDrives();
> ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n");
> ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is
> not set\n"); @@ -266,7 +266,7 @@
> ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not
set\n");
> hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data);
> ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should
fail\n");
> - ok(GetLastError() == ERROR_INVALID_NAME, "GetLastError() reports
unexpected error code\n");
> + ok(GetLastError() == ERROR_INVALID_NAME, "Wrong last error.
> + Expected %lu, got %lu\n", (DWORD)(ERROR_INVALID_NAME),
> + GetLastError());
> if (hnd) FindClose(hnd);
> Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION, SUBST_DRIVE, NULL);
> ok(Result, "Failed to remove subst drive using NULL Target
> name\n"); @@ -313,7 +313,7 @@
> ok(Result, "Failed to subst drive\n");
> DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR);
> ok(DriveType1 != SystemDriveType, "subst drive types match when it
shouldn't\n");
> - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports
unexpected error code\n");
> + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error.
> + Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND),
> + GetLastError());
> dwMaskCur = GetLogicalDrives();
> ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n");
> ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is
> not set\n"); @@ -333,7 +333,7 @@
> ok(Result, "Failed to subst drive\n");
> DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR);
> ok(DriveType1 != SystemDriveType, "subst drive types match when it
shouldn't\n");
> - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports
unexpected error code\n");
> + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error.
> + Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND),
> + GetLastError());
> dwMaskCur = GetLogicalDrives();
> ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n");
> ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is
> not set\n"); @@ -362,7 +362,7 @@
> ok(Result, "Failed to subst drive\n");
> Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, 0);
> ok(!Result, "Should fail as the buffer passed is supposed to be
small\n");
> - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError()
reports unexpected error code\n");
> + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Wrong last
> + error. Expected %lu, got %lu\n", (DWORD)(ERROR_INSUFFICIENT_BUFFER),
> + GetLastError());
> Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH);
> ok(Result, "failed to get target path\n");
> ok(_strnicmp(Buffer, "\\??\\", 4) == 0, "The target returned does
> have correct prefix set\n"); @@ -374,7 +374,7 @@
> /* This will try to retrieve all existing MS-DOS device names */
> Result = QueryDosDeviceA(NULL, Buffer, 0);
> ok(!Result, "Should fail as the buffer passed is supposed to be
small\n");
> - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError()
reports unexpected error code\n");
> + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Wrong last
> + error. Expected %lu, got %lu\n", (DWORD)(ERROR_INSUFFICIENT_BUFFER),
> + GetLastError());
> }
>
> START_TEST(dosdev)
>
>
>
_______________________________________________
Ros-dev mailing list
Ros-dev at reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
More information about the Ros-dev
mailing list