chromium/third_party/blink/renderer/platform/wtf/decimal_test.cc

/*
 * Copyright (C) 2012 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include "third_party/blink/renderer/platform/wtf/decimal.h"

#include <cfloat>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "third_party/blink/renderer/platform/wtf/math_extras.h"

namespace blink {

// Simulate core/html/forms/StepRange
class DecimalStepRange {};

class DecimalTest : public testing::Test {};

// FIXME: We should use expectedSign without "Decimal::", however, g++ causes
// undefined references for DecimalTest::Positive and Negative.
#define EXPECT_DECIMAL_ENCODED_DATA_EQ(expectedCoefficient, expectedExponent, \
                                       expectedSign, decimal)

TEST_F(DecimalTest, Abs) {}

TEST_F(DecimalTest, AbsBigExponent) {}

TEST_F(DecimalTest, AbsSmallExponent) {}

TEST_F(DecimalTest, AbsSpecialValues) {}

TEST_F(DecimalTest, Add) {}

TEST_F(DecimalTest, AddBigExponent) {}

TEST_F(DecimalTest, AddSmallExponent) {}

TEST_F(DecimalTest, AddSpecialValues) {}

TEST_F(DecimalTest, Ceil) {}

TEST_F(DecimalTest, CeilingBigExponent) {}

TEST_F(DecimalTest, CeilingSmallExponent) {}

TEST_F(DecimalTest, CeilingSpecialValues) {}

TEST_F(DecimalTest, Compare) {}

TEST_F(DecimalTest, CompareBigExponent) {}

TEST_F(DecimalTest, CompareSmallExponent) {}

TEST_F(DecimalTest, CompareSpecialValues) {}

TEST_F(DecimalTest, Constructor) {}

TEST_F(DecimalTest, Division) {}

TEST_F(DecimalTest, DivisionBigExponent) {}

TEST_F(DecimalTest, DivisionSmallExponent) {}

TEST_F(DecimalTest, DivisionSpecialValues) {}

TEST_F(DecimalTest, EncodedData) {}

TEST_F(DecimalTest, Floor) {}

TEST_F(DecimalTest, FloorBigExponent) {}

TEST_F(DecimalTest, FloorSmallExponent) {}

TEST_F(DecimalTest, FloorSpecialValues) {}

TEST_F(DecimalTest, FromDouble) {}

TEST_F(DecimalTest, FromDoubleLimits) {}

TEST_F(DecimalTest, FromInt32) {}

TEST_F(DecimalTest, FromString) {}

// These strings are look like proper number, but we don't accept them.
TEST_F(DecimalTest, FromStringLikeNumber) {}

// fromString doesn't support infinity and NaN.
TEST_F(DecimalTest, FromStringSpecialValues) {}

TEST_F(DecimalTest, fromStringTruncated) {}

TEST_F(DecimalTest, Multiplication) {}

TEST_F(DecimalTest, MultiplicationBigExponent) {}

TEST_F(DecimalTest, MultiplicationSmallExponent) {}

TEST_F(DecimalTest, MultiplicationSpecialValues) {}

TEST_F(DecimalTest, Negate) {}

TEST_F(DecimalTest, NegateBigExponent) {}

TEST_F(DecimalTest, NegateSmallExponent) {}

TEST_F(DecimalTest, NegateSpecialValues) {}

TEST_F(DecimalTest, Predicates) {}

TEST_F(DecimalTest, PredicatesSpecialValues) {}

// web_tests/fast/forms/number/number-stepup-stepdown-from-renderer
TEST_F(DecimalTest, RealWorldExampleNumberStepUpStepDownFromRenderer) {}

TEST_F(DecimalTest, RealWorldExampleNumberStepUpStepDownFromRendererRounding) {}

TEST_F(DecimalTest, RealWorldExampleRangeStepUpStepDown) {}

TEST_F(DecimalTest, Remainder) {}

TEST_F(DecimalTest, RemainderBigExponent) {}

TEST_F(DecimalTest, RemainderSmallExponent) {}

TEST_F(DecimalTest, RemainderSpecialValues) {}

TEST_F(DecimalTest, Round) {}

TEST_F(DecimalTest, RoundSpecialValues) {}

TEST_F(DecimalTest, Subtract) {}

TEST_F(DecimalTest, SubtractBigExponent) {}

TEST_F(DecimalTest, SubtractSmallExponent) {}

TEST_F(DecimalTest, SubtractSpecialValues) {}

TEST_F(DecimalTest, ToDouble) {}

TEST_F(DecimalTest, ToDoubleSpecialValues) {}

TEST_F(DecimalTest, ToString) {}

TEST_F(DecimalTest, ToStringSpecialValues) {}

}  // namespace blink