chromium/base/allocator/partition_allocator/src/partition_alloc/partition_alloc_base/strings/stringprintf_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 <cerrno>
#include <cstddef>

#include "partition_alloc/build_config.h"
#include "partition_alloc/partition_alloc_base/strings/stringprintf.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace partition_alloc::internal::base {

#if PA_BUILDFLAG(IS_WIN) && defined(COMPONENT_BUILD) && \
    PA_BUILDFLAG(USE_PARTITION_ALLOC_AS_MALLOC)
// TODO(crbug.com/1429450): TruncatingStringPrintf() defined in
// allocator_base.dll allocates string from system allocator, but
// base_unittests deallocates the string by using PartitionAlloc. This causes
// crashes.
#define MAYBE_PartitionAllocStringPrintfTest
#else
#define MAYBE_PartitionAllocStringPrintfTest
#endif

TEST(MAYBE_PartitionAllocStringPrintfTest, TruncatingStringPrintfEmpty) {}

TEST(MAYBE_PartitionAllocStringPrintfTest, TruncatingStringPrintfMisc) {}

// Test that TruncatingStringPrintf truncates too long result.
// The original TruncatingStringPrintf does not truncate. Instead, it allocates
// memory and returns an entire result.
TEST(MAYBE_PartitionAllocStringPrintfTest,
     TruncatingStringPrintfTruncatesResult) {}

// Test that TruncatingStringPrintf does not change errno.
TEST(MAYBE_PartitionAllocStringPrintfTest, TruncatingStringPrintfErrno) {}

}  // namespace partition_alloc::internal::base