// Copyright (c) 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_

#include "quic/platform/api/quic_logging.h"
#include "net/quic/platform/impl/quic_test_impl.h"

using QuicFlagSaver = QuicFlagSaverImpl;

// Defines the base classes to be used in QUIC tests.
using QuicTest = QuicTestImpl;
template <class T>
using QuicTestWithParam = QuicTestWithParamImpl<T>;

// Class which needs to be instantiated in tests which use threads.
using ScopedEnvironmentForThreads = ScopedEnvironmentForThreadsImpl;

#define QUIC_TEST_DISABLED_IN_CHROME(name) \
  QUIC_TEST_DISABLED_IN_CHROME_IMPL(name)

inline std::string QuicGetTestMemoryCachePath() {
  return QuicGetTestMemoryCachePathImpl();
}

#define QUIC_SLOW_TEST(test) QUIC_SLOW_TEST_IMPL(test)

#endif  // QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_

// Copyright (c) 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_
#define QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_

#include "quic/platform/api/quic_logging.h"
#include "net/quic/platform/impl/quic_test_impl.h"
#include "common/platform/api/quiche_test.h"

using QuicFlagSaver = QuicFlagSaverImpl;

// Defines the base classes to be used in QUIC tests.
using QuicTest = QuicTestImpl;
template <class T>
using QuicTestWithParam = QuicTestWithParamImpl<T>;

// Class which needs to be instantiated in tests which use threads.
using ScopedEnvironmentForThreads = ScopedEnvironmentForThreadsImpl;

#define QUIC_TEST_DISABLED_IN_CHROME(name) \
  QUIC_TEST_DISABLED_IN_CHROME_IMPL(name)

inline std::string QuicGetTestMemoryCachePath() {
  return QuicGetTestMemoryCachePathImpl();
}

#define QUIC_SLOW_TEST(test) QUIC_SLOW_TEST_IMPL(test)

#endif  // QUICHE_QUIC_PLATFORM_API_QUIC_TEST_H_

Move EXPECT_EQ macro magic from quic/platform to quiche/platform.
Move EXPECT_EQ macro magic from quic/platform to quiche/platform.

The purpose of this machinary is to override EXPECT_EQ and similar comparison
macros so that -Wsigned-compare actually catches signed-unsigned comparison in
internal builds (where gTest implementation is slightly different so otherwise
the warning would not be effective).  This CL moves it from
quic/platform/api/quic_test.h to quiche/common/platform/quiche_test.h, while
also adding an include of the latter to the former, to make users of either
header benefit from it.

The change to frame_formatter_test.cc is necessary to avoid the following
error:

third_party/http2/tools/frame_formatter_test.cc:75:3: error: non-const lvalue reference to type 'basic_string<...>' cannot bind to a temporary of type 'basic_string<...>'
  EXPECT_EQ("\x01 a", std::move(status_or_parsed).value());
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./third_party/quiche/common/platform/impl/quiche_test_impl.h:73:3: note: expanded from macro 'EXPECT_EQ'
  QUIC_LOGGING_INTERNAL_EXPECT_EXT(EqHelper::Compare, ==, val1, val2)
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./third_party/quiche/common/platform/impl/quiche_test_impl.h:68:3: note: expanded from macro 'QUIC_LOGGING_INTERNAL_EXPECT_EXT'
  QUIC_LOGGING_INTERNAL_INNER_COMPARE(_comparison_symbol, _val1, _val2);     \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./net/quic/platform_overrides/quiche_platform_impl/quiche_logging_impl.h:164:30: note: expanded from macro 'QUIC_LOGGING_INTERNAL_INNER_COMPARE'
      const decltype(_val2)& _local_val2 = (_val2);                           \

PiperOrigin-RevId: 390165392
