View Issue Details

IDProjectCategoryView StatusLast Update
0005511Compliance Test Tool (CTT) Unified Architecture1 - Script Issuepublic2020-04-10 16:41
ReporterJochen Baier Assigned ToSebastian Allmendinger  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.03.341.390 
Fixed in Version1.03.341.395 
Summary0005511: Assert.Equal("abcde", "ab"); //equal=true but expected false
Description

Assert.Equal() with an array or string parameter compares the first n (n=actualResult.length) characters (here: "ab")
If actualResult.length < expectedResult.length the string/arrays a considered equal even if not (here: "cde").

Steps To Reproduce

var equal= Assert.Equal("abcde", "ab"); //equal=true but expected false

same with arrays:
var equal= Assert.Equal([0, 1, 2, 3, 4, 5], [0, 1]); //equal=true but expected false

TagsNo tags attached.
Files Affected

Activities

Sebastian Allmendinger

2020-04-08 10:58

developer   ~0011876

Assert.Equal was initialy not intended to be used with arrays. Anyhow, there was a kind of array handling integrated which was not working properly.
The Assert.Equal function has been improved and is now supporting arrays, i.e. it is now checking for an equal length of the values and then comparing every element.
During investigation of this reported issue we recognized that Assert.Equal always returned true if the values to compare were of the datatype ByteString. This issue has been fixed too.

Paul Hunkar

2020-04-10 16:41

administrator   ~0011898

reviewed in CMP call

Issue History

Date Modified Username Field Change
2020-03-09 13:39 Jochen Baier New Issue
2020-03-09 22:26 Paul Hunkar Assigned To => Alexander Allmendinger
2020-03-09 22:26 Paul Hunkar Status new => assigned
2020-04-08 10:58 Sebastian Allmendinger Assigned To Alexander Allmendinger => Sebastian Allmendinger
2020-04-08 10:58 Sebastian Allmendinger Status assigned => resolved
2020-04-08 10:58 Sebastian Allmendinger Resolution open => fixed
2020-04-08 10:58 Sebastian Allmendinger Fixed in Version => 1.03.341.395
2020-04-08 10:58 Sebastian Allmendinger Note Added: 0011876
2020-04-10 16:41 Paul Hunkar Status resolved => closed
2020-04-10 16:41 Paul Hunkar Note Added: 0011898