Skip to content
This repository was archived by the owner on Oct 2, 2024. It is now read-only.
This repository was archived by the owner on Oct 2, 2024. It is now read-only.

logical errors in all time_difference test content #1

@drothenberg

Description

@drothenberg

Test oval:org.mitre.oval.test:tst:1087 (in Windows oval-def_time_difference_function.xml) compares object oval:org.mitre.oval.test:obj:405 to state oval:org.mitre.oval.test:ste:96.

Object oval:org.mitre.oval.test:obj:405 is the difference between the dates February 2, 2004 and April 4, 2009. That is 1884 days (including 2 leap days!), or 162777600 seconds. However, oval:org.mitre.oval.test:ste:96 is defined as 162774000 seconds, which is one hour short.

Therefore, this test should evaluate to false, or more likely the state value should be changed to 162777600.

There are also issues with oval:org.mitre.oval.test:tst:427 and oval:org.mitre.oval.test:tst:1066. Both of these tests measure the time difference between Jan 1, 1975 and May 5, 1975, which is 120 days, or 10368000 secs. Yet both states (oval:org.mitre.oval.test:ste:783 and oval:org.mitre.oval.test:ste:536 -- by the way, why are there two different states representing the same result?) are set to 10364400. Again, one hour short.

I am pretty much certain that there are analogous problems with the time difference test XML documents for Linux, Solaris and Mac OS X, because the automated jOVAL time_difference tests are failing for those platforms as well!

Note that both of these time spans involve changes from winter to spring, and both are one hour short. I believe the culprit is an unintentional use of daylight savings time in ovaldi's time_difference computation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions