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

Unified Diff: base/template_util_unittest.cc

Issue 2261793002: Bring the feedback button to the Mac sad tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Trybots caught this, but not the local presubmit check. Will investigate. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/template_util_unittest.cc
diff --git a/base/template_util_unittest.cc b/base/template_util_unittest.cc
index 921596474b6d9a38991506396a1c64148025885d..3b7d9f7e4bfd5f2cea39e74878957c8a7f5aba14 100644
--- a/base/template_util_unittest.cc
+++ b/base/template_util_unittest.cc
@@ -30,6 +30,32 @@ static_assert(!is_non_const_reference<const int&>::value,
"IsNonConstReference");
static_assert(is_non_const_reference<int&>::value, "IsNonConstReference");
+// underlying_value
+enum ClassicEnum : int { CLASSIC_ENUM_A };
+enum class ClassyEnum : int { A };
+
+struct Uncopyable {
+ // Uncopyable() = default;
Nico 2016/08/30 21:11:11 ?
Sidney San Martín 2016/08/30 21:24:32 Thanks, missed that. Done.
+ Uncopyable(Uncopyable&&) = default;
+ Uncopyable(const Uncopyable&) = delete;
+};
+
+static_assert(
+ std::is_same<decltype(underlying_value(Uncopyable{})), Uncopyable>::value,
+ "underlying_value: failed to return an object without copying.");
+
+static_assert(
+ std::is_same<decltype(underlying_value(int64_t(10))), int64_t>::value,
+ "underlying_value: failed to return an integer as its own type.");
+
+static_assert(
+ std::is_integral<decltype(underlying_value(CLASSIC_ENUM_A))>::value,
+ "underlying_value: failed to return an unscoped enum as an integer.");
+
+static_assert(
+ std::is_integral<decltype(underlying_value(ClassyEnum::A))>::value,
+ "underlying_value: failed to return a scoped enum as an integer.");
+
class AssignParent {};
class AssignChild : AssignParent {};

Powered by Google App Engine
This is Rietveld 408576698