summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDennis Oberst <dennis.oberst@qt.io>2023-06-01 13:45:34 +0200
committerDennis Oberst <dennis.oberst@qt.io>2023-06-01 18:39:25 +0000
commit60f739f51f28e602a3a89448d489fc13babccf35 (patch)
tree2fc22b9ca41d9e59484cd6f67728b446d48cd94b /src
parent63a0f4dc3b9cf5d091877c361e096ff176c52138 (diff)
tst_ContainerApiSymmetry: make assign_impl() more robust
Refactor the 'CHECK' macro to eliminate the capacity check and explicitly verify that no reallocation occurred. The previous implementation had to pass constants to suppress the issue arising from differing growth rates between implementations. Additionally, improve the 'std::stringstream' versions of the test by incorporating the correct values. In the previous implementation, the usage of: auto tData = V(9); ~~~ std::stringstream ss("9 9 "); had several issues. Firstly, it used the wrong test data since the container's value_type of '(char) 9' resulted in a tab character '\t', which was not accurately reflected in the stringstream assignment. Secondly, this value caused problems in how stringstreams interprets it. To address these issues, let's make the following improvements: 1. Use a default test value of 65 instead of (char) 9. This value, which represents the character 'A', is less likely to cause errors and is more intuitive. 2. Use the tData variable for the assignments in the stringstream. This ensures that the correct data from the container is used. 3. Change the test value between the assign() calls to verify that the container's contents are successfully overwritten. These changes ensure, that the test cases are more accurate and reliable. Amends: 3b0536bbe8d6782f79e1bcc2b4f1925547c14c0b. Change-Id: I9441c4818106bf93e93a1a5d2d2d54c89d80e7b0 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions