testChannelAccess: test plan of test_channelArray made deterministic

This commit is contained in:
Matej Sekoranja
2014-03-04 21:43:19 +01:00
parent f56ecdbfc0
commit 22a27433af
+9 -3
View File
@@ -1863,17 +1863,23 @@ void ChannelAccessIFTest::test_channelArray() {
CURRENT_FUNCTION, bigCapacity);
testOk(data4[0] == 1.1 , "%s: 4.check 0: %f", CURRENT_FUNCTION, data4[0]);
testOk(data4[1] == 2.2 , "%s: 4.check 1: %f", CURRENT_FUNCTION, data4[1]);
/*
if (data4.size() == bigCapacity) {
for (size_t i = newCap; i < bigCapacity; i++) {
if (data4[i] != 0.0) {
testFail("%s: 4.check: data at %zu should be 0.0 but was %f", CURRENT_FUNCTION, i, data4[i]);
size_t i = newCap;
for (; i < bigCapacity; i++) {
if (data4[i] != 0.0) { // NOTE: floating-point number check, introduce epsilon value
break;
}
}
if (i == bigCapacity)
testOk("%s: 4.check: all data 0.0", CURRENT_FUNCTION);
else
testFail("%s: 4.check: data at %zu should be 0.0 but was %f", CURRENT_FUNCTION, i, data4[i]);
}
else {
testFail("%s: will not check the rest of the array if the size is not correct", CURRENT_FUNCTION);
}
*/
channel->destroy();