NetSoakTestTypes.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/RTTI/TypeSafeIntegral.h>
  10. #include <AzCore/std/string/fixed_string.h>
  11. namespace NetSoakTest
  12. {
  13. AZ_TYPE_SAFE_INTEGRAL(HostId, uint32_t);
  14. static constexpr HostId InvalidHostId = static_cast<HostId>(-1);
  15. static constexpr size_t TestSize = 6400;
  16. using TestNetworkBuffer = AZStd::basic_fixed_string<char, TestSize, AZStd::char_traits<char>>;
  17. constexpr TestNetworkBuffer CreateMassiveBuffer()
  18. {
  19. constexpr char hexchar[] = "0123456789ABCDEF";
  20. TestNetworkBuffer rBuffer;
  21. for (size_t i = 0; i < TestSize; ++i)
  22. {
  23. rBuffer.append(1, hexchar[i % (sizeof(hexchar) - 1)]);
  24. }
  25. return rBuffer;
  26. }
  27. constexpr TestNetworkBuffer MassiveBuffer = CreateMassiveBuffer();
  28. }
  29. AZ_TYPE_SAFE_INTEGRAL_SERIALIZEBINDING(NetSoakTest::HostId);