Skip to content

Commit

Permalink
formatting changes and removed custom build and runner
Browse files Browse the repository at this point in the history
  • Loading branch information
msiddhu committed Jul 6, 2024
1 parent 869326e commit cd5161e
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 141 deletions.
6 changes: 3 additions & 3 deletions api/test/nostd/shared_ptr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ TEST(SharedPtrTest, MoveConstruction)
auto value = new int{123};
shared_ptr<int> ptr1{value};
shared_ptr<int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);
}

Expand All @@ -72,7 +72,7 @@ TEST(SharedPtrTest, MoveConstructionFromDifferentType)
auto value = new int{123};
shared_ptr<int> ptr1{value};
shared_ptr<const int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);
}

Expand All @@ -81,7 +81,7 @@ TEST(SharedPtrTest, MoveConstructionFromStdSharedPtr)
auto value = new int{123};
std::shared_ptr<int> ptr1{value};
shared_ptr<int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);
}

Expand Down
10 changes: 5 additions & 5 deletions api/test/nostd/unique_ptr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST(UniquePtrTest, MoveConstruction)
auto value = new int{123};
unique_ptr<int> ptr1{value};
unique_ptr<int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);
}

Expand All @@ -58,7 +58,7 @@ TEST(UniquePtrTest, MoveConstructionFromDifferentType)
auto value = new int{123};
unique_ptr<int> ptr1{value};
unique_ptr<const int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);
}

Expand All @@ -67,7 +67,7 @@ TEST(UniquePtrTest, MoveConstructionFromStdUniquePtr)
auto value = new int{123};
std::unique_ptr<int> ptr1{value};
unique_ptr<int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); //NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);
}

Expand All @@ -83,13 +83,13 @@ TEST(UniquePtrTest, StdUniquePtrConversionOperator)
auto value = new int{123};
unique_ptr<int> ptr1{value};
std::unique_ptr<int> ptr2{std::move(ptr1)};
EXPECT_EQ(ptr1.get(), nullptr); //NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);

value = new int{456};
ptr1 = unique_ptr<int>{value};
ptr2 = std::move(ptr1);
EXPECT_EQ(ptr1.get(), nullptr); //NOLINT
EXPECT_EQ(ptr1.get(), nullptr); // NOLINT
EXPECT_EQ(ptr2.get(), value);

ptr2 = nullptr;
Expand Down
73 changes: 0 additions & 73 deletions build_project.sh

This file was deleted.

33 changes: 21 additions & 12 deletions exporters/ostream/test/ostream_log_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ TEST(OstreamLogExporter, DefaultLogRecordToCout)
" severity_text : INVALID\n",
" body : \n",
" resource : \n",
" telemetry.sdk.version: ", OPENTELEMETRY_VERSION, "\n",
" telemetry.sdk.version: ",
OPENTELEMETRY_VERSION,
"\n",
" telemetry.sdk.name: opentelemetry\n",
" telemetry.sdk.language: cpp\n",
" attributes : \n",
Expand All @@ -114,12 +116,13 @@ TEST(OstreamLogExporter, DefaultLogRecordToCout)
" trace_flags : 00\n",
" scope : \n",
" name : otel-cpp\n",
" version : ", OPENTELEMETRY_SDK_VERSION, "\n",
" version : ",
OPENTELEMETRY_SDK_VERSION,
"\n",
" schema_url : https://opentelemetry.io/schemas/1.15.0\n",
" attributes : \n",
" scope.attr.key: scope.attr.value\n",
"}\n"
};
"}\n"};

std::string ostream_output = output.str();
for (auto &expected : expected_output)
Expand Down Expand Up @@ -169,8 +172,7 @@ TEST(OStreamLogRecordExporter, SimpleLogToCout)

