Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Orekit
Orekit
Commits
2cf96498
Commit
2cf96498
authored
Jul 08, 2020
by
Bryan Cazabonne
Browse files
Fixed test in AbsoluteDateTest class.
parent
d614d5f6
Pipeline
#535
passed with stage
in 20 minutes and 46 seconds
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
src/test/java/org/orekit/time/AbsoluteDateTest.java
View file @
2cf96498
...
...
@@ -1154,9 +1154,13 @@ public class AbsoluteDateTest {
check
(
AbsoluteDate
.
FUTURE_INFINITY
,
"5881610-07-11T23:59:59.999Z"
);
check
(
AbsoluteDate
.
PAST_INFINITY
,
"-5877490-03-03T00:00:00Z"
);
// test NaN
// \uFFFD is "�", the unicode replacement character
// that is what DecimalFormat uses instead of "NaN"
check
(
date
.
shiftedBy
(
Double
.
NaN
),
"2009-01-01T00:00:\uFFFDZ"
);
if
(
"1.8"
.
equals
(
System
.
getProperty
(
"java.specification.version"
)))
{
// \uFFFD is "�", the unicode replacement character
// that is what DecimalFormat uses instead of "NaN"
check
(
date
.
shiftedBy
(
Double
.
NaN
),
"2009-01-01T00:00:\uFFFDZ"
);
}
else
{
check
(
date
.
shiftedBy
(
Double
.
NaN
),
"2009-01-01T00:00:NaNZ"
);
}
}
private
void
check
(
final
AbsoluteDate
d
,
final
String
s
)
{
...
...
@@ -1260,9 +1264,13 @@ public class AbsoluteDateTest {
checkToString
(
AbsoluteDate
.
FUTURE_INFINITY
,
"5881610-07-11T23:59:59.999"
);
checkToString
(
AbsoluteDate
.
PAST_INFINITY
,
"-5877490-03-03T00:00:00.000"
);
// test NaN
// \uFFFD is "�", the unicode replacement character
// that is what DecimalFormat uses instead of "NaN"
checkToString
(
date
.
shiftedBy
(
Double
.
NaN
),
"2009-01-01T00:00:\uFFFD"
);
if
(
"1.8"
.
equals
(
System
.
getProperty
(
"java.specification.version"
)))
{
// \uFFFD is "�", the unicode replacement character
// that is what DecimalFormat used instead of "NaN" up to Java 8
checkToString
(
date
.
shiftedBy
(
Double
.
NaN
),
"2009-01-01T00:00:\uFFFD"
);
}
else
{
checkToString
(
date
.
shiftedBy
(
Double
.
NaN
),
"2009-01-01T00:00:NaN"
);
}
}
private
void
checkToString
(
final
AbsoluteDate
d
,
final
String
s
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment