version_test.cc 462 B

123456789101112131415161718
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. #include <gtest/gtest.h>
  4. #include <stdio.h>
  5. #include <string>
  6. #include "opentelemetry/version.h"
  7. TEST(VersionTest, Consistency)
  8. {
  9. char expected[10];
  10. snprintf(expected, sizeof(expected), "%d.%d.%d", OPENTELEMETRY_VERSION_MAJOR,
  11. OPENTELEMETRY_VERSION_MINOR, OPENTELEMETRY_VERSION_PATCH);
  12. std::string actual = OPENTELEMETRY_VERSION;
  13. EXPECT_EQ(actual, expected);
  14. }