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 "xfa/fxfa/parser/xfa_utils.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
TEST(XfaUtilsImpTest,XFA_MapRotation)9 TEST(XfaUtilsImpTest, XFA_MapRotation) {
10 struct TestCase {
11 int input;
12 int expected_output;
13 } TestCases[] = {{-1000000, 80}, {-361, 359}, {-360, 0}, {-359, 1},
14 {-91, 269}, {-90, 270}, {-89, 271}, {-1, 359},
15 {0, 0}, {1, 1}, {89, 89}, {90, 90},
16 {91, 91}, {359, 359}, {360, 0}, {361, 1},
17 {100000, 280}};
18
19 for (size_t i = 0; i < FX_ArraySize(TestCases); ++i) {
20 EXPECT_EQ(TestCases[i].expected_output,
21 XFA_MapRotation(TestCases[i].input));
22 }
23 }
24