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

Unified Diff: runtime/vm/native_symbol_test.cc

Issue 25909002: Sampling profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: runtime/vm/native_symbol_test.cc
diff --git a/runtime/vm/native_symbol_test.cc b/runtime/vm/native_symbol_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d86c3bde3e559a827b2b625ff1a9ce2a68a594fd
--- /dev/null
+++ b/runtime/vm/native_symbol_test.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/assert.h"
+
+#include "vm/dart_api_impl.h"
+#include "vm/dart_api_state.h"
+#include "vm/globals.h"
+#include "vm/profiler.h"
+#include "vm/native_symbol.h"
+#include "vm/unit_test.h"
+
+extern int main(int argc, const char** argv);
+
+namespace dart {
+
+
+TEST_CASE(LookupNativeSymbol) {
+ uintptr_t p = reinterpret_cast<uintptr_t>(&main);
+ char* name = NativeSymbolResolver::LookupSymbolName(p);
+ EXPECT_NOTNULL(name);
+ EXPECT_SUBSTRING("main", name);
+ NativeSymbolResolver::FreeSymbolName(name);
+}
+
+
+} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698