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