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

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

Issue 134893003: Add internal operation that converts a growable list to a fixed list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make top-level patch file native. Add comment. Created 6 years, 10 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
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_debugger_api.h" 7 #include "include/dart_debugger_api.h"
8 #include "include/dart_mirrors_api.h" 8 #include "include/dart_mirrors_api.h"
9 #include "include/dart_native_api.h" 9 #include "include/dart_native_api.h"
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 6004 matching lines...) Expand 10 before | Expand all | Expand 10 after
6015 EXPECT(Dart_IsInteger(result)); 6015 EXPECT(Dart_IsInteger(result));
6016 value = 0; 6016 value = 0;
6017 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); 6017 EXPECT_VALID(Dart_IntegerToInt64(result, &value));
6018 EXPECT_EQ(123456, value); 6018 EXPECT_EQ(123456, value);
6019 6019
6020 // A NULL resolver is okay, but resolution will fail. 6020 // A NULL resolver is okay, but resolution will fail.
6021 result = Dart_SetNativeResolver(lib, NULL); 6021 result = Dart_SetNativeResolver(lib, NULL);
6022 EXPECT_VALID(result); 6022 EXPECT_VALID(result);
6023 6023
6024 EXPECT_ERROR(Dart_Invoke(type, NewString("baz"), 0, NULL), 6024 EXPECT_ERROR(Dart_Invoke(type, NewString("baz"), 0, NULL),
6025 "native function 'SomeNativeFunction3' cannot be found"); 6025 "native function 'SomeNativeFunction3' (0 arguments) "
6026 "cannot be found");
6026 } 6027 }
6027 6028
6028 6029
6029 // Test that an imported name does not clash with the same name defined 6030 // Test that an imported name does not clash with the same name defined
6030 // in the importing library. 6031 // in the importing library.
6031 TEST_CASE(ImportLibrary2) { 6032 TEST_CASE(ImportLibrary2) {
6032 const char* kScriptChars = 6033 const char* kScriptChars =
6033 "import 'library1_dart';\n" 6034 "import 'library1_dart';\n"
6034 "var foo;\n" 6035 "var foo;\n"
6035 "main() { foo = 0; }\n"; 6036 "main() { foo = 0; }\n";
(...skipping 1794 matching lines...) Expand 10 before | Expand all | Expand 10 after
7830 NewString("main"), 7831 NewString("main"),
7831 1, 7832 1,
7832 dart_args); 7833 dart_args);
7833 int64_t value = 0; 7834 int64_t value = 0;
7834 result = Dart_IntegerToInt64(result, &value); 7835 result = Dart_IntegerToInt64(result, &value);
7835 EXPECT_VALID(result); 7836 EXPECT_VALID(result);
7836 EXPECT_EQ(6, value); 7837 EXPECT_EQ(6, value);
7837 } 7838 }
7838 7839
7839 } // namespace dart 7840 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.cc ('k') | runtime/vm/parser.cc » ('j') | runtime/vm/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698