aboutsummaryrefslogtreecommitdiff
path: root/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp b/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp
index 8ea045f5..80fe2f1a 100644
--- a/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp
+++ b/src/libs/dutil/test/DUtilUnitTest/FileUtilTest.cpp
@@ -11,43 +11,43 @@ namespace DutilTests
11 public ref class FileUtil 11 public ref class FileUtil
12 { 12 {
13 public: 13 public:
14 [Fact(Skip="Skipped until we have a good way to reference ANSI.txt.")] 14 // [Fact(Skip="Skipped until we have a good way to reference ANSI.txt.")]
15 void FileUtilTest() 15 // void FileUtilTest()
16 { 16 // {
17 HRESULT hr = S_OK; 17 // HRESULT hr = S_OK;
18 LPWSTR sczTempDir = NULL; 18 // LPWSTR sczTempDir = NULL;
19 LPWSTR sczFileDir = NULL; 19 // LPWSTR sczFileDir = NULL;
20 20
21 DutilInitialize(&DutilTestTraceError); 21 // DutilInitialize(&DutilTestTraceError);
22 22
23 try 23 // try
24 { 24 // {
25 hr = PathExpand(&sczTempDir, L"%TEMP%\\FileUtilTest\\", PATH_EXPAND_ENVIRONMENT); 25 // hr = PathExpand(&sczTempDir, L"%TEMP%\\FileUtilTest\\", PATH_EXPAND_ENVIRONMENT);
26 NativeAssert::Succeeded(hr, "Failed to get temp dir"); 26 // NativeAssert::Succeeded(hr, "Failed to get temp dir");
27 27
28 hr = PathExpand(&sczFileDir, L"%WIX_ROOT%\\examples\\data\\TextEncodings\\", PATH_EXPAND_ENVIRONMENT); 28 // hr = PathExpand(&sczFileDir, L"%WIX_ROOT%\\examples\\data\\TextEncodings\\", PATH_EXPAND_ENVIRONMENT);
29 NativeAssert::Succeeded(hr, "Failed to get path to encodings file dir"); 29 // NativeAssert::Succeeded(hr, "Failed to get path to encodings file dir");
30 30
31 hr = DirEnsureExists(sczTempDir, NULL); 31 // hr = DirEnsureExists(sczTempDir, NULL);
32 NativeAssert::Succeeded(hr, "Failed to ensure directory exists: {0}", sczTempDir); 32 // NativeAssert::Succeeded(hr, "Failed to ensure directory exists: {0}", sczTempDir);
33 33
34 TestFile(sczFileDir, sczTempDir, L"ANSI.txt", 32, FILE_ENCODING_UTF8); 34 // TestFile(sczFileDir, sczTempDir, L"ANSI.txt", 32, FILE_ENCODING_UTF8);
35 // Big endian not supported today! 35 // // Big endian not supported today!
36 //TestFile(sczFileDir, L"UnicodeBENoBOM.txt", 34); 36 // //TestFile(sczFileDir, L"UnicodeBENoBOM.txt", 34);
37 //TestFile(sczFileDir, L"UnicodeBEWithBOM.txt", 34); 37 // //TestFile(sczFileDir, L"UnicodeBEWithBOM.txt", 34);
38 TestFile(sczFileDir, sczTempDir, L"UnicodeLENoBOM.txt", 34, FILE_ENCODING_UTF16); 38 // TestFile(sczFileDir, sczTempDir, L"UnicodeLENoBOM.txt", 34, FILE_ENCODING_UTF16);
39 TestFile(sczFileDir, sczTempDir, L"UnicodeLEWithBOM.txt", 34, FILE_ENCODING_UTF16_WITH_BOM); 39 // TestFile(sczFileDir, sczTempDir, L"UnicodeLEWithBOM.txt", 34, FILE_ENCODING_UTF16_WITH_BOM);
40 TestFile(sczFileDir, sczTempDir, L"UTF8WithSignature.txt", 34, FILE_ENCODING_UTF8_WITH_BOM); 40 // TestFile(sczFileDir, sczTempDir, L"UTF8WithSignature.txt", 34, FILE_ENCODING_UTF8_WITH_BOM);
41 41
42 hr = DirEnsureDelete(sczTempDir, TRUE, TRUE); 42 // hr = DirEnsureDelete(sczTempDir, TRUE, TRUE);
43 } 43 // }
44 finally 44 // finally
45 { 45 // {
46 ReleaseStr(sczTempDir); 46 // ReleaseStr(sczTempDir);
47 ReleaseStr(sczFileDir); 47 // ReleaseStr(sczFileDir);
48 DutilUninitialize(); 48 // DutilUninitialize();
49 } 49 // }
50 } 50 // }
51 51
52 private: 52 private:
53 void TestFile(LPWSTR wzDir, LPCWSTR wzTempDir, LPWSTR wzFileName, size_t cbExpectedStringLength, FILE_ENCODING feExpectedEncoding) 53 void TestFile(LPWSTR wzDir, LPCWSTR wzTempDir, LPWSTR wzFileName, size_t cbExpectedStringLength, FILE_ENCODING feExpectedEncoding)