Reduce flakyness of random order test.

PiperOrigin-RevId: 696917989
pull/19281/head
Protobuf Team Bot 4 weeks ago committed by Copybara-Service
parent 20758b88bb
commit 7df353d94a
  1. 17
      csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs
  2. 6
      src/google/protobuf/map_test.inc

@ -1,17 +0,0 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
#endregion
namespace Google.Protobuf.Reflection;
internal sealed partial class FeatureSetDescriptor
{
// Canonical serialized form of the edition defaults, generated by embed_edition_defaults.
private const string DefaultsBase64 =
"ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH";
}

@ -1365,9 +1365,9 @@ TEST_F(MapImplTest, SpaceUsed) {
bool MapOrderingIsRandom(int a, int b) { bool MapOrderingIsRandom(int a, int b) {
bool saw_a_first = false; bool saw_a_first = false;
bool saw_b_first = false; bool saw_b_first = false;
std::vector<Map<int32_t, int32_t>> v(50); std::vector<Map<int32_t, int32_t>> v;
for (int i = 0; i < 50; ++i) { while (v.size() < 100) {
Map<int32_t, int32_t>& m = v[i]; Map<int32_t, int32_t>& m = v.emplace_back();
m[a] = 0; m[a] = 0;
m[b] = 0; m[b] = 0;
int32_t first_element = m.begin()->first; int32_t first_element = m.begin()->first;

Loading…
Cancel
Save