summaryrefslogtreecommitdiff
path: root/test/integration/test-sourceslist-target-plusminus-options
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2018-08-22 09:54:07 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2018-08-29 17:50:31 +0200
commit55585d0f93de1a0e60858e594b1b3b46f4a0831f (patch)
tree292b52144c177b636fdc9fecb57f97e93dc71d73 /test/integration/test-sourceslist-target-plusminus-options
parent8e4893b1fade91b2c05e81fde72ec1ab39bb67bf (diff)
Don't use invalid iterator in Fallback-Of handling
cppcheck reports: (error) Iterator 't' used after element has been erased. The loop is actually fashioned to deal with this (not in the most efficient way, but in simplest and speed isn't really a concern here) IF this codepath had a "break" at the end… so I added one. Note that the tests aren't failing before (and hopefully after) the change as the undefined behavior we encounter is too stable. Thanks: David Binderman for reporting
Diffstat (limited to 'test/integration/test-sourceslist-target-plusminus-options')
-rwxr-xr-xtest/integration/test-sourceslist-target-plusminus-options4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/integration/test-sourceslist-target-plusminus-options b/test/integration/test-sourceslist-target-plusminus-options
index e4ce8e282..5c79af2d9 100755
--- a/test/integration/test-sourceslist-target-plusminus-options
+++ b/test/integration/test-sourceslist-target-plusminus-options
@@ -122,3 +122,7 @@ testtargets 'explicit + activate' 'Packages' 'Contents' 'Contents2'
echo 'deb [Contents=yes,target+=Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
testtargets 'duplications are okay' 'Packages' 'Translations' 'Contents' 'Contents2'
+
+# we can't check if it really reorders here
+echo 'deb [target+=Contents2,Contents] http://example.org/debian stable rocks' > rootdir/etc/apt/sources.list
+testtargets 'reordered fallback order' 'Packages' 'Translations' 'Contents' 'Contents2'