TEST_F(StreamInfoImplTest, SetFrom) {
  StreamInfoImpl s1(Http::Protocol::Http2, test_time_.timeSystem(), nullptr);

  s1.addBytesReceived(1);
  s1.downstreamTiming().onLastDownstreamRxByteReceived(test_time_.timeSystem());

#ifdef __clang__
#if defined(__linux__)
#if defined(__has_feature) && !(__has_feature(thread_sanitizer))
  ASSERT_TRUE(sizeof(s1) == 760 || sizeof(s1) == 776 || sizeof(s1) == 800)
      << "If adding fields to StreamInfoImpl, please check to see if you "
         "need to add them to setFromForRecreateStream! Current size "
      << sizeof(s1);
#endif
#endif
#endif

  StreamInfoImpl s2(Http::Protocol::Http11, test_time_.timeSystem(), nullptr);
  s2.setFromForRecreateStream(s1);
  EXPECT_EQ(s1.startTime(), s2.startTime());
  EXPECT_EQ(s1.startTimeMonotonic(), s2.startTimeMonotonic());
  EXPECT_EQ(s1.downstreamTiming().lastDownstreamRxByteReceived(),
            s2.downstreamTiming().lastDownstreamRxByteReceived());
  EXPECT_EQ(s1.protocol(), s2.protocol());
  EXPECT_EQ(s1.bytesReceived(), s2.bytesReceived());
  EXPECT_EQ(s1.getDownstreamBytesMeter(), s2.getDownstreamBytesMeter());
}
TEST_F(StreamInfoImplTest, SetFrom) {
  StreamInfoImpl s1(Http::Protocol::Http2, test_time_.timeSystem(), nullptr);

  s1.addBytesReceived(1);
  s1.downstreamTiming().onLastDownstreamRxByteReceived(test_time_.timeSystem());

#ifdef __clang__
#if defined(__linux__)
#if defined(__has_feature) && !(__has_feature(thread_sanitizer))
  ASSERT_TRUE(sizeof(s1) == 760 || sizeof(s1) == 776 || sizeof(s1) == 800)
      << "If adding fields to StreamInfoImpl, please check to see if you "
         "need to add them to setFromForRecreateStream! Current size "
      << sizeof(s1);
#endif
#endif
#endif

  StreamInfoImpl s2(Http::Protocol::Http11, test_time_.timeSystem(), nullptr);
  s2.setFromForRecreateStream(s1);
  EXPECT_EQ(s1.startTime(), s2.startTime());
  EXPECT_EQ(s1.startTimeMonotonic(), s2.startTimeMonotonic());
  EXPECT_EQ(s1.downstreamTiming().lastDownstreamRxByteReceived(),
            s2.downstreamTiming().lastDownstreamRxByteReceived());
  EXPECT_EQ(s1.protocol(), s2.protocol());
  EXPECT_EQ(s1.bytesReceived(), s2.bytesReceived());
  EXPECT_EQ(s1.getDownstreamBytesMeter(), s2.getDownstreamBytesMeter());
}