b8ee3a9996
We were exporting all symbols to the dynamic table so that they could be looked up using `dladdr` for the profiler and backtracer. The symbols include our statically-linked libcxx, which can create trouble when another DSO has a different version of libcxx. Now we export only the VM embedding API functions (`Dart_*`) and use a specially produced table to do the symbolization. TEST=runtime/tests/vm/dart/exported_symbols_test.dart TEST=runtime/tests/vm/dart/symbolized_crash_test.dart Bug: https://github.com/dart-lang/sdk/issues/53267 Change-Id: I2ee494fba86f67127ba0f6f402622f01a4662207 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/323702 Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
// Copyright (c) 2012, 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/unit_test.h"
|
|
|
|
VM_UNIT_TEST_CASE(Assert) {
|
|
ASSERT(true);
|
|
ASSERT(87 == 87);
|
|
ASSERT(42 != 87);
|
|
}
|
|
|
|
VM_UNIT_TEST_CASE(Expect) {
|
|
EXPECT(true);
|
|
EXPECT(87 == 87);
|
|
EXPECT(42 != 87);
|
|
|
|
EXPECT_EQ(0, 0);
|
|
EXPECT_EQ(42, 42);
|
|
EXPECT_EQ(true, true);
|
|
void* pointer = reinterpret_cast<void*>(42);
|
|
EXPECT_EQ(pointer, pointer);
|
|
|
|
EXPECT_STREQ("Hello", "Hello");
|
|
|
|
EXPECT_LT(1, 2);
|
|
EXPECT_LT(1, 1.5);
|
|
EXPECT_LT(-1.8, 3.14);
|
|
|
|
EXPECT_LE(1, 1);
|
|
EXPECT_LE(1, 2);
|
|
EXPECT_LE(0.5, 1);
|
|
|
|
EXPECT_GT(4, 1);
|
|
EXPECT_GT(2.3, 2.2229);
|
|
|
|
EXPECT_GE(4, 4);
|
|
EXPECT_GE(15.3, 15.3);
|
|
EXPECT_GE(5, 3);
|
|
|
|
EXPECT_FLOAT_EQ(15.43, 15.44, 0.01);
|
|
EXPECT_FLOAT_EQ(1.43, 1.43, 0.00);
|
|
}
|
|
|
|
VM_UNIT_TEST_CASE(Fail0) {
|
|
FAIL("This test fails");
|
|
}
|
|
|
|
VM_UNIT_TEST_CASE(Fail1) {
|
|
FAIL("This test fails with one argument: %d", 4);
|
|
}
|
|
|
|
VM_UNIT_TEST_CASE(Fail2) {
|
|
FAIL("This test fails with two arguments: %d, %d", -100, 42);
|
|
}
|
|
|
|
VM_UNIT_TEST_CASE_WITH_EXPECTATION(Fatal, "Crash") {
|
|
FATAL("This test fails and produces a backtrace");
|
|
}
|