blob: d1174c3a1b52c5b4cd03e0c97533eb207487f78d [file] [log] [blame]
// Protocol Buffers - Google's data interchange format
// Copyright 2023 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
//
#include <stdio.h>
#include <stdlib.h>
#include <gtest/gtest.h>
// Must be included last
#include "google/protobuf/port_def.inc"
namespace google {
namespace protobuf {
namespace internal {
int assume_var_for_test = 1;
TEST(PortTest, ProtobufAssume) {
PROTOBUF_ASSUME(assume_var_for_test == 1);
#ifdef GTEST_HAS_DEATH_TEST
EXPECT_DEBUG_DEATH(
PROTOBUF_ASSUME(assume_var_for_test == 2),
"port_test\\.cc:.*Assumption failed: 'assume_var_for_test == 2'");
#endif
}
} // namespace internal
} // namespace protobuf
} // namespace google