mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-08-02 06:46:04 +00:00
*: Run clang-format
Change-Id: Iaff1413cc51d9dec4ab97f335d31bf8614d42392 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/207412 Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com> Reviewed-by: Armando Montanez <amontanez@google.com> Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com> Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
53be9f9c67
commit
189b54cf33
|
@ -135,7 +135,9 @@ TEST(InlineDeque, Destruct_MultipleEntries) {
|
|||
Counter value;
|
||||
Counter::Reset();
|
||||
|
||||
{ InlineDeque<Counter, 128> deque(100, value); }
|
||||
{
|
||||
InlineDeque<Counter, 128> deque(100, value);
|
||||
}
|
||||
|
||||
EXPECT_EQ(Counter::created, 100);
|
||||
EXPECT_EQ(Counter::destroyed, 100);
|
||||
|
|
|
@ -148,7 +148,9 @@ TEST(InlineQueue, Destruct_MultipleEntries) {
|
|||
Counter value;
|
||||
Counter::Reset();
|
||||
|
||||
{ InlineQueue<Counter, 128> queue(100, value); }
|
||||
{
|
||||
InlineQueue<Counter, 128> queue(100, value);
|
||||
}
|
||||
|
||||
EXPECT_EQ(Counter::created, 100);
|
||||
EXPECT_EQ(Counter::destroyed, 100);
|
||||
|
|
|
@ -55,7 +55,9 @@ TEST(RawStorage, Construct_MoveOnly) {
|
|||
TEST(RawStorage, Destruct) {
|
||||
Counter::Reset();
|
||||
|
||||
{ [[maybe_unused]] internal::RawStorage<Counter, 128> destroyed; }
|
||||
{
|
||||
[[maybe_unused]] internal::RawStorage<Counter, 128> destroyed;
|
||||
}
|
||||
|
||||
EXPECT_EQ(Counter::created, 0);
|
||||
EXPECT_EQ(Counter::destroyed, 0);
|
||||
|
|
|
@ -166,7 +166,9 @@ TEST(Vector, Construct_AggregateStringView) {
|
|||
TEST(Vector, Destruct_ZeroLength) {
|
||||
Counter::Reset();
|
||||
|
||||
{ Vector<Counter, 0> destroyed; }
|
||||
{
|
||||
Vector<Counter, 0> destroyed;
|
||||
}
|
||||
EXPECT_EQ(Counter::created, 0);
|
||||
EXPECT_EQ(Counter::destroyed, 0);
|
||||
}
|
||||
|
@ -174,7 +176,9 @@ TEST(Vector, Destruct_ZeroLength) {
|
|||
TEST(Vector, Destruct_Empty) {
|
||||
Counter::Reset();
|
||||
|
||||
{ Vector<Counter, 128> destroyed; }
|
||||
{
|
||||
Vector<Counter, 128> destroyed;
|
||||
}
|
||||
EXPECT_EQ(Counter::created, 0);
|
||||
EXPECT_EQ(Counter::destroyed, 0);
|
||||
}
|
||||
|
@ -183,7 +187,9 @@ TEST(Vector, Destruct_MultpileEntries) {
|
|||
Counter value;
|
||||
Counter::Reset();
|
||||
|
||||
{ Vector<Counter, 128> destroyed(100, value); }
|
||||
{
|
||||
Vector<Counter, 128> destroyed(100, value);
|
||||
}
|
||||
|
||||
EXPECT_EQ(Counter::created, 100);
|
||||
EXPECT_EQ(Counter::destroyed, 100);
|
||||
|
|
|
@ -72,8 +72,8 @@ TEST(Glog, Fatal) {
|
|||
|
||||
TEST(Glog, ConditionalFatal) {
|
||||
conditional = false;
|
||||
LOG_IF(FATAL, conditional)
|
||||
<< "LOG_IF(FATAL, false) compiles but you should " << "not see this log";
|
||||
LOG_IF(FATAL, conditional) << "LOG_IF(FATAL, false) compiles but you should "
|
||||
<< "not see this log";
|
||||
}
|
||||
|
||||
TEST(Glog, Dfatal) {
|
||||
|
@ -94,8 +94,8 @@ TEST(Glog, ConditionalDfatal) {
|
|||
<< "PW_LOG_ERROR as NDEBUG is set";
|
||||
#endif // defined(NDEBUG)
|
||||
conditional = false;
|
||||
LOG_IF(DFATAL, conditional)
|
||||
<< "LOG_IF(DFATAL, false) compiles but you " << "should not see this log";
|
||||
LOG_IF(DFATAL, conditional) << "LOG_IF(DFATAL, false) compiles but you "
|
||||
<< "should not see this log";
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -496,7 +496,9 @@ TEST(StreamEncoder, WriteTooBig) {
|
|||
TEST(StreamEncoder, EmptyChildWrites) {
|
||||
std::byte encode_buffer[32];
|
||||
MemoryEncoder parent(encode_buffer);
|
||||
{ StreamEncoder child = parent.GetNestedEncoder(kTestProtoNestedField); }
|
||||
{
|
||||
StreamEncoder child = parent.GetNestedEncoder(kTestProtoNestedField);
|
||||
}
|
||||
ASSERT_EQ(parent.status(), OkStatus());
|
||||
const size_t kExpectedSize =
|
||||
varint::EncodedSize(
|
||||
|
|
|
@ -408,7 +408,9 @@ TEST(StreamDecoder, Decode_Nested_SeeksToNextFieldOnDestruction) {
|
|||
// Create a nested encoder for the nested field, but don't use it.
|
||||
EXPECT_EQ(decoder.Next(), OkStatus());
|
||||
ASSERT_EQ(*decoder.FieldNumber(), 6u);
|
||||
{ StreamDecoder nested = decoder.GetNestedDecoder(); }
|
||||
{
|
||||
StreamDecoder nested = decoder.GetNestedDecoder();
|
||||
}
|
||||
|
||||
// The root decoder should still advance to the next field after the nested
|
||||
// decoder is closed.
|
||||
|
@ -449,7 +451,9 @@ TEST(StreamDecoder,
|
|||
// Create a nested encoder for the nested field, but don't use it.
|
||||
EXPECT_EQ(decoder.Next(), OkStatus());
|
||||
ASSERT_EQ(*decoder.FieldNumber(), 6u);
|
||||
{ StreamDecoder nested = decoder.GetNestedDecoder(); }
|
||||
{
|
||||
StreamDecoder nested = decoder.GetNestedDecoder();
|
||||
}
|
||||
|
||||
// The root decoder should still advance to the next field after the nested
|
||||
// decoder is closed.
|
||||
|
@ -485,7 +489,9 @@ TEST(StreamDecoder, Decode_Nested_LastField) {
|
|||
// the root proto.
|
||||
EXPECT_EQ(decoder.Next(), OkStatus());
|
||||
ASSERT_EQ(*decoder.FieldNumber(), 6u);
|
||||
{ StreamDecoder nested = decoder.GetNestedDecoder(); }
|
||||
{
|
||||
StreamDecoder nested = decoder.GetNestedDecoder();
|
||||
}
|
||||
|
||||
// Root decoder should correctly terminate after the nested decoder is closed.
|
||||
EXPECT_EQ(decoder.Next(), Status::OutOfRange());
|
||||
|
|
|
@ -95,7 +95,11 @@ int main() {
|
|||
// Add five strings with either StringBuilder or std::snprintf.
|
||||
FORMAT_STRING("Three", "Three");
|
||||
FORMAT_STRING("point " << 1, "Three point %d", 1);
|
||||
FORMAT_STRING("four " << "one" << ' ' << 5u, "four %s %u", "one", 5u);
|
||||
FORMAT_STRING("four "
|
||||
<< "one" << ' ' << 5u,
|
||||
"four %s %u",
|
||||
"one",
|
||||
5u);
|
||||
FORMAT_STRING(string, "%s", string);
|
||||
FORMAT_STRING("-->" << string << string << string << ' ' << integer << ' '
|
||||
<< boolean << '!',
|
||||
|
@ -109,7 +113,11 @@ int main() {
|
|||
// Add five more strings with either StringBuilder or std::snprintf.
|
||||
FORMAT_STRING("Three", "Three");
|
||||
FORMAT_STRING("point " << 1, "Three point %d", 1);
|
||||
FORMAT_STRING("four " << "one" << ' ' << 5u, "four %s %u", "one", 5u);
|
||||
FORMAT_STRING("four "
|
||||
<< "one" << ' ' << 5u,
|
||||
"four %s %u",
|
||||
"one",
|
||||
5u);
|
||||
FORMAT_STRING(string, "%s", string);
|
||||
FORMAT_STRING(string << string << string << ' ' << integer << ' ' << boolean,
|
||||
"%s%s%s %d %d",
|
||||
|
|
|
@ -344,7 +344,9 @@ TEST(StringBuilder, StreamOutput_ExhaustBuffer_InOneString) {
|
|||
EXPECT_STREQ("01234567", sb.data()); // only can fit 8
|
||||
EXPECT_EQ(8u, sb.size());
|
||||
|
||||
sb << "no" << " more " << "room" << '?';
|
||||
sb << "no"
|
||||
<< " more "
|
||||
<< "room" << '?';
|
||||
EXPECT_STREQ("01234567", sb.data());
|
||||
}
|
||||
|
||||
|
|
|
@ -53,11 +53,15 @@ class TrivialDestructor {
|
|||
TEST(NoDestructor, ShouldNotCallDestructor) {
|
||||
bool destructor_called = false;
|
||||
|
||||
{ HasADestructor should_be_destroyed(destructor_called); }
|
||||
{
|
||||
HasADestructor should_be_destroyed(destructor_called);
|
||||
}
|
||||
|
||||
EXPECT_TRUE(destructor_called);
|
||||
|
||||
{ NoDestructor<HasADestructor> should_not_be_destroyed(destructor_called); }
|
||||
{
|
||||
NoDestructor<HasADestructor> should_not_be_destroyed(destructor_called);
|
||||
}
|
||||
|
||||
EXPECT_FALSE(destructor_called);
|
||||
}
|
||||
|
|
|
@ -430,7 +430,9 @@ TEST(TokenizedTrace, DisableAfterTrace) {
|
|||
TEST(TokenizedTrace, Scope) {
|
||||
TraceTestInterface test_interface;
|
||||
|
||||
{ PW_TRACE_SCOPE("scoped trace"); }
|
||||
{
|
||||
PW_TRACE_SCOPE("scoped trace");
|
||||
}
|
||||
|
||||
// Check results
|
||||
EXPECT_TRACE(test_interface, PW_TRACE_TYPE_DURATION_START, "scoped trace");
|
||||
|
@ -441,7 +443,9 @@ TEST(TokenizedTrace, Scope) {
|
|||
TEST(TokenizedTrace, ScopeGroup) {
|
||||
TraceTestInterface test_interface;
|
||||
|
||||
{ PW_TRACE_SCOPE("scoped group trace", "group"); }
|
||||
{
|
||||
PW_TRACE_SCOPE("scoped group trace", "group");
|
||||
}
|
||||
|
||||
// Check results
|
||||
EXPECT_TRACE(test_interface,
|
||||
|
|
Loading…
Reference in New Issue
Block a user