chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/strings/safe_sprintf_pa_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstring>
#include <limits>
#include <memory>
#include <vector>

#include "partition_alloc/build_config.h"
#include "partition_alloc/partition_alloc_base/check.h"
#include "partition_alloc/partition_alloc_base/strings/safe_sprintf.h"
#include "partition_alloc/partition_alloc_config.h"
#include "testing/gtest/include/gtest/gtest.h"

// Death tests on Android are currently very flaky. No need to add more flaky
// tests, as they just make it hard to spot real problems.
// TODO(markus): See if the restrictions on Android can eventually be lifted.
#if defined(GTEST_HAS_DEATH_TEST) && !PA_BUILDFLAG(IS_ANDROID)
#define ALLOW_DEATH_TEST
#endif

namespace partition_alloc::internal::base::strings {

TEST(SafeSPrintfTestPA, Empty) {}

TEST(SafeSPrintfTestPA, NoArguments) {}

TEST(SafeSPrintfTestPA, OneArgument) {}

TEST(SafeSPrintfTestPA, MissingArg) {}

TEST(SafeSPrintfTestPA, ASANFriendlyBufferTest) {}

TEST(SafeSPrintfTestPA, NArgs) {}

TEST(SafeSPrintfTestPA, DataTypes) {}

namespace {
void PrintLongString(char* buf, size_t sz) {}

#if !defined(NDEBUG)
class ScopedSafeSPrintfSSizeMaxSetter {};
#endif

}  // anonymous namespace

TEST(SafeSPrintfTestPA, Truncation) {}

TEST(SafeSPrintfTestPA, Padding) {}

TEST(SafeSPrintfTestPA, EmbeddedNul) {}

TEST(SafeSPrintfTestPA, EmitNULL) {}

TEST(SafeSPrintfTestPA, EmitNullptr) {}

TEST(SafeSPrintfTestPA, PointerSize) {}

}  // namespace partition_alloc::internal::base::strings