Skip to content

Commit

Permalink
[Trace SDK] Implement builders (open-telemetry#1393)
Browse files Browse the repository at this point in the history
Unit test cleanup
  • Loading branch information
marcalff committed Jul 12, 2022
1 parent 2ad543a commit 9077623
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
16 changes: 8 additions & 8 deletions exporters/otlp/test/otlp_grpc_exporter_factory_test.cc
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

/*
Cripple the build environment on purpose.
This is to make sure that if protobuf headers
are included by OtlpGrpcExporterFactory,
even indirectly, the build will fail.
*/
#define PROTOBUF_VERSION 6666666

#include <gtest/gtest.h>

#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h"
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h"

/*
Make sure OtlpGrpcExporterFactory does not require,
even indirectly, protobuf headers.
*/
#ifdef GOOGLE_PROTOBUF_VERSION
# error "protobuf should not be included"
#endif

OPENTELEMETRY_BEGIN_NAMESPACE
namespace exporter
{
Expand Down
22 changes: 11 additions & 11 deletions exporters/otlp/test/otlp_http_exporter_factory_test.cc
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

/*
Cripple the build environment on purpose.
This is to make sure that if protobuf headers
are included by OtlpHttpExporterFactory,
even indirectly, the build will fail.
*/
#define PROTOBUF_VERSION 6666666

#include <gtest/gtest.h>

#include "opentelemetry/exporters/otlp/otlp_http_exporter_factory.h"
#include "opentelemetry/exporters/otlp/otlp_http_exporter_options.h"

/*
Make sure OtlpHttpExporterFactory does not leak nlohmann/json.hpp,
even indirectly.
Make sure OtlpHttpExporterFactory does not require,
even indirectly, nlohmann/json headers.
*/
#ifdef NLOHMANN_JSON_VERSION_MAJOR
# error "OtlpHttpExporterFactory should not expose nlohmann/json.hpp"
# error "nlohmann/json should not be included"
#endif /* NLOHMANN_JSON_VERSION_MAJOR */

/*
Make sure OtlpHttpExporterFactory does not require,
even indirectly, protobuf headers.
*/
#ifdef GOOGLE_PROTOBUF_VERSION
# error "protobuf should not be included"
#endif

OPENTELEMETRY_BEGIN_NAMESPACE
namespace exporter
{
Expand Down

0 comments on commit 9077623

Please sign in to comment.