The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/hash_policy_traits_test.cc
1 issues
Line: 100
MockFunction<void(void*, Slot*, Slot*)> transfer;
};
TEST_F(Test, construct) {
EXPECT_CALL(construct, Call(&alloc, &a, 53));
hash_policy_traits<PolicyWithoutOptionalOps>::construct(&alloc, &a, 53);
}
TEST_F(Test, destroy) {
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc
1 issues
Line: 78
return info;
}
TEST(HashtablezInfoTest, PrepareForSampling) {
absl::Time test_start = absl::Now();
HashtablezInfo info;
absl::MutexLock l(&info.init_mu);
info.PrepareForSampling();
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/layout.h
1 issues
Line: 651
Column: 29
CWE codes:
120
const size_t sizes[] = {SizeOf<ElementType<OffsetSeq>>::value...};
const std::string types[] = {
adl_barrier::TypeName<ElementType<OffsetSeq>>()...};
std::string res = absl::StrCat("@0", types[0], "(", sizes[0], ")");
for (size_t i = 0; i != NumOffsets - 1; ++i) {
absl::StrAppend(&res, "[", size_[i], "]; @", offsets[i + 1], types[i + 1],
"(", sizes[i + 1], ")");
}
// NumSizes is a constant that may be zero. Some compilers cannot see that
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/node_hash_policy_test.cc
1 issues
Line: 53
int* a = &n;
};
TEST_F(NodeTest, ConstructDestroy) {
NodePolicy::construct(&alloc, &a, 42);
EXPECT_THAT(a, Pointee(42));
NodePolicy::destroy(&alloc, &a);
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set.cc
1 issues
Line: 54
Column: 8
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
Group{pos}.ConvertSpecialToEmptyAndFullToDeleted(pos);
}
// Copy the cloned ctrl bytes.
std::memcpy(ctrl + capacity + 1, ctrl, Group::kWidth);
ctrl[capacity] = kSentinel;
}
} // namespace container_internal
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set_allocator_test.cc
1 issues
Line: 194
using NoPropagateOnCopy = PropagateTest<kPropagateOnMove | kPropagateOnSwap>;
using NoPropagateOnMove = PropagateTest<kPropagateOnCopy | kPropagateOnSwap>;
TEST_F(PropagateOnAll, Empty) { EXPECT_EQ(0, a1.num_allocs()); }
TEST_F(PropagateOnAll, InsertAllocates) {
auto it = t1.insert(0).first;
EXPECT_EQ(1, a1.num_allocs());
EXPECT_EQ(0, it->num_moves());
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/raw_hash_set_test.cc
1 issues
Line: 61
using ::testing::Pair;
using ::testing::UnorderedElementsAre;
TEST(Util, NormalizeCapacity) {
EXPECT_EQ(1, NormalizeCapacity(0));
EXPECT_EQ(1, NormalizeCapacity(1));
EXPECT_EQ(3, NormalizeCapacity(2));
EXPECT_EQ(3, NormalizeCapacity(3));
EXPECT_EQ(7, NormalizeCapacity(4));
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/internal/test_instance_tracker_test.cc
1 issues
Line: 26
using absl::test_internal::InstanceTracker;
using absl::test_internal::MovableOnlyInstance;
TEST(TestInstanceTracker, CopyableMovable) {
InstanceTracker tracker;
CopyableMovableInstance src(1);
EXPECT_EQ(1, src.value()) << src;
CopyableMovableInstance copy(src);
CopyableMovableInstance move(std::move(src));
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/node_hash_map_test.cc
1 issues
Line: 47
using M = absl::node_hash_map<std::string, Tracked<int>>;
TEST(NodeHashMap, Emplace) {
M m;
Tracked<int> t(53);
m.emplace("a", t);
ASSERT_EQ(0, t.num_moves());
ASSERT_EQ(1, t.num_copies());
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/container/node_hash_set_test.cc
1 issues
Line: 45
INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashSet, MembersTest, SetTypes);
INSTANTIATE_TYPED_TEST_SUITE_P(NodeHashSet, ModifiersTest, SetTypes);
TEST(NodeHashSet, MoveableNotCopyableCompiles) {
node_hash_set<std::unique_ptr<void*>> t;
node_hash_set<std::unique_ptr<void*>> u;
u = std::move(t);
}
Reported by Cppcheck.