Closed GoogleCodeExporter closed 9 years ago
Should i create a test for class constructor? And if i should, how can i access
to the to the object's fields not from class methods?
Original comment by justente...@gmail.com
on 23 Oct 2012 at 7:10
Yes, you should - use other methods like double to extract the properties. But
this test is not critical as in the tests for other methods you will call the
constructor multiple times
Original comment by heartofm...@gmail.com
on 23 Oct 2012 at 7:13
Hyperplane methods double() and parameters() seem to duplicate each other.
Original comment by justente...@gmail.com
on 23 Oct 2012 at 8:30
I merged with trunk, and after that some changes in lib/+modgen appeared. Is it
normal? should i commit them?
Original comment by justente...@gmail.com
on 26 Oct 2012 at 11:35
Yes, these changes result from merge, without committing them the merge is
useless because it just changes your local working copy. Just make sure that
you merged with the working copy that doesn't contain any changes.
Original comment by heartofm...@gmail.com
on 26 Oct 2012 at 1:05
I've discovered, that hyperplane(V,C) constructor throws an error, when you
give it V in R^(n x m) and vector C in R^(m x 1). But it works properly, when
C is in R^(1 x m). Is it a bug?
The description in hyperplane constructor:
HA = HYPERPLANE(V, C) If V is matrix in R^(n x m) and C is array of numbers of
length m or 1, then m hyperplane structures are created and returned in array
HA.
The text of error, when m = 7:
ELL_HYPERPLANE: second argument must be a scalar, or an array of 7 scalars.
Original comment by justente...@gmail.com
on 26 Oct 2012 at 4:15
It is not a bug - hyperplane constructor is designed to create an array of
hyperplane objects. For m=1 a single object is created, for m>1 - an array of
objects. So it is logical that hyperplane makes sure that C and V have the same
size (m) along the second dimension. This size represents a number of objects
to create.
Btw - you should have changed a status of the ticket to "Started" based on our
workflow policy.
Original comment by heartofm...@gmail.com
on 26 Oct 2012 at 4:34
Original comment by justente...@gmail.com
on 26 Oct 2012 at 4:36
I have some questions. First is should i write a negative tests for all
possible exceptions? The second is about testing 'display' and the same
methods. We need just run this method in our test an nothing else, am i right?
Original comment by justente...@gmail.com
on 28 Oct 2012 at 10:03
[deleted comment]
I've a notification that you've left a comment for this ticket but I can't see
it here... Have you deleted it?
Anyways, answering your question
"I found, that we can create a hyperplane, that contains NaNs or Infs in normal
vector or constant, shouldn't we forbid doing that?"
Yes, absolutely. Use modgen.common.type.simple.checkgenext function like that
import modgen.common.type.simple.checkgenext;
checkgen('any(isnan(x1))||any(isinf(x1))||isnan(x2)||isinf(x2)',2,hNormVector,hC
onst);
Original comment by heartofm...@gmail.com
on 30 Oct 2012 at 2:33
I found, that we can create a hyperplane, that contains NaNs or Infs in normal
vector or constant, shouldn't we forbid doing that? Also how do we need to
threat with vectors, that have Inf components in contains(.,.) operation?
Original comment by justente...@gmail.com
on 30 Oct 2012 at 2:37
That's easy - if the corresponding components in the hyperplane normal vector
are zero then you just calculate a scalar product of x and hNormalVec using the
remaining components. Otherwise contains should return false.
Original comment by heartofm...@gmail.com
on 30 Oct 2012 at 2:45
I can't catch the exception from modgen.common.type.simple.checkgenext while
running runAndCheckError. if you can, see HyperplaneTestCase class commented
method testWrongInput. What am I doing wrong?
Original comment by justente...@gmail.com
on 30 Oct 2012 at 8:37
The thing is that runAndCheckError's second argument is an exception identifier
while the error message is the third argument. Also, checking for an exact
error message is an overkill, I would skip the third argument (error message)
altogether for this kind of testing.
Original comment by heartofm...@gmail.com
on 30 Oct 2012 at 8:52
One more thing:
You can actually check for a presence of certain markers in the error message
like that
self.runAndCheckError('hyperplane(infVector,testConstant)',...
'wrongInput',...
'v,c ');
it is not necessary to specify a complete error message, just specify some
substring that would help to make sure that the message is the one you expect.
Original comment by heartofm...@gmail.com
on 30 Oct 2012 at 8:55
Your branch is ready for reintegration.
Just wait for Vitaly Baranov to finish his reintegration (he was given a signal
just 30 minutes ago.
Please follow the steps of reintegration algorithm described at
http://code.google.com/p/ellipsoids/wiki/Issues_workflow_and_branching_policy
Original comment by heartofm...@gmail.com
on 1 Nov 2012 at 7:21
Please do reintegrate ASAP so that I can close the ticket. Thanks.
Original comment by heartofm...@gmail.com
on 2 Nov 2012 at 8:56
Original comment by heartofm...@gmail.com
on 2 Dec 2012 at 1:20
Original issue reported on code.google.com by
heartofm...@gmail.com
on 19 Oct 2012 at 6:22