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

Unified Diff: runtime/vm/snapshot_test.cc

Issue 11418107: Resolve C++11 narrowing conversion errors when compiling with GCC 4.7. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot_test.cc
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 74ca91c7208425d17afc0b7c78ff7370b0fa0fb4..07326ae8c1507b46c99daca2f1b179eb896ca500 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -528,13 +528,13 @@ static void TestString(const char* cstr) {
TEST_CASE(SerializeString) {
TestString("This string shall be serialized");
TestString("æøå"); // This file is UTF-8 encoded.
- char data[] = {0x01,
- 0x7f,
- 0xc2, 0x80, // 0x80
- 0xdf, 0xbf, // 0x7ff
- 0xe0, 0xa0, 0x80, // 0x800
- 0xef, 0xbf, 0xbf, // 0xffff
- 0x00}; // String termination.
+ const char* data = "\x01"
+ "\x7F"
+ "\xC2\x80" // U+0080
+ "\xDF\xBF" // U+07FF
+ "\xE0\xA0\x80" // U+0800
+ "\xEF\xBF\xBF"; // U+FFFF
+
TestString(data);
// TODO(sgjesse): Add tests with non-BMP characters.
}
@@ -2107,7 +2107,7 @@ UNIT_TEST_CASE(PostCObject) {
EXPECT(Dart_PostCObject(send_port_id, &object));
// Try to post an invalid UTF-8 sequence (lead surrogate).
- char data[] = {0xed, 0xa0, 0x80, 0}; // 0xd800
+ const char* data = "\xED\xA0\x80"; // U+D800
object.type = Dart_CObject::kString;
object.value.as_string = const_cast<char*>(data);
EXPECT(!Dart_PostCObject(send_port_id, &object));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698