std::vector<std::string> expected_output{
"{\n",
" timestamp : " +
std::to_string(now.time_since_epoch().count()) +
" timestamp : " + std::to_string(now.time_since_epoch().count()) +
"\n"
" observed_timestamp : " +
std::to_string(now.time_since_epoch().count()) +
Expand Down Expand Up @@ -250,7 +252,9 @@ TEST(OStreamLogRecordExporter, LogWithStringAttributesToCerr)
" severity_text : INVALID\n"
" body : \n",
" resource : \n",
" telemetry.sdk.version: ", OPENTELEMETRY_VERSION, "\n",
" telemetry.sdk.version: ",
OPENTELEMETRY_VERSION,
"\n",
" telemetry.sdk.name: opentelemetry\n",
" telemetry.sdk.language: cpp\n",
" service.name: unknown_service\n",
Expand All @@ -264,7 +268,9 @@ TEST(OStreamLogRecordExporter, LogWithStringAttributesToCerr)
" trace_flags : 00\n",
" scope : \n",
" name : otel-cpp\n",
" version : ", OPENTELEMETRY_SDK_VERSION, "\n",
" version : ",
OPENTELEMETRY_SDK_VERSION,
"\n",
" schema_url : https://opentelemetry.io/schemas/1.15.0\n",
" attributes : \n",
" scope.attr.key: scope.attr.value\n",
Expand Down Expand Up @@ -345,7 +351,9 @@ TEST(OStreamLogRecordExporter, LogWithVariantTypesToClog)
" trace_flags : 00\n",
" scope : \n",
" name : otel-cpp\n",
" version : ", OPENTELEMETRY_SDK_VERSION, "\n",
" version : ",
OPENTELEMETRY_SDK_VERSION,
"\n",
" schema_url : https://opentelemetry.io/schemas/1.15.0\n",
" attributes : \n",
" scope.attr.key: scope.attr.value\n",
Expand Down Expand Up @@ -400,8 +408,7 @@ TEST(OStreamLogRecordExporter, IntegrationTest)
// Compare actual vs expected outputs
std::vector<std::string> expected_output{
"{\n",
" timestamp : " +
std::to_string(now.time_since_epoch().count()) + "\n",
" timestamp : " + std::to_string(now.time_since_epoch().count()) + "\n",
" severity_num : 5\n"
" severity_text : DEBUG\n"
" body : Hello\n",
Expand All @@ -418,7 +425,9 @@ TEST(OStreamLogRecordExporter, IntegrationTest)
" trace_flags : 00\n",
" scope : \n",
" name : opentelelemtry_library\n",
" version : ", OPENTELEMETRY_SDK_VERSION, "\n",
" version : ",
OPENTELEMETRY_SDK_VERSION,
"\n",
" schema_url : https://opentelemetry.io/schemas/1.11.0\n",
" attributes : \n",
" scope.attr.key: 123\n",
Expand Down
2 changes: 1 addition & 1 deletion ext/src/dll/dllmain.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#include <windows.h> // NOLINT
#include <windows.h> // NOLINT

// Include API header files here for exporting
#include <opentelemetry/trace/provider.h>
Expand Down
38 changes: 0 additions & 38 deletions run-clang-tidy.sh

This file was deleted.

15 changes: 7 additions & 8 deletions sdk/src/metrics/data/circular_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,17 @@ struct AdaptingIntegerArrayCopy

} // namespace


void AdaptingIntegerArray::Increment(size_t index, uint64_t count)
{
while (true)
while (true)
{
const uint64_t result = nostd::visit(AdaptingIntegerArrayIncrement{index, count}, backing_);
if OPENTELEMETRY_LIKELY_CONDITION (result == 0)
{
const uint64_t result = nostd::visit(AdaptingIntegerArrayIncrement{index, count}, backing_);
if OPENTELEMETRY_LIKELY_CONDITION (result == 0)
{
return;
}
EnlargeToFit(result);
return;
}
EnlargeToFit(result);
}
}

uint64_t AdaptingIntegerArray::Get(size_t index) const
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/common/empty_attributes_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ TEST(EmptyAttributesTest, TestMemory)
{
auto attributes1 = opentelemetry::sdk::GetEmptyAttributes();
auto attributes2 = opentelemetry::sdk::GetEmptyAttributes();
EXPECT_EQ(memcmp(&attributes1, &attributes2, sizeof(attributes1)), 0); // NOLINT
EXPECT_EQ(memcmp(&attributes1, &attributes2, sizeof(attributes1)), 0); // NOLINT
}

0 comments on commit cd5161e

Please sign in to comment.