Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Unified Diff: runtime/vm/dart_api_impl_test.cc

Issue 2982753002: Fix bug in Dart API Dart_IntegerToUint64: crash on negative Mints (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl_test.cc
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 60ff7cc45175886143c6a720e6e805a8d7dab3f0..13142c8987a897c02f32452d27131a7f65216f87 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -868,6 +868,7 @@ TEST_CASE(IntegerValues) {
const int64_t kIntegerVal2 = 0xffffffff;
const char* kIntegerVal3 = "0x123456789123456789123456789";
const uint64_t kIntegerVal4 = 0xffffffffffffffff;
+ const int64_t kIntegerVal5 = -0x7fffffffffffffff;
Dart_Handle val1 = Dart_NewInteger(kIntegerVal1);
EXPECT(Dart_IsInteger(val1));
@@ -914,6 +915,12 @@ TEST_CASE(IntegerValues) {
uint64_t out5 = 0;
result = Dart_IntegerToUint64(val5, &out5);
EXPECT(Dart_IsError(result));
+
+ Dart_Handle val6 = Dart_NewInteger(kIntegerVal5);
+ EXPECT_VALID(val6);
+ uint64_t out6 = 0;
+ result = Dart_IntegerToUint64(val6, &out6);
+ EXPECT(Dart_IsError(result));
}
TEST_CASE(IntegerFitsIntoInt64) {
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698