You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was found thanks to performing mutation analysis with Mutator (http://ortask.com/mutator/) on test suite homog-test.js.
The constructor for Homog (homog.js) seems to support 2D systems by accepting a 2D rotation matrix and 2D vector as parameters. However, the resulting matrix is not initialized properly.
In particular, I added the following test to homog-test.js as suggested by mutation analysis:
it('creates matrix with good values for 2D systems', function () {
var Rz = new Matrix(2, 2);
var Trans = new Vector(0,0)
var H1 = new Homog(Rz, Trans);
H1.m.should.eql([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]);
});
but get the following error when running the tests:
Inspecting the constructor for Homog, it seems that the following loop only sets the first four elements of the matrix (as that is the limit when passing in a 2x2 rotation matrix), but leaves elements (0,2) and (1,2) uninitialized (i.e. as null):
// fill in the rotation part
for (var r = 0; r < rot.rows; ++r) {
for (var c = 0; c < rot.cols; ++c) {
H.set(r, c, rot.get(r, c));
}
}
The text was updated successfully, but these errors were encountered:
omgm
changed the title
Creating homogenous matrix does not support 2D systems correctly
Elements of homogeneous matrices are not initialized when using 2D systems
Sep 2, 2014
omgm
added a commit
to omgm/vektor
that referenced
this issue
Sep 4, 2014
Mutation analysis was performed on homog-test.js with Mutator (http://ortask.com/mutator/). I improved the test suite's mutation score from 0.63 to 0.8.
In order to get to raise the quality of the test suite to 1.0, the following issue needs to be resolved: rockbot#22
omgm
linked a pull request
Sep 4, 2014
that will
close
this issue
This issue was found thanks to performing mutation analysis with Mutator (http://ortask.com/mutator/) on test suite homog-test.js.
The constructor for Homog (homog.js) seems to support 2D systems by accepting a 2D rotation matrix and 2D vector as parameters. However, the resulting matrix is not initialized properly.
In particular, I added the following test to homog-test.js as suggested by mutation analysis:
but get the following error when running the tests:
Inspecting the constructor for Homog, it seems that the following loop only sets the first four elements of the matrix (as that is the limit when passing in a 2x2 rotation matrix), but leaves elements (0,2) and (1,2) uninitialized (i.e. as null):
The text was updated successfully, but these errors were encountered: