1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "xfa/fxfa/parser/xfa_utils.h"
7 
TEST(XfaUtilsImp,XFA_MapRotation)8 TEST(XfaUtilsImp, XFA_MapRotation) {
9   struct TestCase {
10     int input;
11     int expected_output;
12   } TestCases[] = {{-1000000, 80}, {-361, 359}, {-360, 0},  {-359, 1},
13                    {-91, 269},     {-90, 270},  {-89, 271}, {-1, 359},
14                    {0, 0},         {1, 1},      {89, 89},   {90, 90},
15                    {91, 91},       {359, 359},  {360, 0},   {361, 1},
16                    {100000, 280}};
17 
18   for (size_t i = 0; i < FX_ArraySize(TestCases); ++i) {
19     EXPECT_EQ(TestCases[i].expected_output,
20               XFA_MapRotation(TestCases[i].input));
21   }
22 }
23