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/fxcrt/include/fx_string.h" | 7 #include "core/fxcrt/fx_string.h" |
8 #include "fpdfsdk/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 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 EXPECT_STREQ(L"208531", formatted_date.c_str()); | 153 EXPECT_STREQ(L"208531", formatted_date.c_str()); |
154 | 154 |
155 // 2095-02-01 | 155 // 2095-02-01 |
156 formatted_date = | 156 formatted_date = |
157 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"ddmmyy"); | 157 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"ddmmyy"); |
158 EXPECT_STREQ(L"010295", formatted_date.c_str()); | 158 EXPECT_STREQ(L"010295", formatted_date.c_str()); |
159 formatted_date = | 159 formatted_date = |
160 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"mmddyyyy"); | 160 CJS_PublicMethods::MakeFormatDate(3947356800000.0, L"mmddyyyy"); |
161 EXPECT_STREQ(L"02012095", formatted_date.c_str()); | 161 EXPECT_STREQ(L"02012095", formatted_date.c_str()); |
162 } | 162 } |
OLD | NEW |