]> wimlib.net Git - wimlib/commitdiff
win32_capture_try_rpfix(): Fix incorrect conditional
authorEric Biggers <ebiggers3@gmail.com>
Mon, 29 Apr 2013 21:02:17 +0000 (16:02 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 29 Apr 2013 21:11:54 +0000 (16:11 -0500)
tests/win32-test-imagex-capture_and_apply.bat:
Fix test that should have caught this bug.

src/win32.c
tests/win32-test-imagex-capture_and_apply.bat

index 0fd7508a66b406d62981a1268176331872505113..9a64c05ef9fec6717fa6c3b13feb62b2d06fa424 100644 (file)
@@ -739,7 +739,7 @@ win32_capture_try_rpfix(u8 *rpbuf, u16 *rpbuflen_p,
                else
                        ret = -ret;
        } else {
-               if (ret == RP_EXCLUDED) {
+               if (rp_status == RP_EXCLUDED) {
                        size_t print_name_nchars = rpdata.print_name_nbytes / 2;
                        wchar_t print_name0[print_name_nchars + 1];
                        print_name0[print_name_nchars] = L'\0';
index 89dd07501b2c0990b8fd240008f240b72cadf8f3..01e3f32099894b8a8ddeb90774cceecf6b37ef7a 100644 (file)
@@ -6,10 +6,12 @@ REM
 REM Run some tests on the Windows version of wimlib-imagex.\r
 REM\r
 REM This must be run on Windows Vista or later in a clean directory, with\r
-REM Administrator privileges.  wimlib-imagex and win32-tree-cmp must be callable\r
-REM (on PATH or in same directory).\r
+REM Administrator privileges.  wimlib-imagex and win32-tree-cmp must be\r
+REM executable using the paths set below.\r
 \r
 setlocal EnableDelayedExpansion\r
+set WIN32_TREE_CMP=win32-tree-cmp\r
+set WIMLIB_IMAGEX=wimlib-imagex\r
 \r
 if exist in.dir rd /S /Q in.dir\r
 if exist out.dir rd /S /Q out.dir\r
@@ -316,9 +318,9 @@ md subdir
 echo 1 > subdir\file\r
 mklink /j junction subdir > nul\r
 cd ..\r
-wimlib-imagex capture in.dir test.wim > nul\r
+%WIMLIB_IMAGEX% capture in.dir test.wim > nul\r
 rd /s /q in.dir\r
-wimlib-imagex apply test.wim out.dir > nul\r
+%WIMLIB_IMAGEX% apply test.wim out.dir > nul\r
 echo 1 > tmp1\r
 type out.dir\junction\file > tmp2\r
 fc tmp1 tmp2 > nul\r
@@ -331,8 +333,8 @@ cd in.dir
 echo Testing rpfix exclude\r
 mklink otherlink c:\some\other\directory > nul\r
 cd ..\r
-wimlib-imagex capture in.dir test.wim > nul\r
-wimlib-imagex apply test.wim out.dir > nul\r
+%WIMLIB_IMAGEX% capture in.dir test.wim > nul\r
+%WIMLIB_IMAGEX% apply test.wim out.dir > nul\r
 rd out.dir\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
 rd /s /q in.dir\r
@@ -342,8 +344,14 @@ cd in.dir
 echo Testing rpfix relative\r
 echo 1 > file\r
 mklink relink file > nul\r
-call :do_test\r
+cd ..\r
+%WIMLIB_IMAGEX% capture in.dir test.wim > nul\r
+%WIMLIB_IMAGEX% apply test.wim out.dir > nul\r
+fc in.dir\file out.dir\relink > nul\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
+rd /s /q in.dir out.dir\r
+md in.dir\r
+cd in.dir\r
 \r
 REM\r
 REM END OF TESTS\r
@@ -356,11 +364,11 @@ exit /b 0
 \r
 :do_test\r
 cd ..\r
-wimlib-imagex capture in.dir test.wim --norpfix > NUL\r
+%WIMLIB_IMAGEX% capture in.dir test.wim --norpfix > NUL\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
-wimlib-imagex apply test.wim out.dir > NUL\r
+%WIMLIB_IMAGEX% apply test.wim out.dir > NUL\r
 if %errorlevel% neq 0 exit /b %errorlevel%\r
-win32-tree-cmp in.dir out.dir\r
+%WIN32_TREE_CMP% in.dir out.dir\r
 if %errorlevel% neq 0 (\r
        echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
        echo            TEST FAILED!!!!!!!\r
@@ -377,7 +385,7 @@ REM imagex /capture in.dir test.wim "test" /norpfix > nul
 REM if %errorlevel% neq 0 exit /b %errorlevel%\r
 REM imagex /apply test.wim 1 out.dir > nul\r
 REM if %errorlevel% neq 0 exit /b %errorlevel%\r
-REM win32-tree-cmp in.dir out.dir\r
+REM %WIN32_TREE_CMP% in.dir out.dir\r
 REM if %errorlevel% neq 0 (\r
        REM echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
        REM echo            TEST FAILED!!!!!!! ^(imagex^)\r