From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- mfbt/tests/TestResult.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'mfbt/tests/TestResult.cpp') diff --git a/mfbt/tests/TestResult.cpp b/mfbt/tests/TestResult.cpp index a2e10640c5..f03f06b03c 100644 --- a/mfbt/tests/TestResult.cpp +++ b/mfbt/tests/TestResult.cpp @@ -852,6 +852,50 @@ void UpcastTest() { } } +void EqualityTest() { + { + Result result(1); + Result other(1); + + MOZ_RELEASE_ASSERT(result == other); + } + + { + Result result(true); + Result other(true); + + MOZ_RELEASE_ASSERT(result == other); + } + + { + Result result(1); + Result other(2); + + MOZ_RELEASE_ASSERT(result != other); + } + + { + Result result(true); + Result other(false); + + MOZ_RELEASE_ASSERT(result != other); + } + + { + Result result(0); + Result other(false); + + MOZ_RELEASE_ASSERT(result != other); + } + + { + Result result(1); + Result other(1u); + + MOZ_RELEASE_ASSERT(result != other); + } +} + /* * */ int main() { @@ -866,5 +910,6 @@ int main() { UniquePtrTest(); ZeroIsEmptyErrorTest(); UpcastTest(); + EqualityTest(); return 0; } -- cgit v1.2.3