The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/usage_config_test.cc
1 issues
Line: 62
// --------------------------------------------------------------------
TEST_F(FlagsUsageConfigTest, TestGetSetFlagsUsageConfig) {
EXPECT_TRUE(flags::GetUsageConfig().contains_helpshort_flags);
EXPECT_TRUE(flags::GetUsageConfig().contains_help_flags);
EXPECT_TRUE(flags::GetUsageConfig().contains_helppackage_flags);
EXPECT_TRUE(flags::GetUsageConfig().version_string);
EXPECT_TRUE(flags::GetUsageConfig().normalize_filename);
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/functional/bind_front_test.cc
1 issues
Line: 31
char CharAt(const char* s, size_t index) { return s[index]; }
TEST(BindTest, Basics) {
EXPECT_EQ('C', absl::bind_front(CharAt)("ABC", 2));
EXPECT_EQ('C', absl::bind_front(CharAt, "ABC")(2));
EXPECT_EQ('C', absl::bind_front(CharAt, "ABC", 2)());
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/functional/function_ref_test.cc
1 issues
Line: 30
void RunFun(FunctionRef<void()> f) { f(); }
TEST(FunctionRefTest, Lambda) {
bool ran = false;
RunFun([&] { ran = true; });
EXPECT_TRUE(ran);
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/hash/hash_testing.h
1 issues
Line: 166
Column: 18
CWE codes:
120
size_t index;
template <typename T>
std::string operator()(const T* value) const {
return absl::StrCat("#", index, "(", testing::PrintToString(*value), ")");
}
};
template <typename Eq>
struct EqVisitor {
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/hash/internal/print_hash_of.cc
1 issues
Line: 22
Column: 42
CWE codes:
190
Suggestion:
If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended)
// Prints the hash of argv[1].
int main(int argc, char** argv) {
if (argc < 2) return 1;
printf("%zu\n", absl::Hash<int>{}(std::atoi(argv[1]))); // NOLINT
}
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/hash/internal/wyhash_test.cc
1 issues
Line: 31
// Note: We don't account for endianness, so the values here are only correct if
// you're also running on a little endian platform.
TEST(WyhashTest, EmptyString) {
const std::string s = "";
EXPECT_EQ(
absl::hash_internal::Wyhash(s.c_str(), s.length(), kCurrentSeed, kSalt),
4808886099364463827);
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/memory/memory_exception_safety_test.cc
1 issues
Line: 31
constexpr int kLength = 50;
using Thrower = testing::ThrowingValue<testing::TypeSpec::kEverythingThrows>;
TEST(MakeUnique, CheckForLeaks) {
constexpr int kValue = 321;
auto tester = testing::MakeExceptionSafetyTester()
.WithInitialValue(Thrower(kValue))
// Ensures make_unique does not modify the input. The real
// test, though, is ConstructorTracker checking for leaks.
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/memory/memory_test.cc
1 issues
Line: 55
int DestructorVerifier::instance_count_ = 0;
TEST(WrapUniqueTest, WrapUnique) {
// Test that the unique_ptr is constructed properly by verifying that the
// destructor for its payload gets called at the proper time.
{
auto dv = new DestructorVerifier;
EXPECT_EQ(1, DestructorVerifier::instance_count());
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/meta/type_traits_test.cc
1 issues
Line: 72
ReturnType, BarIsCallableImpl, Class, T...>;
// NOTE: Test of detail type_traits_internal::is_detected.
TEST(IsDetectedTest, BasicUsage) {
EXPECT_TRUE((BarIsCallable<TypeWithBarFunction, StructA&, const StructB&,
StructC>::value));
EXPECT_TRUE(
(BarIsCallable<TypeWithBarFunction, StructA&, StructB&, StructC>::value));
EXPECT_TRUE(
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/numeric/bits_test.cc
1 issues
Line: 66
uint64_t{0x112345678ABCDEF0ULL});
}
TEST(Rotate, Right) {
static_assert(rotr(uint8_t{0x12}, 0) == uint8_t{0x12}, "");
static_assert(rotr(uint16_t{0x1234}, 0) == uint16_t{0x1234}, "");
static_assert(rotr(uint32_t{0x12345678UL}, 0) == uint32_t{0x12345678UL}, "");
static_assert(rotr(uint64_t{0x12345678ABCDEF01ULL}, 0) ==
uint64_t{0x12345678ABCDEF01ULL},
Reported by Cppcheck.