• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The PDFium Authors
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 "xfa/fxfa/parser/xfa_utils.h"
6 
7 #include <iterator>
8 
9 #include "testing/gtest/include/gtest/gtest.h"
10 
11 namespace {
12 
13 struct TestCase {
14   int input;
15   int expected_output;
16 };
17 
18 }  // namespace
19 
TEST(XfaUtilsImpTest,XFAMapRotation)20 TEST(XfaUtilsImpTest, XFAMapRotation) {
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));
28   }
29 }
30