\r
call :msg "empty directory"\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "single file"\r
echo 1 > file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "different files"\r
echo 1 > file\r
echo 2 > anotherfile\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "identical files"\r
echo 1 > file\r
echo 1 > identicalfile\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hard linked file"\r
echo 1 > file\r
mklink /h link file > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hard linked file, with other identical files"\r
echo 1 > file\r
mklink /h link file > nul\r
echo 1 > identicalfile\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "empty file"\r
type nul > emptyfile\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hard linked empty file"\r
type nul > file\r
mklink /h link file > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "various hard linked, identical, different, and empty files"\r
echo 1 > file\r
echo 1 > 1file\r
mklink /h 1filelink 1file > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "multiple subdirectories, some empty, some not"\r
md subdir1\r
md subdir2\subdir2subdir\r
type nul > subdir2\emptyfile\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "file with custom security descriptor"\r
echo hello > file\r
icacls file /deny Administrator:F > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "directory with custom security descriptor (inheritence enabled)"\r
md subdir\r
icacls subdir /inheritance:e > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "directory with custom security descriptor (inheritence disabled)"\r
md subdir\r
icacls subdir /inheritance:d > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
REM win32-tree-cmp can't handle this case.\r
REM\r
REM echo hello > file\r
REM icacls file /inheritance:r > nul\r
REM call :do_test\r
-REM if %errorlevel% neq 0 goto :fail\r
\r
call :msg "file with custom integrity level"\r
echo hello > file\r
icacls file /setintegritylevel H > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "relative symlink"\r
mklink relink dest > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "absolute symlink, with drive letter"\r
mklink abslink C:\absolute\target > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "absolute symlink, without drive letter"\r
mklink abslink \absolute\target > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "relative symlink, with file target"\r
echo 1 > 1\r
mklink relink 1 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "relative symlink, with directory target"\r
md subdir\r
mklink reldlink subdir > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "junction"\r
md subdir\r
mklink /j junction subdir > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "symlinks, junctions, files, subdirectories, etc."\r
echo 1 > 1\r
md subdir2\s\s\s\r
echo "hello world!!!!" > subdir2\otherfile\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "reparse point that is neither a symlink nor a junction"\r
type nul > file\r
%SET_REPARSE_POINT% file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "reparse point with named data streams"\r
type nul > file\r
echo 1 > file:aa\r
%SET_REPARSE_POINT% file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "reparse point with unnamed data stream"\r
echo "test" > file\r
%SET_REPARSE_POINT% file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "reparse point with unnamed data stream and named data streams"\r
echo "test" > file\r
echo 1 > file:aa\r
%SET_REPARSE_POINT% file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
+\r
+call :msg "empty reparse point"\r
+type nul > file\r
+%SET_REPARSE_POINT% file 0\r
+call :do_test\r
+\r
+call :msg "empty reparse point with unnamed data stream"\r
+echo hello > file\r
+%SET_REPARSE_POINT% file 0\r
+call :do_test\r
+\r
+call :msg "empty reparse point with unnamed data stream and named data streams"\r
+echo hello > file\r
+echo hello > file:ads1\r
+type nul > file:ads2\r
+%SET_REPARSE_POINT% file 0\r
+call :do_test\r
+\r
+call :msg "maximum length reparse point"\r
+type nul > file\r
+%SET_REPARSE_POINT% file 16376\r
+call :do_test\r
\r
call :msg "directory reparse point that is neither a symlink nor a junction"\r
md subdir\r
%SET_REPARSE_POINT% subdir\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "directory reparse point with named data streams"\r
md subdir\r
echo 1 > subdir:aa\r
%SET_REPARSE_POINT% subdir\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "compressed file"\r
echo "test" > test\r
compact /C test > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "compressed directory"\r
md subdir\r
compact /C subdir > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "compressed directory with files in it"\r
md subdir\r
mklink /h subdir\hardlink subdir\file1 > nul\r
mklink /j subdir\j subdir\subsubdir > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "compressed directory with some uncompressed files in it"\r
md subdir\r
echo 5 > subdir\5\r
compact /U subdir\1 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "file with alternate data stream"\r
echo 1 > file\r
echo 5 > file:ads\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "file with multiple alternate data streams"\r
echo 1 > file\r
echo aaa > file:aaa\r
echo aaaa > file:aaaa\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "file with multiple alternate data streams, with hard link"\r
echo 1 > file\r
echo aaaa > file:aaaa\r
mklink /h link file > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "files with multiple alternate data streams, some identical, with hard link"\r
echo 1 > file\r
mklink /h link file > nul\r
echo aaa > file2:aaa\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "file with empty alternate data stream"\r
echo 1 > file\r
type nul > file:ads\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "directory with empty alternate data stream"\r
md subdir\r
type nul > subdir:ads\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "root directory with alternate data stream"\r
echo 1 > ..\in.dir:ads\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "root directory with empty alternate data stream"\r
type nul > ..\in.dir:ads\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "subdirectory with alternate data streams"\r
md subdir\r
echo 2 > subdir:2\r
echo 2 > subdir:2again\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "subdirectories and files with alternate data streams"\r
md subdir\r
echo 1 > 1\r
type nul > helloagain:dummy\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "symbolic link and hard link, to file with alternate data streams"\r
echo 1 > 1\r
mklink symlink 1 > nul\r
mklink /h hardlink 1 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "compressed file with alternate data streams"\r
echo 1 > 1\r
echo 2 > .\1:2\r
compact /C 1 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hidden file"\r
echo 1 > hidden\r
attrib +h hidden\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hidden system file"\r
echo 1 > file\r
attrib +h +s file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hidden, readonly, system file"\r
echo 1 > file\r
attrib +h +r +s file\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hidden directory"\r
md subdir\r
attrib +h subdir\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hidden system directory"\r
md subdir\r
attrib +h +s subdir\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hidden, readonly, system directory"\r
md subdir\r
attrib +h +r +s subdir\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "readonly directory with named data stream"\r
md subdir\r
echo foo > subdir:ads\r
attrib +r subdir\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "encrypted file"\r
echo "hello" > encrypted\r
cipher /e encrypted > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "identical encrypted files"\r
echo "hello" > encrypted1\r
cipher /e encrypted1 > nul\r
cipher /e encrypted2 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "encrypted directory"\r
md subdir\r
cipher /e subdir > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "encrypted directory with encrypted file in it"\r
md subdir\r
cipher /e subdir > nul\r
cipher /e subdir\1 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "encrypted directory with unencrypted file in it"\r
md subdir\r
cipher /e subdir > nul\r
cipher /d subdir\1 > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "encrypted root directory"\r
cd ..\r
cd in.dir\r
echo "hello" > encrypted\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "unencrypted file in encrypted directory in compressed directory"\r
md 1\r
echo hello > 1\2\file\r
cipher /d 1\2\file > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "encrypted directory with alternate data streams"\r
md subdir\r
echo ads1 > subdir:ads1\r
echo ads2 > subdir:ads2\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
\r
call :msg "hardlinked, encrypted file with alternate data streams"\r
echo hello > file\r
cipher /e file > nul\r
mklink /h link file > nul\r
call :do_test\r
-if %errorlevel% neq 0 goto :fail\r
+\r
+REM Note: since object IDs must be unique per filesystem, we can't expect them\r
+REM to preserved using our testing scheme. Therefore, win32-tree-cmp doesn't\r
+REM compare them, and the below tests really just ensure the object ID code is\r
+REM run to some extent.\r
+\r
+call :msg "file with object ID"\r
+echo hello > file\r
+fsutil objectid create file > nul\r
+call :do_test\r
+\r
+call :msg "directory with object ID"\r
+md subdir\r
+fsutil objectid set f67394c12b17608e1d050d181ba8ffd2 7df80cbdf620f4c82c79b9e6799147b6 97621aff72915ade05abb96b15dea1a3 e0bda4caa9e33cfd461c92c16be9713d subdir\r
+call :do_test\r
\r
:rpfix_tests\r
\r
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
echo TEST FAILED!!!!!!!\r
echo @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\r
-exit /b %errorlevel%\r
+exit %errorlevel%\r