public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Cc: "François Dumont" <frs.dumont@gmail.com>
Subject: [committed 2/2] libstdc++: Fix invalid order in PSTL inplace_merge test [PR90276]
Date: Fri,  2 Feb 2024 10:28:08 +0000	[thread overview]
Message-ID: <20240202102846.2241323-2-jwakely@redhat.com> (raw)
In-Reply-To: <20240202102846.2241323-1-jwakely@redhat.com>

Tested x86_64-linux. Pushed to trunk.

-- >8 --

This looks like a typo in the upstream test that causes a failure in
debug mode. It has been reported upstream.

libstdc++-v3/ChangeLog:

	PR libstdc++/90276
	* testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc: Fix
	comparison function to use less-than instead of equality.
---
 .../testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
index 576f22423b8..a9205553574 100644
--- a/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/pstl/alg_merge/inplace_merge.cc
@@ -160,7 +160,7 @@ main()
     test_by_type<MemoryChecker>(
         [](std::size_t idx){ return MemoryChecker{std::int32_t(idx * 2)}; },
         [](std::size_t idx){ return MemoryChecker{std::int32_t(idx * 2 + 1)}; },
-        [](const MemoryChecker& val1, const MemoryChecker& val2){ return val1.value() == val2.value(); });
+        [](const MemoryChecker& val1, const MemoryChecker& val2){ return val1.value() < val2.value(); });
     EXPECT_FALSE(MemoryChecker::alive_objects() < 0, "wrong effect from inplace_merge: number of ctors calls < num of dtors calls");
     EXPECT_FALSE(MemoryChecker::alive_objects() > 0, "wrong effect from inplace_merge: number of ctors calls > num of dtors calls");
 
-- 
2.43.0


      reply	other threads:[~2024-02-02 10:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 10:28 [committed 1/2] libstdc++: Avoid reusing moved-from iterators in PSTL tests [PR90276] Jonathan Wakely
2024-02-02 10:28 ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240202102846.2241323-2-jwakely@redhat.com \
    --to=jwakely@redhat.com \
    --cc=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).