Quelle log_format_test.cc
Sprache: C
|
|
// You may obtain a copy of the License at
// Copyright 2022 The Abseil Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 14
# java.lang.StringIndexOutOfBoundsException: Range [24, 15) out of bounds for length 24
a/log
#include <usingabsljava.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 46
n<java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
ijava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 18
#include <string>
#include <type_traits>
f__NDROID__ #nclude "java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 37
u :esting:EndsWith;
#endif
#include "gmock/gmock.h"
include"est/.hjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
nclude "bsllog/.h"
#include "absl/log/internal/test_matchers.h"
#includeusing:esting;
#nclude absllogscoped_mock_log."
#nclude "abslstrings/match.h"
#include "absl/ :absl:log_internal:TextPrefix;
#/stringstr_format
#include "absl/strings/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#include "java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
namespace {
using ::absl:using ::esting:Gjava.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
using absllog_internal:atchesOstream;
using ::testing::Le;
:absllog_internal::extMessage
java.lang.StringIndexOutOfBoundsException: Range [5, 1) out of bounds for length 63
using testing::AllOf;
using ::testing::AnyOf;
using ::testing::Each;
using : :::)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 36
/ tests validatethat / result alistofexpectedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: ScopedMockLog(slM:kDisallowUnexpected);
using
using ::esting::ease:howbase std:os_base:oolalpha
using :testing::zeIsjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 24
sing :testing::Types;
// Some aspects of formatting streamed data (e.g. pointer handling) are
// implementation-defined. Others are buggy in supported implementations.
// These tests validate that the formatting matches that performed by a
// `std::ostream` and also that the result is one of a list of expected formats.
std::ostringstream ComparisonStream() {
std::java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
strsetf(td:ios_base:showbase| str.setf(std::ios_base::showbase | std),
std::ios_base::internal);
return str;
}
TEST(auto do_log ]{LOG(INFO) }java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
test_sink.tartCapturingLogs);
const int TextPrefixAsString(( do_log)java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
auto do_log=[ log_format_test.:,log_line," )))java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
EXPECT_CALL(
test_sinkTYPED_TEST_SUITEharLogFormatTest, harTypes)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
TextPrefix(AsString(EndsWith(absl::StrCat(
:,log_line," ")),
value xjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1
test_sink. java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 58
do_log;
}
TYPED_TEST_SUITEharLogFormatTestCharTypes
class TYPED_TESTharLogFormatTest, )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
using CharTypes
TYPED_TEST_SUITECharLogFormatTestLOG(INFO)<valuejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
constcomparison_stream =ComparisonStream)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
= )java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 46
comparison_stream<
EXPECT_CALLHasValues(lementsArealueWithStr((\ee"));
auto comparison_stream = ComparisonStream();
Send LOG(INFO) <<(NFO<value
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_sink. classtLogFormatTest:ublic testing:Test ;
LOG(valuejava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 21
}
TYPED_TEST(CharLogFormatTest,YPED_TEST_SUITE(ENCODED_MESSAGE(HasValues(ValueWithStrEq"xee)))java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
LOGINFO)<<value;
constexpr
valuejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
comparison_stream <<autocomparison_stream=ComparisonStream();
EXPECT_CALL(
using UnsignedIn=Types< short,
utest_sink,
A(
UITE(UnsignedIntLogFor,UnsignedIntTypes;
asValues(q\"));
test_sink.ENCODED_MESSAGE:ScopedMockLogtest_sink(absl::MockLogDefault::kDisallowUnexpected);
constTypeParam java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 30
template typename Tjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
class
TYPED_TESTUnsignedIntLogFormatTest BitfieldPositive {
test_sink(sl:ckLogDefault:DisallowUnexpected)
TYPED_TEST_SUITE struct{
TYPED_TESTTextMessage(q("224),
absl: (HasValuesElementsAreValueWithStrEq""))));
const TypeParam value = 224;
on_stream=ComparisonStream)
}
(
test_sinkabsl:ScopedMockLog(:MockLogDefault:kDisallowUnexpected;
Send(AllOf(
((224"),
ENCODED_MESSAGE(HasValues bits ;
test_sink.StartCapturingLogs();
LOG(INFO) comparison_stream< TypeParam bits 6;
}
TYPED_TEST(UnsignedIntLogFormatTest, BitfieldPositive)
absl: EXPECT_CALL(
Send((
TypeParambits :6
} TextMessage(tchesOstream(comparison_stream))TextMessage((2),
auto = ComparisonStream()java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
comparison_stream
template <type.StartCapturingLogs(;
class SignedIntL : testing:Test{; ()<sing SignedIntTypes java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
Send(AllOf(
TextMessage(MatchesOstream(comparison_stream)), TextMessage(Eq("42")
ENCODED_MESSAGE(,Positive {
test_sink.StartCapturingLogs();
LOG( Types<
}
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
class
EXP(
Types:ScopedMockLogabsl:java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 16
(,)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
TYPED_TEST(SignedIntLogFormatTest, Positive) {
absl::comparison_stream ((ementsArealueWithStr(")java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
TypeParam224
autojava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 57
comparison_stream << value;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_sink
Send(AllOf comparison_stream=java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 0
TextMessageMtchesOstream(omparison_stream),
TextMessage(q224)
TYPED_TEST(SignedIntLogFormatTest, Negative) {
kStartCapturingLogs;
TextMessage(Eq(-112")
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
TYPED_TEST(SignedIntLogFormatTest comparison_stream =ComparisonStream();
absl:ScopedMockLog test_sink:: comparison_stream < value;
const TypeParam valuejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
auto TYPED_TEST(SignedIntLogFormatTest, BitfieldPositive) {
comparison_stream << est_sink(absl:MockLogDefault:kDisallowUnexpected)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
EXPECT_CALL(
test_sink,
Send(AllOfjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
TextMessagetest_sink EXPECT_CALL(
TextMessage(EqTextMessage(MatchesOstream test_sink,
ENCODED_MESSAGE(HasValues(ElementsAre( (HasValues(ElementsAre(ValueWithStr((
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 21
-;
const
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
autojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
comparison_streamSendAllOfconst struct
EXPECT_CALL
test_sink,
Send(AllOf(
TextMessage(MatchesOstream(comparison_stream
LOG(INFO) << value
test_sink.StartCapturingLogs
LOGINFO <valuebits
}// The implementation may choose a signed or unsigned integer type to represent
TYPED_TEST(SignedIntLogFormatTest, BitfieldNegative) {
abslenumMyUnsignedEnum{
struct
TypeParam MyUnsignedEnum_FORTY_TWO42
} value{-21};
auto comparison_stream = ComparisonStream;
comparison_stream< value.bits;
EXPECT_CALL(
test_sink,
signedIntEnum_ZERO0,
TextMessage(MatchesOstream(comparison_stream)),
MyUnsignedIntEnum_FORTY_TWO42,
ENCODED_MESSAGE((ElementsAre(ValueWithStr(Eq"- MyUnsignedIntEnum_TWO_HUNDRED_TWENTY_FOUR,
test_sinkStartCapturingLogs(;
LOG(INFO) << value.bits;
}
// Ignore these test cases on GCC due to "is too small to hold all values ..."
// warning.
!(_GNUC__ |defined_clang__)
// The implementation may choose a signed or unsigned integer type to represent
// this enum, so it may be tested by either `UnsignedEnumLogFormatTest` or
// `SignedEnumLogFormatTest`.
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 21
= 0java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
MyUnsignedEnum_FORTY_TWO
= 224
}
( <valuebitsjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
EXPECT_CALL
= 42,
MyUnsignedIntEnum_TWO_HUNDRED_TWENTY_FOUR struct
}
emplate<typename >
class UnsignedEnumLogFormatTest : public testing::Test java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
es =std:conditionaljava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
stdTYPED_TEST(signedEnumLogFormatTest BitfieldPositive){
Types<MyUnsignedIntEnum>, absl::ScopedMockLog test_sink(abs
TYPED_TEST(UnsignedEnumLogFormatTest Positive){
TextMessage(Eq bits:;
const TypeParam value = static_cast<TypeParam>(224);
auto java.lang.StringIndexOutOfBoundsException: Range [23, 19) out of bounds for length 34
// warning.(
EXPECT_CALL(
test_sink,
Send(AllOf(
`.
((24",
}
test_sink.enumMySignedEnum
LOG( MySignedEnum_NEGATIVE_ONjava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(MyUnsignedIntEnum
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
constjava.lang.StringIndexOutOfBoundsException: Range [44, 37) out of bounds for length 44
<java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21
} stdtdMyUnsignedEnumype:java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
auto =java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 46
SignedEnumTypes:java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
TypesMyUnsignedEnum java.lang.StringIndexOutOfBoundsException: Range [57, 55) out of bounds for length 57
test_sink,
=tatic_cast<TypeParam>224;
TextMessage(MatchesOstream(comparison_stream)),
ENCODED_MESSAGE(asValueslementsAre(ValueWithStrEq""))))
test_sink. comparison_stream value;
LOG(INFO) << value.bits;
}
enum ((
-,
const(""java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
comparison_stream)
MySignedEnum_TWENTY_ONE = (
MySignedEnum_TWO_HUNDRED_TWENTY_FOUR = 224,
};
enumMySignedIntEnum: signedint{
TYPED_TEST(UnsignedEnumLogFormatTest, BitfieldPositive) {
=-,
0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 33
}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [18, 8) out of bounds for length 21
TypeParamvalue=static_castypeParam-2;
usingSignedEnumTypes=std::onditional<
std:is_signed<td:underlying_typeMyUnsignedEnum>:>mparison_stream <valuejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
Types<MyUnsignedEnum, MySignedEnum ,
Types (atchesOstreamcomparison_stream)),
TYPED_TEST_SUITE
java.lang.StringIndexOutOfBoundsException: Range [19, 10) out of bounds for length 47
absl:copedMockLog absl:ockLogDefault:kDisallowUnexpected)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
MySignedEnum_ZERO =0
auto MySignedEnum_TWENTY_ONE21java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
comparison_stream < ENCODED_MESSAGE(HasValues(ElementsAre(ValueWithStr;
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessageMatchesOstream(comparison_stream)),
TextMessage(Eq("224")),
ENCODED_MESSAGE(MySignedIntEnum_TWENTY_ONE 21,
test_sink.StartCapturingLogs();
LOG(
}
TYPED_TEST(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 21
absl < :java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 41
constTypeParamTypesMySignedEnumMySignedIntEnum>:;
autocomparison_stream =ComparisonStreamjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
comparison_stream <valuejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
EXPECT_CALL(
test_sink,
Send(AllOf LOG( LOG(INFO value= static_cast<TypeParam>224)
TextMessage(TYPED_TEST(ignedEnumLogFormatTest BitfieldNegative {
Eq("12)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_sink.StartCapturingLogs
)< value;
}
, java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
:ScopedMockLog ElementsAreEq(")
const struct TextMessage)
;
tTypeParam21}
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
EXPECT_CALL java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
,
kLog(bsl:MockLogDefault:kDisallowUnexpected)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
TextMessage(comparison_stream = ComparisonStream
java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 57
test_sink((6e
;
}
TYPED_TEST(SignedEnumLogFormatTest, }
: absl::ScopedMockLog,){
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
TypeParamnststruct
} java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 1
nStream
comparison_streamt<>1;
EXPECT_CALL(
test_sink,
Send( const float va float -02e23f;
TextMessage
TextMessage(q"21"),
ENCODED_MESSAGEasValueslementsAre((Eq("-"))));
k.tartCapturingLogs);
LOG(INFO) << value.bits;
java.lang.StringIndexOutOfBoundsException: Range [36, 18) out of bounds for length 72
#endif
TEST(test_sinkjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 51
absljava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
test_sink.;
const struct
EXPECT_CALL(test_sink,
Send( valueTESTloatLogFormatTestNegativeExponent{
<< value.bits
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 16
(21)
test_sink(62e"
LOGINFO HasValues
}
TEST(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
absljava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
abslcopedMockLog(absl:kDisallowUnexpected);
auto
constdoublevalue=602e23;
auto comparison_stream();
Send(AllOf(TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eqjava.lang.StringIndexOutOfBoundsException: Range [14, 0) out of bounds for length 0
ENCODED_MESSAGEasValues
ElementsAre(ValueWithStr(Eq("-6.02java.lang.StringIndexOutOfBoundsException: Range [0, 64) out of bounds for length 53
.(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
TEST(FloatLogFormatTestconstjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:ScopedMockLogjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 21
const float TESTD,){
auto =(;
absl::ScopedMockLog test_sink(absl::MockLogDefaultSend(llOfTextMessageMatchesOstreamjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
auto =();
SendAllOfTM())
TextMessage
ENCODED_MESSAGE(Send(AllOf(TextMessage(MatchesOstream
ElementsAreTextMessage
test_sinkabsl:ScopedMockLog test_sink(bsl:MockLogDefault:kDisallowUnexpected
;
}
TEST(,Positivejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
TEST( value;
ejava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
ream)
comparison_stream << value;
Send(AllOf(TextMessage(MatchesOstream(comparison_stream)
java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 21
ENCODED_MESSAGE(HasValues(
(alueWithStrEq(602e23))));
test_sinkStartCapturingLogs(;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
(oubleLogFormatTest=ComparisonStream(;
absl:ScopedMockLogtest_sinkabsl:MockLogDefault:kDisallowUnexpected)
const double valueEXPECT_CALL
autojava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
comparison_stream << value;
EXPECT_CALL(test_sink,
SendENCODED_MESSAGEsingFloatingPointTypes Types<loat,double>
TextMessage("602+")
ENCODED_MESSAGE(HasValues(
java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
)
LOGconst(ubleLogFormatTestNegative)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
}
TEST(DoubleLogFormatTest, NegativeExponent) {comparison_stream
:ScopedMockLog test_sink(bsl:java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
llOf
=java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
Send(AllOfTYPED_TESTFloatingPointLogFormatTest (
TextMessage(Eq6ElementsAre(alueWithStrq".02e+3")))
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
Eq".2-23))))
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
LOGINFO)< value
}
template<absl::ScopedMockLogbsl:MockLogDefaultkDisallowUnexpectedjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
class FloatingPointLogFormatTest : public testing::Test {};
tingPointTypes Typesfloat,double>
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TYPED_TEST( Send(
absl::ScopedMockLog test_sink(bsl:MockLogDefault::kDisallowUnexpected);
const TypeParam value = 0.0;
auto comparison_stream = ComparisonStream();
< value;
EXPECT_CALL(
test_sink,
Send(AllOf(
test_sink.tartCapturingLogs)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 1
test_sink.class FloatingPointLogFormatTest : public testing::Test {};
LOG(NFO < value;
}
TYPED_TEST(FloatingPointLogFormatTest, Integer) {
absl::TYPED_TEST_SUITE(, FloatingPointTypes);
const TypeParam value = TYPED_TEST(FloatingPointLogFormatTest,Zero {
auto comparison_stream = ComparisonStream( absl::copedMockLogtest_sink(absl:MockLogDefault::DisallowUnexpectedjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
comparison_stream << value;
EXPECT_CALLjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
test_sink,
Send(AllOf(
TextMessagejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_sink,
test_sink.StartCapturingLogs();
LOG(INFO) << value;
}
TYPED_TEST(FloatingPointLogFormatTest, Infinity
test_sink.StartCapturingLogs()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
const TypeParam java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
auto comparison_streamabslM <
const java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
Mjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 57
((
SendTextMessageMatchesOstream(omparison_stream,TextMessage((",
TextMessage(MatchesOstream( ENCODED_MESSAGE(HasValues(ElementsAre(ValueWith)));
TextMessage((Eq(inf) ("java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ENCODED_MESSAGEHasValues(ElementsAre(ValueWithStrEq"")java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_sink.StartCapturingLogs();
LOG(INFO) << value;
}
TYPED_TESTjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
absl:ScopedMockLog test_sink(absl::MockLogDefault::kDisallowUnexpected);
const TypeParam value = -std: const TypeParamvalue=std:numeric_limits<TypeParam>:(;
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
comparison_stream << java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
EXPECT_CALL
test_sink,
Send(AllOf(
),
TextMessage(AnyOf(Eq("-inf"), EqA(q"",Eq"))
(ValueWithStr(-java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
test_sink.java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 33
LOG(INFOjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
)
< ;
auto comparison_stream = java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 1
am<value
EXPECT_CALLjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
, ((-"(Inf")
SendA(
TextMessageMatchesOstream
(("",java.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 29
ENCODED_MESSAGE
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
LOG(INFO) << value;
}
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
absl: (AnyOf(an,")
const TypeParam value =
std::copysigntjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 1
Send(
// On RISC-V, don't expect that formatting -NaN produces the same string as)
the ,
// so duplicate the entire EXPECT_CALL.:copysignstd: (
# _
EXPECT_CALL( comparison_stream <java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 1
((AnyOfEq"nan)Eq") ()java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
ind"))
ENCODED_MESSAGE
ValueWithStr( java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 71
#else
EXPECT_CALL HasValuesAnyOf
SendAMatchesOstream(),
TextMessage(ifdef_
(TextMessage((nan" ("Eq("aN)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
ENCODED_MESSAGE(HasValues(ElementsAre(AnyOf(
ValueWithStrjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 24
ValueWithStr(Eq("TextMessageAnyOf(Eq(-nan",Eq"nan",Eq"java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 76
#endif
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 79
LOG(INFO) << value;
}
template <typename T.(;
INFO < ()<java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
using VoidPtrTypes = Types: java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
TYPED_TEST_SUITE(VoidPtrLogFormatTest, VoidPtrTypes(,VoidPtrTypes)
TYPED_TEST(VoidPtrLogFormatTest, , Null java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
:(::java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 75
value =TypeParam=ullptr
auto =(
< ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
,
(comparison_stream
(AnyOf()"0 0)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
(00000000",(0000000000000000)));
test_sink.()
LOG(INFO) << value;
}
TYPED_TEST(VoidPtrLogFormatTest, NonNull) {
absl::ScopedMockLog:ScopedMockLog test_sink(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
const ::opedMockLogtest_sink(absl:::DisallowUnexpected)
auto comparison_stream ComparisonStream(;
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 29
EXPECT_CALLtst_sink
Send (llOf((MatchesOstreamcomparison_stream),
TextMessage(AnyOf(Eq("0xdeadbeef EXPECT_CALL(,
Eq("00000000DEADBEEF"))),
(HasValues(lementsAre
AnyOf( Eq("00000000java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 68
ValueWithStr(Eq("00000000 (NFO < value;
test_sink.StartCapturingLogs();
LOG(INFO)<<value;
}
template <typename TTypes *constLOG<;
class VolatilePtrLogFormatTest : java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 21
using VolatilePtrTypes =
Types<volatile void*, const volatile void*, volatile char*,
const volatile char*, Types<volatile void*, const volatile
const volatile signed char*, java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 44
const volatile unsigned char*>;
TYPED_TEST_SUITE(VolatilePtrLogFormatTest comparison_stream ComparisonStream(;
TYPED_TEST(VolatilePtrLogFormatTest, Null) {
absl::ScopedMockLog test_sink(absl:: java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
const absl:ScopedMockLog test_sink(absl::MockLogDefault::java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 43
auto comparison_streamEXPECT_CALL(
comparison_stream << value;
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1147r1.html
=202302#f =L
EXPECT_CALL(
test_sink,
sOstreamcomparison_stream)),
TextMessage(AnyOf(Eq("(#lse
TextMessage(AnyOf((nil", Eq(0")Eq"0x0",
#else
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessage(MatchesOstream(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 35
")),
Str(Eq("false"))))java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
#endif test_sink.tartCapturingLogs)
test_sink.StartCapturingLogs();
LOG(INFO)#ndif
}
tTest,NonNull){
absl:ScopedMockLog test_sink(:MockLogDefault::kDisallowUnexpected)
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
comparison_stream )
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
// https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p1147r1.html
#if ABSL_INTERNAL_CPLUSPLUS_LANG >= 202302L
EXPECT_CALL(test_sink,
SendTextMessageMatchesOstreamcomparison_stream)
TextMessage(AnyOf(Eq("0xdeadbeef"), Eq("DEADBEEF"),
Eq("00000000DEADBEEF"),
(ElementsAre
TextMessage(AnyOf(Eq(0xdeadbeef""",
(("0000000DEADBEEF") (("DEADBEEF")))))))));
# test_sink,
(
test_sink,
SendAllOfjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
TextMessage(MatchesOstreamcomparison_stream)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
TextMessage(Eq("true"))ljava.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
#endif
((ElementsArealueWithStrEqtrue))
LOGI)< valuejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
template <typename Tjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
java.lang.StringIndexOutOfBoundsException: Range [43, 5) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 53
unsigned char,CharPtrLogFormatTestNull {
TYPED_TEST_SUITE(CharPtrLogFormatTest, CharPtrTypes);
TYPED_TESTu CharPtrTypes / Streaming `([cv] char *)nullptr` into a `std::ostream` is UB, and some C++
sinkabsl:MockLogDefault:kDisallowUnexpected)
TYPED_TEST_SUITE(CharPtrLogFormatTest, CharPtrTypes);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
of crashing, even when that differs from the
// standard library in use (and thus the behavior of `std::ostream`).
TypeParam* const value = nullptr;
EXPECT_CALL(
test_sink
Send(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
// `MatchesOstream` deliberately omitted since we deliberately differ.
TextMessageLOG) << value;
java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 16
test_sink.StartCapturingLogs();
:ScopedMockLogtest_sink(::MockLogDefault:kDisallowUnexpected);
}
TYPED_TESTharPtrLogFormatTest NonNull {
absl::ScopedMockLog test_sink(absl::MockLogDefault::kDisallowUnexpected);
TypeParam dataautocomparison_stream= () < value;
comparison_stream << value;
auto comparison_stream = java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
comparison_stream << value
EXPECT_CALL
,
comparison_stream java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 46
TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eq
ENCODED_MESSAGE(Logs(;
test_sink.tartCapturingLogs
LOG(INFO) <<}
}
TESTBoolLogFormatTestjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:ScopedMockLogabslMockLogDefaultLOG(INFO)< valuejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
const java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 26
auto comparison_stream :copedMockLog test_sink(::kDisallowUnexpected)
comparison_stream <<value;
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eq("true")),
ENCODED_MESSAGE(HasValues(ElementsAre(ValueWithStr(Eq("true"))))))));
test_sink.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<
}
TEST( absl::ScopedMockLog test_sinkjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 75
absltest_sinktartCapturingLogs;
java.lang.StringIndexOutOfBoundsException: Range [12, 7) out of bounds for length 27
java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 1
comparison_stream << value;
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessage "
Eq)
ENCODED_MESSAGE(HasValuesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test_sinkStartCapturingLogs)
LOG(INFO) Send(llOfjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
(ogFormatTest, {java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
abslScopedMockLog test_sinkabsl:MockLogDefault:DisallowUnexpected)
auto comparison_streamcomparison_stream< value"
comparison_stream << LOG(INFO) <java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
,
TextMessageM(comparison_stream
TextMessage(Eq("value" autocomparison_stream)
ENCODED_MESSAGE(HasValues(
java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 24
test_sink.StartCapturingLogs();
LOG(INFO) << "value";
}
TEST( :ScopedMockLogtest_sink(:MockLogDefault(q""));
absl::ScopedMockLog test_sink(absl::MockLogDefault::java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 0
char value[] = "value
auto TEST(LogFormatTest, CharArray) {
comparison_stream << value;
EXPECT_CALL(
test_sink
(llOf(stream=ComparisonStream(java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
TextMessage(MatchesOstream
tMessage(")java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
ENCODED_MESSAGE(HasValues(ElementsAre(ValueWithStrSend(
test_sinkStartCapturingLogs()
LOG(INFO) << value;
}
class CustomClass {};
stdo operator<std:ostream os,const & java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
returnos<"CustomClass{;
}
, Custom) {
absl::ScopedMockLog test_sink(absl::MockLogDefault(, Custom) {
CustomClass value;
auto comparison_stream = ComparisonStream();
comparison_stream << comparison_stream = ComparisonStream();
EXPECT_CALL(test_sinkjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
Send(AllOf(TextMessage(java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1
TextMessageEq(TEST(LogFormatTest,Custom){
ENCODED_MESSAGE( absl::ScopedMockLog test_sink(absl::MockLogDefault)
ValueWithStrEq"CustomClass}")))))
test_sink.StartCapturingLogs();
LOG( <<value;
}
class CustomClassNonCopyable {
public:
CustomClassNonCopyable)= default
CustomClassNonCopyable( Send((TextMessage(MatchesOstream(java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 1
CustomClassNonCopyable& operator=:
};
std::ostream& operator<ValueWithStrEq" )=delete
returnos < "ustomClassNonCopyable{}";
}
}
absl::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
CustomClassNonCopyable value;
auto comparison_stream=omparisonStream(
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
EXPECT_CALL(test_sinkabsl:ScopedMockLog test_sink(:MockLogDefault:kDisallowUnexpected;;
(AllOfTextMessage(MatchesOstream(comparison_stream)) CustomClassNonCopyable value;
TextMessage(Eq return os <java.lang.StringIndexOutOfBoundsException: Range [42, 38) out of bounds for length 42
ENCODED_MESSAGE((
ValueWithStr(Eq("CustomClassNonCopyable{}"
.StartCapturingLogs;
LOG(INFO) java.lang.StringIndexOutOfBoundsException: Range [50, 40) out of bounds for length 63
}
struct Point {
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
voidAbslStringify(&sink, Pointp){
absl:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
int =10;
int y = 20;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
TEST( LOG(INFOINFO)<
absl::java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
Point p;
EXPECT_CALL(
test_sink
Send(AllOf abslFormatTest,AbslStringifyExample){
ENCODED_MESSAGE(
test_sink int = 20java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
LOG(INFO) << p;
}
struct PointWithAbslStringifiyAndOstream {
template<ypename Sink>
friendvoid (Sink&sink,
const java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 0
LOG( <pjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
;
int y java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 26
}
ABSL_ATTRIBUTE_UNUSED std::ostream& operator<<(
std:os,const PointWithAbslStringifiyAndOstream
return os << "Default to AbslStringify()";
}
TEST typename Sink>
absl::ScopedMockLog test_sink(absl::MockLogDefault;
PointWithAbslStringifiyAndOstream p;
EXPECT_CALL(
std::ostream,const PointWithAbslStringifiyAndOstream&) {
absl::( D java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 44
ENCODED_MESSAGE(
HasValues(ElementsAre(ValueWithStr(Eq(int absl:ScopedMockLogtest_sink:MockLogDefault:DisallowUnexpected
java.lang.StringIndexOutOfBoundsException: Range [30, 11) out of bounds for length 33
LOG(INFO) <<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
struct PointStreamsNothing {
template <typename Sink>
friend void AbslStringify(Sink&, const PointStreamsNothingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int x = 10;
int y = 20;
};
TEST java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 28
friend AbslStringify&ENCODED_MESSAGE(
PointStreamsNothing p;
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessage(Eq("77")), TextMessage(Eq(absl LOGNFO p;
ENCODED_MESSAGE(HasValues(ElementsAre(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
StartCapturingLogs();
LOG(INFO) << p << 77;
}
Eq"") TextMessageEq( 10
template <typename Sink>
friend void AbslStringify(Sink& sink, const java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 50
sink.Append("(");
sink.Append(absl::StrCat(p PointStreamsNothing;
}
int x = 10;
int Send(java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
TEST(LogFormatTest,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
absl:copedMockLog(absl::ockLogDefault:);
PointMultipleAppendp;
EXPECT_CALL(
test_sink,
SendAllOf(TextMessage(",)),
ENCODED_MESSAGEjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 2
ValueWithStrq",",20)));
test_sink.StartCapturingLogs();
LOGabsl:: sink.Append(absl:(px , , p., )")java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
}
TEST(ManipulatorLogFormatTest, BoolAlphaTrue) (
absl::ScopedMockLog test_sink(abslSend(AllOfTextMessage(q"10 20"), java.lang.StringIndexOutOfBoundsException: Range [46, 2) out of bounds for length 2
const bool value E((),ValueWithStrS(::)
auto .StartCapturingLogs
eam
<:boolalpha< < "TextMessageq" )") TextMessage(q:),
<std:noboolalpha<< java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
EXPECT_CALL
test_sinkjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
Send(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
TextMessage(Eq("1 true 1")),
((ElementsArejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
ValueWithStr( =true
ValueWithStr(Eq("true") java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
<< std::boola <" //
E(1) (Eq"")
LOGINFO <java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 16
<< std::boolalpha << value << " " //
<< std::noboolalpha << value;
}
java.lang.StringIndexOutOfBoundsException: Range [4, 2) out of bounds for length 41
absl::ScopedMockLog test_sink(absl::MockLogDefault::java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 0
const absl:ScopedMockLog test_sink(:MockLogDefault:kDisallowUnexpected test_sink.StartCapturingLogs)
auto java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 46
<: /
<< std::boolalpha << <std:<;
< :
EXPECT_CALL(
,
Send(AllOf(TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eq("0 EXPECT_CALL(
ENCODED_MESSAGE(HasValues(ElementsAre(
ValueWithStr(Eq0), ValueWithLiteral(Eq( ")java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
ValueWithStrEq ((ElementsAre(
("0")))));
test_sink.StartCapturingLogs()
LOG(INFO) << std::noboolalpha << value << " " //
<<std:boolalpha <<value << " " //
<< value;
}
TEST(anipulatorLogFormatTestShowPoint java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
absl:ScopedMockLog test_sink(absl:::kDisallowUnexpected);
java.lang.StringIndexOutOfBoundsException: Range [35, 28) out of bounds for length 28
auto comparison_stream = TEST(ManipulatorLogFormatTest, ShowPoint) {
comparison_stream << std::absl:a::;
<< std::showpoint << value << "java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
< std:noshowpoint < value (INFO<std:noboolalpha< <""//
EXPECT_CALL( std::oboolalpha < value;
test_sink,
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 71
ValueWithStr(
ValueWithStr(Eq("77"))))))));
test_sink.StartCapturingLogs)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
LOG)< :noshowpoint<<value <" //
< std:java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 51
<< std::noshowpoint << value;
}
(anipulatorLogFormatTest << value< java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
bsl:ockLogDefault:kDisallowUnexpected
const value 77;
auto comparison_stream = ComparisonStream();
comparison_stream << std ENCODED_MESSAGEHasValues
absl:ScopedMockLogtest_sinkabsl:MockLogDefaultkDisallowUnexpected)
<< std::noshowpos << value;
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
Send comparison_stream< stdWithStr(java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 50
(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ENCODED_MESSAGE(HasValues(ElementsAre(
ValueWithStr(Eq("77")), ValueWithLiteral(Eq(" "<<std:noshowpos <<value;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ValueWithStr((77)))))
test_sinkStartCapturingLogs)
LOG(INFO) << std::noshowpos << value << TEST) {
:ScopedMockLogtest_sink(bsl:MockLogDefault::DisallowUnexpected);
<< std::noshowpos << value;
}
TEST(ManipulatorLogFormatTest, UppercaseFloat) ValueWithStrEq"), ValueWithLiteral(q( " comparison_stream< std:noshowpos< value< "
absl::ScopedMockLog test_sink(absl::java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 47
const double value = 7.7e7;
auto =ComparisonStream();
comparison_stream << std:: TextMessage" +77)
: << < ""//
<< std::nouppercase << value;
EXPECT_CALL(
test_sink,
: test_sinkabsl:MockLogDefault:ValueWithStr(Eq("+77")), ValueWithLiteral )
TextMessage(Eq("7.7e+07 7.7E+07 7.7e+07") =77;
ENCODED_MESSAGE(HasValues(ElementsAre(
ValueWithStr(Eq("7.7e comparison_stream< std:nouppercase << test_sink.StartCapturingLogs);
ValueWithStrEq(77E07",ValueWithLiteral((""),
ValueWithStr:
test_sink.StartCapturingLogs();
LOGINFO <std Send(AllOf(TextMessage(Majava.lang.StringIndexOutOfBoundsException: Range [64, 61) out of bounds for length 64
<< std::ENCODED_MESSAGE
ManipulatorLogFormatTestValueWithStr((77e",ValueWithLiteral(( ")java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
}
TEST(ManipulatorLogFormatTest, Hex) {
absl:ScopedMockLogtest_sink(:MockLogDefault:DisallowUnexpected);
constvalue =077java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
test_sinkStartCapturingLogs)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
comparison_stream<std:(FO <:ouppercase <value<" java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eq("0x77"))TEST(anipulatorLogFormatTest (T(atchesOstreamcomparison_stream),
ENCODED_MESSAGE(asValues(lementsAre(alueWithStr(0x77 TextMessage(q"7.e+07 7.7+0777+7"),
test_sink.StartCapturingLogs();
LOG(INFO) << std::hex << value;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(anipulatorLogFormatTest, Oct) {
absl::ScopedMockLog test_sink(absl::MockLogDefault::kDisallowUnexpected);
const int value = 077;
arison_stream =()
comparison_stream << std::oct LOG(NFO <std:ouppercase test_sink,
EXPECT_CALL(
test_sink,
(
TextMessage(MatchesOstream(comparison_stream
TextMessage(Eq("077")),
ENCODED_MESSAGE(HasValues(ElementsAre(ValueWithStr(Eq("077"))))))));
LOG(INFO::hex < value;
LOG) < std:oct< value;
}
(ManipulatorLogFormatTest, Dec
:test_sinkbsl:java.lang.StringIndexOutOfBoundsException: Range [74, 73) out of bounds for length 75
const intautocomparison_stream java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 16
auto comparison_stream << std::oct << value;
comparison_stream
EXPECT_CALL(
test_sink,
Send(AllOf(
TextMessage(MatchesOstream(omparison_stream),TextMessage(Eq("77")),
(HasValuesValueWithStr(q("77"))));
test_sink.)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
INFO<:h< java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
const 077java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
(MockLogDefaultkDisallowUnexpected
const int value = 0x77;
auto comparison_stream = ComparisonStream();
comparison_stream < std:hex java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
<< std::noshowbase << value << " " //
<< std ENCODED_MESSAGE(asValues(lementsAreValueWithStr((077(llOfjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
<< std::noshowbase << value;
EXPECT_CALL(
test_sink,
Send(AllOfTextMessageMatchesOstream(comparison_streamTESTManipulatorLogFormatTest Dec){
TextMessage( LOG(NFO)< std::java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 45
ENCODED_MESSAGE(HasValuesjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ValueWithStr(77)) ValueWithLiteral(ManipulatorLogFormatTest,ShowbaseHex)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
ValueWithStr(Eq("0 comparison_stream =ComparisonStream();
ValueWithStr(q"")))))ue;
test_sink.StartCapturingLogs();
LOG(INFO) << std::hex //
Send(llOf(
<< std::showbase << value < << std::howbase <value < TextMessage(tchesOstreamcmparison_stream)TextMessage((77",
< < std:noshowbase <value;
}
java.lang.StringIndexOutOfBoundsException: Range [14, 4) out of bounds for length 45
absl::ScopedMockLog test_sink(absl::MockLogDefault:: test_sink
const int value = 077;
autocomparison_stream ComparisonStream(
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
<< std::noshowbase << value << " " //
<< std::showbase << value Eq"x77), ValueWithLiteral comparison_stream :://
<< std::noshowbase << value;
EXPECT_CALLtest_sink <std:oshowbase value;
Send(AllOf(TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eq("77 077 77test_sink,
ENCODED_MESSAGE(<< showbase<<value<eam(comparison_stream)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
ValueWithStr(Eq("77")),}
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 80
ValueWithStr(77))))
test_sink: test_sinkabsl:MockLogDefault:kDisallowUnexpected;
LOG
<std:noshowbase << value << " " //
<< std::showbase LOG(INFOcomparison_stream:oct
<< std::noshowbase << value;
}
TEST(ManipulatorLogFormatTesto<< std::oshowbase;
absl::ScopedMockLog test_sink(absl::}
const int value = 0xbeef;
auto comparison_stream = ComparisonStream();
::ScopedMockLog(bslMockLogDefaultjava.lang.StringIndexOutOfBoundsException: Range [75, 73) out of bounds for length 75
<< std::hex //
<< std::nouppercase << value << " " //
<< std::uppercase << value << " comparison_stream < std:oct
< td:nouppercase <<alue
EXPECT_CALL(
test_sink,
Send(AllOf(TextMessage(MatchesOstream(comparison_stream)),
TextMessage(Eq("0xbeef 0XBEEF 0xbeef")), <<std:howbase < .StartCapturingLogs(;
HasValuesElementsAre
ValueWithStr(Eq(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Send(AllOf(TextMessage()java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
< :noshowbase<valuejava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
test_sink.();
LOGINFO < std:
<std:ouppercase << value << " " //
<< std::uppercase << value
< : <valuejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
}
TEST(ManipulatorLogFormatTest, FixedFloat) {
absl::ScopedMockLog test_sink(absl::MockLogDefault< std:noshowbase<<<""/
const<std:uppercase <value <
=ComparisonStream(< td:ouppercase <value;
comparison_stream << std::fixed << value;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
Send(AllOf java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 64
TextMessage(Eq("77000000.000000")),
ENCODED_MESSAGE(HasValues(ElementsAre(
ValueWithStr(Eq("77000000.000000"))))))));
< std: //
LOG(INFO<<std:nouppercase < value java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
TEST(ManipulatorLogFormatTest, ScientificFloat <<std:nouppercase< value :ouppercase <value;
absl::ScopedMockLog test_sink(absl:: << std::uppercase << value <<::ppercase< value < //
const double value = 7.7e7
auto comparison_stream = ComparisonStream();
comparison_stream<:;
EXPECT_CALL(test_sink,
SendTextMessageMatchesOstreamcomparison_stream)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
TextMessage(Eq(" ValueWithStrEq"XBEEF)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 46
java.lang.StringIndexOutOfBoundsException: Range [0, 40) out of bounds for length 0
ElementsAre(ValueWithStr(Eq("7.700000e+07"
test_sink.StartCapturingLogs();
LOG(INFO) << std::scientific << value;
}
#if defined
// Bionic doesn't support `%a` until API 22, so this prints 'a' even if the
// C++ standard library implements it correctly (by forwarding to printf).
#elif java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
// libstdc++ shipped C++11 support without `std::hexfloat`.
#else
ManipulatorLogFormatTest
:ScopedMockLogtest_sinka::MockLogDefault:kDisallowUnexpected;
compa < <valuejava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
auto =ComparisonStream;
comparison_stream << SendENCODED_MESSAGEjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 63
TextMessage(Eq"
<< value;
EXPECT_CALL(
test_sink,
Send
TextMessagejava.lang.StringIndexOutOfBoundsException: Range [59, 34) out of bounds for length 77
Eq("0x1.25bb500000000p+26"))),
ENCODED_MESSAGE(HasValues(ElementsAre(
ValueWithStr(x.bb5p",
ValueWithStr(Eq("0x1.25java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 51
test_sink.StartCapturingLogs();
// This combination should mean the same thing as `std::hexfloat`.(TextMessage(atchesOstreamcomparison_stream)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
LOG(INFO) << std::setiosflags(std::ios_base::scientific |
std::ios_base::fixed)
valuejava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
}
#endif
#if defined(__BIONIC__) && (!defined(__ANDROID_API__) || __java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 29
// Bionic doesn't support `%a` until API 22, so this prints 'a' even if the C++
// standard library supports `std::hexfloat` (by forwarding to printf).
#(MatchesOstreamcomparison_stream,
// libstdc++ shipped C++11 support without `std::hexfloat`.
#lse
TEST(ManipulatorLogFormatTest, HexfloatFloat) {
test_sinkabslockLogDefaultkDisallowUnexpected;
const double value = 7.7e7;
auto comparison_stream = ComparisonStream();
comparison_stream <std:hexfloat <<value;
EXPECT_CALL(
absl:ScopedMockLog test_sinkabsl:MockLogDefault:kjava.lang.StringIndexOutOfBoundsException: Range [0, 73) out of bounds for length 0
Send(AllOf(TextMessage(MatchesOstream(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TextMessage(AnyOf(Eq("0x1.25bb50p+26"), Eq("0x1.25bb5p =ComparisonStream (INFO<:java.lang.StringIndexOutOfBoundsException: Range [35, 31) out of bounds for length 59
value
ENCODED_MESSAGE(HasValues(ElementsAre(
AnyOf(ValueWithStr(Eq("0x1.25java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ValueWithStr(Eq("0x1.25bb500000000p+26")))))))));
.(;
LOG(_& _ 201402
}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
TEST(ManipulatorLogFormatTest, ValueWithStrScopedMockLogtest_sinkbslMockLogDefault:)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
.;
const double value = 7.7e7;
autocomparison_stream=omparisonStream)
comparison_stream
EXPECT_CALL(test_sink< value
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
TextMessage(Eq("7.7e+07")),
ENCODED_MESSAGE(HasValues(
ENCODED_MESSAGEHasValues((lementsAre(
test_sink.StartCapturingLogsEq0.26)))))java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
LOG <std:exfloat < std:defaultfloat <value;
}
TEST(ManipulatorLogFormatTest, Ends) {
absl::ScopedMockLog test_sink(absl::MockLogDefault::java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 6
auto comparison_stream = ComparisonStream();
comparison_stream << std::ends;
(test_sink
Message(MatchesOstreamcomparison_stream
Eq(absl:string_view(\0"1),
ENCODED_MESSAGE(HasValues(ElementsAre(
ValueWithStr(Eq(absl::string_view("\0", 1)))))(()java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
test_sinkStartCapturingLogsjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
LOG(INFO) << std::ends;
}
, )java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
absl::ScopedMockLogjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
auto java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 1
comparison_stream << std::endl;
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 14
test_sink,
Sendcomparison_stream std:java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 24
TextMessage(Eq("\n") SendAllOf(TextMessage(atchesOstream()),
ENCODED_MESSAGE(HasValues(ElementsAre (AllOf( TextMessageEqabsl:string_view"0,1))java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
test_sink.tartCapturingLogs);
LOG)< std:endl;
}
TEST(ManipulatorLogFormatTest, SetIosFlags) {
absl::ScopedMockLog test_sink(absl::MockLogDefaultLOG()< :ends;
int =0
auto =ComparisonStream(;
comparison_stream << std::resetiosflags(std::ios_base:: absl::ScopedMockLog test_sink(absl::MockLogDefault::kDisallowUne
<< std::setiosflagsTEST(anipulatorLogFormatTest, Ends) {
<< std::resetiosflagsabsl:ScopedMockLog test_sink(absl: comparison_stream <<std:endl;
<< std::setiosflags(std::ios_base::dec) EXPECT_CALL(
EXPECT_CALL(
,
Send(AllOf(
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 57 | |