OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "core/include/fxcrt/fx_string.h" | 7 #include "core/include/fxcrt/fx_string.h" |
8 #include "fpdfsdk/src/javascript/PublicMethods.h" | 8 #include "fpdfsdk/javascript/PublicMethods.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "testing/js_embedder_test.h" | 10 #include "testing/js_embedder_test.h" |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 double RoundDownDate(double date) { | 14 double RoundDownDate(double date) { |
15 return date - fmod(date, 86400000); | 15 return date - fmod(date, 86400000); |
16 } | 16 } |
17 | 17 |
18 } // namespace | 18 } // namespace |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 EXPECT_STREQ(L"208531", formatted_date); | 159 EXPECT_STREQ(L"208531", formatted_date); |
160 | 160 |
161 // 2095-02-01 | 161 // 2095-02-01 |
162 formatted_date = | 162 formatted_date = |
163 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"ddmmyy"); | 163 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"ddmmyy"); |
164 EXPECT_STREQ(L"010295", formatted_date); | 164 EXPECT_STREQ(L"010295", formatted_date); |
165 formatted_date = | 165 formatted_date = |
166 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"mmddyyyy"); | 166 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"mmddyyyy"); |
167 EXPECT_STREQ(L"02012095", formatted_date); | 167 EXPECT_STREQ(L"02012095", formatted_date); |
168 } | 168 } |
OLD | NEW |