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

Side by Side Diff: runtime/vm/unicode_test.cc

Issue 2974233002: VM: Re-format to use at most one newline between functions (Closed)
Patch Set: Rebase and merge 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/unicode.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/unicode.h"
5 #include "vm/globals.h" 6 #include "vm/globals.h"
6 #include "vm/unicode.h"
7 #include "vm/unit_test.h" 7 #include "vm/unit_test.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 TEST_CASE(Utf8Decode) { 11 TEST_CASE(Utf8Decode) {
12 // Examples from the Unicode specification, chapter 3 12 // Examples from the Unicode specification, chapter 3
13 { 13 {
14 const char* src = "\x41\xC3\xB1\x42"; 14 const char* src = "\x41\xC3\xB1\x42";
15 int32_t expected[] = {0x41, 0xF1, 0x42}; 15 int32_t expected[] = {0x41, 0xF1, 0x42};
16 int32_t dst[ARRAY_SIZE(expected)]; 16 int32_t dst[ARRAY_SIZE(expected)];
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 int32_t expected[] = {0xFFFF}; 1031 int32_t expected[] = {0xFFFF};
1032 int32_t dst[ARRAY_SIZE(expected)]; 1032 int32_t dst[ARRAY_SIZE(expected)];
1033 memset(dst, 0, sizeof(dst)); 1033 memset(dst, 0, sizeof(dst));
1034 bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst)); 1034 bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
1035 EXPECT(is_valid); 1035 EXPECT(is_valid);
1036 EXPECT(!memcmp(expected, dst, sizeof(expected))); 1036 EXPECT(!memcmp(expected, dst, sizeof(expected)));
1037 } 1037 }
1038 } 1038 }
1039 1039
1040 } // namespace dart 1040 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/unicode.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698