From: Jonathan Wakely Date: Wed, 2 Jun 2021 11:33:38 +0000 (+0100) Subject: libstdc++: Fix tests for COW std::string [PR 96088] X-Git-Tag: basepoints/gcc-13~7151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81eab204a56dcd8acb1ca5d7df277437ca07b51a;p=thirdparty%2Fgcc.git libstdc++: Fix tests for COW std::string [PR 96088] The expected number of allocations is different when copying COW strings. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/96088 * testsuite/23_containers/unordered_map/96088.cc: Adjust expected number of allocations. * testsuite/23_containers/unordered_set/96088.cc: Likewise. --- diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc index e552b04f8c8f..83ca1c0afd66 100644 --- a/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/96088.cc @@ -222,7 +222,8 @@ test03() std::vector> v; v.insert(v.end(), lst.begin(), lst.end()); - auto __offset = __gnu_test::counter::count(); + const auto origin = __gnu_test::counter::count(); + { __gnu_test::counter::reset(); std::unordered_map v; v.insert(v.end(), lst.begin(), lst.end()); - auto __offset = __gnu_test::counter::count(); + const auto origin = __gnu_test::counter::count(); + { __gnu_test::counter::reset(); std::unordered_set