Skip to content

Commit

Permalink
[1.10>1.11] [MERGE #5787 @Cellule] Merge changes from Windows 1809 Oc…
Browse files Browse the repository at this point in the history
…tober Update

Merge pull request #5787 from Cellule:1809_october
  • Loading branch information
Cellule committed Oct 22, 2018
2 parents 558f84b + f139911 commit aa0db70
Show file tree
Hide file tree
Showing 146 changed files with 2,443 additions and 885 deletions.
1 change: 1 addition & 0 deletions Build/Common.Build.Default.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<NtTargetVersion_Win8 >0x602</NtTargetVersion_Win8>
<NtTargetVersion_WinBlue>0x603</NtTargetVersion_WinBlue>
<NtTargetVersion_Win10>0xA00</NtTargetVersion_Win10>
<NtTargetVersion_Latest>$(NtTargetVersion_Win10)</NtTargetVersion_Latest>
</PropertyGroup>

<!-- Auto tool set selection -->
Expand Down
13 changes: 3 additions & 10 deletions bin/GCStress/StubExternalApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,9 @@ bool GetDeviceFamilyInfo(
void
ChakraBinaryAutoSystemInfoInit(AutoSystemInfo * autoSystemInfo)
{
ULONGLONG UAPInfo;
ULONG DeviceFamily;
ULONG DeviceForm;
if (GetDeviceFamilyInfo(&UAPInfo, &DeviceFamily, &DeviceForm))
{
bool isMobile = (DeviceFamily == 0x00000004 /*DEVICEFAMILYINFOENUM_MOBILE*/);
autoSystemInfo->shouldQCMoreFrequently = isMobile;
autoSystemInfo->supportsOnlyMultiThreadedCOM = isMobile; //TODO: pick some other platform to the list
autoSystemInfo->isLowMemoryDevice = isMobile; //TODO: pick some other platform to the list
}
autoSystemInfo->shouldQCMoreFrequently = false;
autoSystemInfo->supportsOnlyMultiThreadedCOM = false; //TODO: pick some other platform to the list
autoSystemInfo->isLowMemoryDevice = false; //TODO: pick some other platform to the list
}

enum MemProtectHeapCollectFlags {};
Expand Down
29 changes: 16 additions & 13 deletions bin/NativeTests/CodexTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ namespace CodexTest
//
TEST_CASE("CodexTest_EncodeTrueUtf8_SingleSurrogates", "[CodexTest]")
{
const charcount_t charCount = 1;
utf8char_t encodedBuffer[(charCount + 1) * 3]; // +1 since the buffer will be null-terminated
const size_t charCount = 1;
constexpr size_t cbEncodedBuffer = charCount * 3 + 1; // +1 since the buffer will be null-terminated
utf8char_t encodedBuffer[cbEncodedBuffer];

char16 testValues[] = { 0xD800, 0xDB7F, 0xDB80, 0xDBFF, 0xDC00, 0xDF80, 0xDFFF };
const int numTestCases = _countof(testValues);

for (int i = 0; i < numTestCases; i++)
{
size_t numEncodedBytes = utf8::EncodeTrueUtf8IntoAndNullTerminate(encodedBuffer, &testValues[i], charCount);
size_t numEncodedBytes = utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>(encodedBuffer, cbEncodedBuffer, &testValues[i], charCount);
CHECK(numEncodedBytes == 3);
CheckIsUnicodeReplacementChar(encodedBuffer);
}
Expand All @@ -62,11 +63,12 @@ namespace CodexTest
const int numTestCases = _countof(testCases);
const charcount_t charCount = _countof(testCases[0].surrogatePair);
const charcount_t maxEncodedByteCount = _countof(testCases[0].utf8Encoding);
utf8char_t encodedBuffer[maxEncodedByteCount + 1]; // +1 in case a null-terminating func is passed in
const size_t encodedBufferSize = maxEncodedByteCount + 1; // +1 in case a null-terminating func is passed in
utf8char_t encodedBuffer[encodedBufferSize];

for (int i = 0; i < numTestCases; i++)
{
size_t numEncodedBytes = func(encodedBuffer, testCases[i].surrogatePair, charCount);
size_t numEncodedBytes = func(encodedBuffer, encodedBufferSize, testCases[i].surrogatePair, charCount);
CHECK(numEncodedBytes <= maxEncodedByteCount);
for (size_t j = 0; j < numEncodedBytes; j++)
{
Expand Down Expand Up @@ -106,7 +108,7 @@ namespace CodexTest
{ { 0xDBFF, 0xDFFF }, { 0xED, 0xAF, 0xBF, 0xED, 0xBF, 0xBF } } // U+10FFFF
};

RunUtf8EncodingTestCase(testCases, static_cast<size_t (*)(utf8char_t*, const char16*, charcount_t)>(utf8::EncodeInto));
RunUtf8EncodingTestCase(testCases, static_cast<size_t (*)(utf8char_t*, size_t, const char16*, charcount_t)>(utf8::EncodeInto<utf8::Utf8EncodingKind::Cesu8>));
}

TEST_CASE("CodexTest_EncodeUtf8_PairedSurrogates", "[CodexTest]")
Expand All @@ -132,7 +134,7 @@ namespace CodexTest
{ { 0xDBFF, 0xDFFF }, { 0xF4, 0x8F, 0xBF, 0xBF } } // U+10FFFF
};

RunUtf8EncodingTestCase(testCases, utf8::EncodeTrueUtf8IntoAndNullTerminate);
RunUtf8EncodingTestCase(testCases, utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>);
}

TEST_CASE("CodexTest_EncodeUtf8_NonCharacters", "[CodexTest]")
Expand All @@ -151,7 +153,7 @@ namespace CodexTest
{ { 0xFFFF }, { 0xEF, 0xBF, 0xBF } } // U+FFFF
};

