From 05abfd8200c56d52f74ca4ebdca4d1536d376fdd Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sat, 4 Nov 2023 00:13:32 +0100 Subject: Issue #2281 - Remove the use of non-standard namespace std::tr1 in Google's WebRTC gtest code --- .../testing/gtest/include/gtest/gtest-printers.h | 39 +++++------ .../gtest/internal/gtest-param-util-generated.h | 75 +++++++++++----------- .../internal/gtest-param-util-generated.h.pump | 11 ++-- 3 files changed, 64 insertions(+), 61 deletions(-) diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h b/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h index 0639d9f586..686e85f106 100644 --- a/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h +++ b/media/webrtc/trunk/testing/gtest/include/gtest/gtest-printers.h @@ -1,4 +1,5 @@ // Copyright 2007, Google Inc. +// Copyright 2023, Moonchild Productions // All rights reserved. // // Redistribution and use in source and binary forms, with or without @@ -494,60 +495,60 @@ void PrintTupleTo(const T& t, ::std::ostream* os); // regardless of whether tr1::tuple is implemented using the // non-standard variadic template feature or not. -inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { +inline void PrintTo(const ::std::tuple<>& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } template -void PrintTo(const ::std::tr1::tuple& t, +void PrintTo(const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } @@ -555,7 +556,7 @@ void PrintTo(const ::std::tr1::tuple& t, template void PrintTo( - const ::std::tr1::tuple& t, + const ::std::tuple& t, ::std::ostream* os) { PrintTupleTo(t, os); } @@ -774,8 +775,8 @@ struct TuplePrefixPrinter { static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { TuplePrefixPrinter::PrintPrefixTo(t, os); *os << ", "; - UniversalPrinter::type> - ::Print(::std::tr1::get(t), os); + UniversalPrinter::type> + ::Print(::std::get(t), os); } // Tersely prints the first N fields of a tuple to a string vector, @@ -784,7 +785,7 @@ struct TuplePrefixPrinter { static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { TuplePrefixPrinter::TersePrintPrefixToStrings(t, strings); ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get(t), &ss); + UniversalTersePrint(::std::get(t), &ss); strings->push_back(ss.str()); } }; @@ -807,14 +808,14 @@ template <> struct TuplePrefixPrinter<1> { template static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - UniversalPrinter::type>:: - Print(::std::tr1::get<0>(t), os); + UniversalPrinter::type>:: + Print(::std::get<0>(t), os); } template static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get<0>(t), &ss); + UniversalTersePrint(::std::get<0>(t), &ss); strings->push_back(ss.str()); } }; @@ -824,7 +825,7 @@ struct TuplePrefixPrinter<1> { template void PrintTupleTo(const T& t, ::std::ostream* os) { *os << "("; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: + TuplePrefixPrinter< ::std::tuple_size::value>:: PrintPrefixTo(t, os); *os << ")"; } @@ -835,7 +836,7 @@ void PrintTupleTo(const T& t, ::std::ostream* os) { template Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { Strings result; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: + TuplePrefixPrinter< ::std::tuple_size::value>:: TersePrintPrefixToStrings(value, &result); return result; } diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h index e80548592c..fa8f6f0c3b 100644 --- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h +++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h @@ -2,7 +2,8 @@ // pump.py gtest-param-util-generated.h.pump // DO NOT EDIT BY HAND!!! -// Copyright 2008 Google Inc. +// Copyright 2008, Google Inc. +// Copyright 2023, Moonchild Productions // All Rights Reserved. // // Redistribution and use in source and binary forms, with or without @@ -3157,9 +3158,9 @@ class ValueArray50 { // template class CartesianProductGenerator2 - : public ParamGeneratorInterface< ::std::tr1::tuple > { + : public ParamGeneratorInterface< ::std::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator2(const ParamGenerator& g1, const ParamGenerator& g2) @@ -3272,9 +3273,9 @@ class CartesianProductGenerator2 template class CartesianProductGenerator3 - : public ParamGeneratorInterface< ::std::tr1::tuple > { + : public ParamGeneratorInterface< ::std::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator3(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3) @@ -3404,9 +3405,9 @@ class CartesianProductGenerator3 template class CartesianProductGenerator4 - : public ParamGeneratorInterface< ::std::tr1::tuple > { + : public ParamGeneratorInterface< ::std::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator4(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -3555,9 +3556,9 @@ class CartesianProductGenerator4 template class CartesianProductGenerator5 - : public ParamGeneratorInterface< ::std::tr1::tuple > { + : public ParamGeneratorInterface< ::std::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator5(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -3723,10 +3724,10 @@ class CartesianProductGenerator5 template class CartesianProductGenerator6 - : public ParamGeneratorInterface< ::std::tr1::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator6(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -3909,10 +3910,10 @@ class CartesianProductGenerator6 template class CartesianProductGenerator7 - : public ParamGeneratorInterface< ::std::tr1::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator7(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -4112,10 +4113,10 @@ class CartesianProductGenerator7 template class CartesianProductGenerator8 - : public ParamGeneratorInterface< ::std::tr1::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator8(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -4334,10 +4335,10 @@ class CartesianProductGenerator8 template class CartesianProductGenerator9 - : public ParamGeneratorInterface< ::std::tr1::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator9(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -4573,10 +4574,10 @@ class CartesianProductGenerator9 template class CartesianProductGenerator10 - : public ParamGeneratorInterface< ::std::tr1::tuple > { public: - typedef ::std::tr1::tuple ParamType; + typedef ::std::tuple ParamType; CartesianProductGenerator10(const ParamGenerator& g1, const ParamGenerator& g2, const ParamGenerator& g3, @@ -4838,8 +4839,8 @@ class CartesianProductHolder2 { CartesianProductHolder2(const Generator1& g1, const Generator2& g2) : g1_(g1), g2_(g2) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + operator ParamGenerator< ::std::tuple >() const { + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator2( static_cast >(g1_), static_cast >(g2_))); @@ -4860,8 +4861,8 @@ CartesianProductHolder3(const Generator1& g1, const Generator2& g2, const Generator3& g3) : g1_(g1), g2_(g2), g3_(g3) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + operator ParamGenerator< ::std::tuple >() const { + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator3( static_cast >(g1_), static_cast >(g2_), @@ -4885,8 +4886,8 @@ CartesianProductHolder4(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4) : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + operator ParamGenerator< ::std::tuple >() const { + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator4( static_cast >(g1_), static_cast >(g2_), @@ -4912,8 +4913,8 @@ CartesianProductHolder5(const Generator1& g1, const Generator2& g2, const Generator3& g3, const Generator4& g4, const Generator5& g5) : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + operator ParamGenerator< ::std::tuple >() const { + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator5( static_cast >(g1_), static_cast >(g2_), @@ -4943,8 +4944,8 @@ CartesianProductHolder6(const Generator1& g1, const Generator2& g2, : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + operator ParamGenerator< ::std::tuple >() const { + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator6( static_cast >(g1_), static_cast >(g2_), @@ -4976,9 +4977,9 @@ CartesianProductHolder7(const Generator1& g1, const Generator2& g2, : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator7( static_cast >(g1_), static_cast >(g2_), @@ -5014,9 +5015,9 @@ CartesianProductHolder8(const Generator1& g1, const Generator2& g2, g8_(g8) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( + return ParamGenerator< ::std::tuple >( new CartesianProductGenerator8( static_cast >(g1_), static_cast >(g2_), @@ -5055,9 +5056,9 @@ CartesianProductHolder9(const Generator1& g1, const Generator2& g2, g9_(g9) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( new CartesianProductGenerator9( static_cast >(g1_), @@ -5099,9 +5100,9 @@ CartesianProductHolder10(const Generator1& g1, const Generator2& g2, g9_(g9), g10_(g10) {} template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( new CartesianProductGenerator10( diff --git a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump index 009206fd31..864fbee16b 100644 --- a/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump +++ b/media/webrtc/trunk/testing/gtest/include/gtest/internal/gtest-param-util-generated.h.pump @@ -1,7 +1,8 @@ $$ -*- mode: c++; -*- $var n = 50 $$ Maximum length of Values arguments we want to support. $var maxtuple = 10 $$ Maximum number of Combine arguments we want to support. -// Copyright 2008 Google Inc. +// Copyright 2008, Google Inc. +// Copyright 2023, Moonchild Productions // All Rights Reserved. // // Redistribution and use in source and binary forms, with or without @@ -128,9 +129,9 @@ $range k 2..i template <$for j, [[typename T$j]]> class CartesianProductGenerator$i - : public ParamGeneratorInterface< ::std::tr1::tuple<$for j, [[T$j]]> > { + : public ParamGeneratorInterface< ::std::tuple<$for j, [[T$j]]> > { public: - typedef ::std::tr1::tuple<$for j, [[T$j]]> ParamType; + typedef ::std::tuple<$for j, [[T$j]]> ParamType; CartesianProductGenerator$i($for j, [[const ParamGenerator& g$j]]) : $for j, [[g$(j)_(g$j)]] {} @@ -269,8 +270,8 @@ class CartesianProductHolder$i { CartesianProductHolder$i($for j, [[const Generator$j& g$j]]) : $for j, [[g$(j)_(g$j)]] {} template <$for j, [[typename T$j]]> - operator ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >() const { - return ParamGenerator< ::std::tr1::tuple<$for j, [[T$j]]> >( + operator ParamGenerator< ::std::tuple<$for j, [[T$j]]> >() const { + return ParamGenerator< ::std::tuple<$for j, [[T$j]]> >( new CartesianProductGenerator$i<$for j, [[T$j]]>( $for j,[[ -- cgit v1.2.3