blob: 48f448ddbe1b3ec26344999bb14c3c174e27f75a [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2014 The PDFium Authors
Dan Sinclair1770c022016-03-14 14:14:16 -04002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Dan Sinclair1770c022016-03-14 14:14:16 -04005#include "xfa/fxfa/parser/xfa_utils.h"
6
Lei Zhang3111d402022-04-18 22:24:07 +00007#include <iterator>
8
Tom Sepez9a8a9652017-03-03 15:03:59 -08009#include "testing/gtest/include/gtest/gtest.h"
Tom Sepez9a8a9652017-03-03 15:03:59 -080010
Tom Sepezd8694462024-06-10 22:31:31 +000011namespace {
Dan Sinclair1770c022016-03-14 14:14:16 -040012
Tom Sepezd8694462024-06-10 22:31:31 +000013struct TestCase {
14 int input;
15 int expected_output;
16};
17
18} // namespace
19
20TEST(XfaUtilsImpTest, XFA_MapRotation) {
21 static const TestCase kTestCases[] = {
22 {-1000000, 80}, {-361, 359}, {-360, 0}, {-359, 1}, {-91, 269},
23 {-90, 270}, {-89, 271}, {-1, 359}, {0, 0}, {1, 1},
24 {89, 89}, {90, 90}, {91, 91}, {359, 359}, {360, 0},
25 {361, 1}, {100000, 280}};
26 for (const TestCase& item : kTestCases) {
27 EXPECT_EQ(item.expected_output, XFA_MapRotation(item.input));
Dan Sinclair1770c022016-03-14 14:14:16 -040028 }
29}