Closed Bug 592748 Opened 14 years ago Closed 6 years ago

Code-coverage - AS3 Classes: Date

Categories

(Tamarin Graveyard :: Tools, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX
Q2 12 - Cyril

People

(Reporter: cpeyer, Unassigned)

References

Details

(Whiteboard: code-coverage)

Attachments

(2 files)

as of redux r5139:
                        covered      total        covered    total      
class                 functions  functions   pct     cond     cond   pct
Date                         58         61  95.1      163      191  85.3

Coverage of:
avmplus::Date::
avmplus::DateClass::
avmplus::DateObject::
Flags: flashplayer-qrb?
Assignee: nobody → dschaffe
Status: NEW → ASSIGNED
Target Milestone: --- → flash10.1.x-Salt
Flags: flashplayer-qrb? → flashplayer-qrb+
Target Milestone: flash10.1.x-Salt → flash10.2.x-Spicy
Assignee: dschaffe → brbaker
Target Milestone: flash10.2.x-Spicy → flash10.x - Serrano
Assignee: brbaker → dschaffe
From Date,DateClass,DateObject I get 84 functions and 417 conditions.  I think the difference is global functions within the Date.cpp file.  My results with patch are:
Class                                   Function Coverage           C/D Coverage
---------------------  ---------------------  ---------------------
avmplus::DateObject::      39 /    39 = 100%          8 /    10  =  80%
avmplus::DateClass::        6 /     6    = 100%         65 /    80 =  81%
avmplus::                           84 /    84 = 100%     345 /   417 =  82%
avmplus::Date::                14 /    14 = 100%       92 /   101 =  91%
---------------------  ---------------------  ---------------------
Total                                   84 /    84 = 100%     345 /   417 =  82%
Testcase to cover conditions in:
avmplus::MakeDay()
avmplus::MakeTime()
Attached patch new Date testsSplinter Review
merged Brent's constructor.as with new selftest for date.
Attachment #485116 - Flags: review?(brbaker)
Comment on attachment 485116 [details] [diff] [review]
new Date tests

// TEST: constructor with Date object
- Should test that the constructed date is actually the same as the passed in date instead of just !=NULL
d2->getTime()==d1->getTime()

// TEST: toStringInvalid
- Should verify that res==false, I assume this is the test that the formatIndex hits the default switch case which returns false.

// TEST: setDate negative values
- I don't see a code path in Date::setDate() that actually deals with negative values, this is just being passed into Date::MakeDay()

// TEST setDate NaN
- Do these overlap with as3/Date/constructor.as?

as3/Date/timezone.as
- The second test name is incorrect, it is not testing "test Date getTimezoneOffset" it is calling secondsUTC. Could this testcase also set the secondsUTC to some value that it is not already and confirm that it is set properly?
  * Currently d1 is already created with seconds==0, so maybe calling d1.secondsUTC=12, then you can test that d1.seconds==12 instead of just !=NULL, which it already was.
Attachment #485116 - Flags: review?(brbaker) → review-
Target Milestone: Q3 11 - Serrano → Q4 11 - Anza
Target Milestone: Q4 11 - Anza → Q1 12 - Brannan
Assignee: dschaffe → nobody
Target Milestone: Q1 12 - Brannan → Q2 12 - Cyril
No assignee, updating the status.
Status: ASSIGNED → NEW
No assignee, updating the status.
No assignee, updating the status.
No assignee, updating the status.
Tamarin isn't maintained anymore. WONTFIX remaining bugs.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: