Skip to content

Commit

Permalink
test of TTMatrix:fill() now passes
Browse files Browse the repository at this point in the history
  • Loading branch information
nwolek committed Sep 11, 2013
1 parent 31f559c commit a754705
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Foundation/library/tests/TTMatrix.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,18 @@ TTErr TTMatrix::test(TTValue& returnedTestInfo)
testAssertionCount,
errorCount);

// Test the fill message
TTValue fv(6.26, 19.99);
// Test the fill message with 2-item sized TTValue
TTValue fv = 6.26;
fv.append(19.99);
TTValue fr;
matrix->sendMessage("fill", fv, fr);

TTUInt32 elementByteDepth = mComponentStride / mElementCount;

int fillTestCount = 0;
for (unsigned int i=0; i < matrix->mDataSize; i += matrix->mComponentStride) {
if (*((TTFloat64*)(matrix->mData+i)) != 6.26)
fillTestCount++;
//if (*((TTFloat64*)(matrix->mData+i+elementByteDepth)) != 19.99)
//fillTestCount++;
if (*((TTFloat64*)(matrix->mData+i+matrix->mTypeSizeInBytes)) != 19.99)
fillTestCount++;
}

TTTestAssertion("fill message correctly sets all elements to proper values",
Expand Down

2 comments on commit a754705

@tap
Copy link
Member

@tap tap commented on a754705 Sep 11, 2013

Choose a reason for hiding this comment

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

Is the problem that you can't use == or != with floats?

@nwolek
Copy link
Member Author

@nwolek nwolek commented on a754705 Sep 11, 2013

Choose a reason for hiding this comment

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

Um, there is no problem anymore. The test passes.

Please sign in to comment.