RunUtf8EncodingTestCase(testCases, utf8::EncodeTrueUtf8IntoAndNullTerminate);
RunUtf8EncodingTestCase(testCases, utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>);
}

TEST_CASE("CodexTest_EncodeUtf8_BoundaryChars", "[CodexTest]")
Expand Down Expand Up @@ -180,8 +182,8 @@ namespace CodexTest
{ { 0xDBFF, 0xDFFF }, { 0xF4, 0x8F, 0xBF, 0xBF } } // U+10FFFF
};

RunUtf8EncodingTestCase(testCases, utf8::EncodeTrueUtf8IntoAndNullTerminate);
RunUtf8EncodingTestCase(testCases2, utf8::EncodeTrueUtf8IntoAndNullTerminate);
RunUtf8EncodingTestCase(testCases, utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>);
RunUtf8EncodingTestCase(testCases2, utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>);
}

TEST_CASE("CodexTest_EncodeUtf8_SimpleCharacters", "[CodexTest]")
Expand All @@ -201,15 +203,16 @@ namespace CodexTest
{ { 0x20AC }, { 0xE2, 0x82, 0xAC } } // U+20AC - Euro symbol
};

RunUtf8EncodingTestCase(testCases, utf8::EncodeTrueUtf8IntoAndNullTerminate);
RunUtf8EncodingTestCase(testCases, utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>);
}

TEST_CASE("CodexTest_EncodeTrueUtf8_SimpleString", "[CodexTest]")
{
const charcount_t charCount = 3;
utf8char_t encodedBuffer[(charCount + 1) * 3]; // +1 since the buffer will be null terminated
constexpr size_t cbEncodedBuffer = charCount * 3 + 1; // +1 since the buffer will be null terminated
utf8char_t encodedBuffer[cbEncodedBuffer];
const char16* sourceBuffer = L"abc";
size_t numEncodedBytes = utf8::EncodeTrueUtf8IntoAndNullTerminate(encodedBuffer, sourceBuffer, charCount);
size_t numEncodedBytes = utf8::EncodeIntoAndNullTerminate<utf8::Utf8EncodingKind::TrueUtf8>(encodedBuffer, cbEncodedBuffer, sourceBuffer, charCount);
CHECK(numEncodedBytes == charCount);
for (int i = 0; i < charCount; i++)
{
Expand Down
3 changes: 2 additions & 1 deletion bin/rl/rl.vcxproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Condition="'$(ChakraBuildPathImported)'!='true'" Project="$(SolutionDir)Chakra.Build.Paths.props" />
<Import Project="$(BuildConfigPropsPath)Chakra.Build.ProjectConfiguration.props" />
Expand All @@ -9,6 +9,7 @@
<PropertyGroup Label="Configuration">
<TargetName>rl</TargetName>
<ConfigurationType>Application</ConfigurationType>
<UseUniCrt>false</UseUniCrt>
</PropertyGroup>
<Import Project="$(BuildConfigPropsPath)Chakra.Build.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
Expand Down
Loading

0 comments on commit aa0db70

Please sign in to comment.