Skip to content

Conversation

@matedabis
Copy link
Contributor

Branch coverage:
Before: 22/26
After: 26/26

JerryScript-DCO-1.0-Signed-off-by: Mate Dabis mdabis@inf.u-szeged.hu

}

// Checking behavior when values are unable to find
try{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space before {.


// Checking behavior when values are unable to find
try{
var a = [undefined,undefined,undefined,undefined,undefined];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space after ,.

try{
var a = [undefined,undefined,undefined,undefined,undefined];
for(var i=0; i<a.length; i++)
{delete a[i];}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spaces around =, <, moreover:

for (...) {
  //...
}

var a = [undefined,undefined,undefined,undefined,undefined];
for(var i=0; i<a.length; i++)
{delete a[i];}
a.indexOf("bar");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert (false);

for(var i=0; i<a.length; i++)
{delete a[i];}
a.indexOf("bar");
} catch (e) { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert (e instanceof TypeError)

} catch (e) { }

// Checking behavior when value is null
try{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

try {
var a = [0, 1, 2, 3, 4];
Object.defineProperty(a, '0', { 'get' : function () { throw new ReferenceError; } });
Array.prototype.indexOf.call(a, "bar")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert (false).

a.indexOf("bar");
} catch (e) { }

// Checking behavior when value is null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Checking behavior when this value is not coercible to object.

assert (e instanceof ReferenceError);
}

// checking behavior when unable to get the first element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking -> Checking

Branch coverage:
Before: 22/26
After: 26/26

JerryScript-DCO-1.0-Signed-off-by: Mate Dabis mdabis@inf.u-szeged.hu
@matedabis
Copy link
Contributor Author

Corrected

for (var i = 0; i < a.length; i++) {
delete a[i];
}
a.indexOf("bar");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the expected behavior!

Array.prototype.indexOf.call(a, function () { });
assert(false);
} catch (e) {
assert(e instanceof ReferenceError);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an assert for e.message

Array.prototype.indexOf.call(a, "bar");
assert(false);
} catch (e) {
assert(e instanceof ReferenceError);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

@akosthekiss
Copy link
Member

@matedabis Could you please give details similar to those requested at #2674 (comment) . I.e., which source file(s) or source file entity(-ies) (function(s)) are investigated, and what is the coverage result when all test suites of the project are executed (i.e., what is the actual baseline)?

@matedabis
Copy link
Contributor Author

@akosthekiss
The function we are testing: ecma_builtin_array_prototype_object_splice
The test file: /tests/jerry/array-prototype-splice.js
I dont know yet the result if all test suites are executed. By all test suites of the project do you mean all the tests in run-tests.py or all the .js files in the tests folder, or both?

Copy link
Member

@akosthekiss akosthekiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have this on hold until validity questions are sorted out at #2674 .

@matedabis
Copy link
Contributor Author

Closing pull request because the updated version of the coverage tester script wich runs --jerry-test-suite --test262 --unittests --jerry-tests tests, shows that the branches of this function are already covered so these changes are not needed.
The script:
https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants