Commit 9f44c679 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

Compare exception_wrapper::class_name() to demangle(typeid(...)) in tests

Summary: [Folly] Compare `exception_wrapper::class_name()` to `demangle(typeid(...))` in tests v.s. comparing it to string literals since the actual result of `...::class_name()` depends on the platform and whether `libiberty-dev` is available.

Differential Revision: D21711569

fbshipit-source-id: b2289d89923d6775c7e806eff9c3732ad37a0218
parent 82ca4c04
......@@ -561,20 +561,14 @@ struct OnHeapException : std::exception {
TEST(ExceptionWrapper, make_wrapper_no_args) {
EXPECT_THAT(
folly::make_exception_wrapper<ThrownException>()
.class_name()
.toStdString(),
testing::EndsWith("ThrownException"));
folly::make_exception_wrapper<ThrownException>().class_name(),
testing::Eq(demangle(typeid(ThrownException))));
EXPECT_THAT(
folly::make_exception_wrapper<InSituException>()
.class_name()
.toStdString(),
testing::EndsWith("InSituException"));
folly::make_exception_wrapper<InSituException>().class_name(),
testing::Eq(demangle(typeid(InSituException))));
EXPECT_THAT(
folly::make_exception_wrapper<OnHeapException>()
.class_name()
.toStdString(),
testing::EndsWith("OnHeapException"));
folly::make_exception_wrapper<OnHeapException>().class_name(),
testing::Eq(demangle(typeid(OnHeapException))));
}
namespace {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment