REM BEGIN TESTS\r
REM\r
\r
+REM goto :rpfix_tests\r
+\r
call :msg "empty directory"\r
call :do_test\r
if %errorlevel% neq 0 exit /b %errorlevel%\r
call :do_test\r
if %errorlevel% neq 0 exit /b %errorlevel%\r
\r
-REM call :msg "encrypted directory with unencrypted file in it"\r
-REM md subdir\r
-REM echo 1 > subdir\1\r
-REM cipher /e subdir > nul\r
-REM cipher /d subdir\1 > nul\r
-REM call :do_test\r
-REM if %errorlevel% neq 0 exit /b %errorlevel%\r
+call :msg "encrypted directory with unencrypted file in it"\r
+md subdir\r
+echo 1 > subdir\1\r
+cipher /e subdir > nul\r
+cipher /d subdir\1 > nul\r
+call :do_test\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
\r
call :msg "hardlinked, encrypted file with alternate data streams"\r
echo hello > file\r
call :do_test\r
if %errorlevel% neq 0 exit /b %errorlevel%\r
\r
+:rpfix_tests\r
+\r
+echo Testing rpfix junction\r
+md subdir\r
+echo 1 > subdir\file\r
+mklink /j junction subdir > nul\r
+cd ..\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
+echo 1 > tmp1\r
+type out.dir\junction\file > tmp2\r
+fc tmp1 tmp2 > nul\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+rd /s /q out.dir\r
+del tmp1 tmp2\r
+md in.dir\r
+cd in.dir\r
+\r
+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
+rd out.dir\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+rd /s /q in.dir\r
+md in.dir\r
+cd in.dir\r
+\r
+echo Testing rpfix relative\r
+echo 1 > file\r
+mklink relink file > nul\r
+call :do_test\r
+if %errorlevel% neq 0 exit /b %errorlevel%\r
+\r
REM\r
REM END OF TESTS\r
REM\r
\r
+cd ..\r
+del test.wim\r
+rd /s /q in.dir\r
exit /b 0\r
\r
:do_test\r