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

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

Issue 22876025: The peer pointer was not being setup at all, fixed that and added a test case (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "bin/builtin.h" 5 #include "bin/builtin.h"
6 #include "include/dart_api.h" 6 #include "include/dart_api.h"
7 #include "include/dart_mirrors_api.h" 7 #include "include/dart_mirrors_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/json.h" 10 #include "platform/json.h"
(...skipping 6952 matching lines...) Expand 10 before | Expand all | Expand 10 after
6963 str = Dart_MakeExternalString(canonical_str, 6963 str = Dart_MakeExternalString(canonical_str,
6964 ext_canonical_str, 6964 ext_canonical_str,
6965 kLength, 6965 kLength,
6966 &canonical_str_peer, 6966 &canonical_str_peer,
6967 MakeExternalCback); 6967 MakeExternalCback);
6968 EXPECT(Dart_IsString(str)); 6968 EXPECT(Dart_IsString(str));
6969 EXPECT(!Dart_IsExternalString(canonical_str)); 6969 EXPECT(!Dart_IsExternalString(canonical_str));
6970 EXPECT_EQ(canonical_str, str); 6970 EXPECT_EQ(canonical_str, str);
6971 EXPECT(Dart_IsString(canonical_str)); 6971 EXPECT(Dart_IsString(canonical_str));
6972 EXPECT(!Dart_IsExternalString(canonical_str)); 6972 EXPECT(!Dart_IsExternalString(canonical_str));
6973 void* peer;
6974 EXPECT_VALID(Dart_StringGetProperties(str, &size, &length, &peer));
6975 EXPECT_EQ(1, size);
6976 EXPECT_EQ(1, length);
6977 EXPECT_EQ(reinterpret_cast<void*>(&canonical_str_peer), peer);
6973 6978
6974 // Test with a one byte ascii string. 6979 // Test with a one byte ascii string.
6975 const char* ascii = "string"; 6980 const char* ascii = "string";
6976 expected_length = strlen(ascii); 6981 expected_length = strlen(ascii);
6977 Dart_Handle ascii_str = NewString(ascii); 6982 Dart_Handle ascii_str = NewString(ascii);
6978 EXPECT_VALID(ascii_str); 6983 EXPECT_VALID(ascii_str);
6979 EXPECT(Dart_IsString(ascii_str)); 6984 EXPECT(Dart_IsString(ascii_str));
6980 EXPECT(Dart_IsStringLatin1(ascii_str)); 6985 EXPECT(Dart_IsStringLatin1(ascii_str));
6981 EXPECT(!Dart_IsExternalString(ascii_str)); 6986 EXPECT(!Dart_IsExternalString(ascii_str));
6982 EXPECT_VALID(Dart_StringLength(ascii_str, &length)); 6987 EXPECT_VALID(Dart_StringLength(ascii_str, &length));
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
7281 NewString("main"), 7286 NewString("main"),
7282 0, 7287 0,
7283 NULL); 7288 NULL);
7284 int64_t value = 0; 7289 int64_t value = 0;
7285 result = Dart_IntegerToInt64(result, &value); 7290 result = Dart_IntegerToInt64(result, &value);
7286 EXPECT_VALID(result); 7291 EXPECT_VALID(result);
7287 EXPECT_EQ(8, value); 7292 EXPECT_EQ(8, value);
7288 } 7293 }
7289 7294
7290 } // namespace dart 7295 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698