OLD | NEW |
---|---|
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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
10 | 10 |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
964 /*9*/ "} \n" | 964 /*9*/ "} \n" |
965 /*10*/ " \n"; | 965 /*10*/ " \n"; |
966 | 966 |
967 LoadScript(kScriptChars); | 967 LoadScript(kScriptChars); |
968 | 968 |
969 const Library& test_lib = | 969 const Library& test_lib = |
970 Library::CheckedHandle(Api::UnwrapHandle(script_lib)); | 970 Library::CheckedHandle(Api::UnwrapHandle(script_lib)); |
971 const String& script_url = String::Handle(String::New(TestCase::url())); | 971 const String& script_url = String::Handle(String::New(TestCase::url())); |
972 Function& func = Function::Handle(); | 972 Function& func = Function::Handle(); |
973 | 973 |
974 // TODO(hausner): Looking up functions from source and line number | 974 for (int line = 7; line <= 9; line++) { |
975 // needs to be refined. We currently dont find "main" on line 7. | |
976 for (int line = 8; line <= 9; line++) { | |
977 func = test_lib.LookupFunctionInSource(script_url, line); | 975 func = test_lib.LookupFunctionInSource(script_url, line); |
978 EXPECT(!func.IsNull()); | 976 EXPECT(!func.IsNull()); |
979 EXPECT_STREQ("main", String::Handle(func.name()).ToCString()); | 977 EXPECT_STREQ("main", String::Handle(func.name()).ToCString()); |
980 } | 978 } |
981 | 979 |
982 func = test_lib.LookupFunctionInSource(script_url, 3); | 980 func = test_lib.LookupFunctionInSource(script_url, 3); |
Ivan Posva
2012/12/28 17:53:49
Shouldn't this be lines 2,3 and 4 now?
hausner
2013/01/07 23:24:31
Done.
| |
983 EXPECT(!func.IsNull()); | 981 EXPECT(!func.IsNull()); |
984 EXPECT_STREQ("foo", String::Handle(func.name()).ToCString()); | 982 EXPECT_STREQ("foo", String::Handle(func.name()).ToCString()); |
985 | 983 |
986 func = test_lib.LookupFunctionInSource(script_url, 1); | 984 func = test_lib.LookupFunctionInSource(script_url, 1); |
987 EXPECT(func.IsNull()); | 985 EXPECT(!func.IsNull()); |
Ivan Posva
2012/12/28 17:53:49
Please explain in a comment why you find the const
hausner
2013/01/07 23:24:31
Done.
| |
986 EXPECT_STREQ("A.", String::Handle(func.name()).ToCString()); | |
988 func = test_lib.LookupFunctionInSource(script_url, 6); | 987 func = test_lib.LookupFunctionInSource(script_url, 6); |
989 EXPECT(func.IsNull()); | 988 EXPECT(func.IsNull()); |
990 func = test_lib.LookupFunctionInSource(script_url, 10); | 989 func = test_lib.LookupFunctionInSource(script_url, 10); |
991 EXPECT(func.IsNull()); | 990 EXPECT(func.IsNull()); |
992 | 991 |
993 Dart_Handle libs = Dart_GetLibraryURLs(); | 992 Dart_Handle libs = Dart_GetLibraryURLs(); |
994 EXPECT(Dart_IsList(libs)); | 993 EXPECT(Dart_IsList(libs)); |
995 intptr_t num_libs; | 994 intptr_t num_libs; |
996 Dart_ListLength(libs, &num_libs); | 995 Dart_ListLength(libs, &num_libs); |
997 EXPECT(num_libs > 0); | 996 EXPECT(num_libs > 0); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1220 while (interrupt_isolate_id != ILLEGAL_ISOLATE_ID) { | 1219 while (interrupt_isolate_id != ILLEGAL_ISOLATE_ID) { |
1221 ml.Wait(); | 1220 ml.Wait(); |
1222 } | 1221 } |
1223 } | 1222 } |
1224 EXPECT(interrupt_isolate_id == ILLEGAL_ISOLATE_ID); | 1223 EXPECT(interrupt_isolate_id == ILLEGAL_ISOLATE_ID); |
1225 } | 1224 } |
1226 | 1225 |
1227 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1226 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
1228 | 1227 |
1229 } // namespace dart | 1228 } // namespace dart |
OLD | NEW |