diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-05-27 18:10:39 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-05-27 19:14:38 +0200 |
commit | b58e2c7c56b1416a343e81f9f80cb1f02c128e25 (patch) | |
tree | dbd92b2a460c2dd5d2a4a9ccc5d80657b24b32c1 /test | |
parent | 124e6916b7b02984803ff8217e8163947aae2882 (diff) |
prevent C++ locale number formatting in text APIs
Setting the C++ locale via std::locale::global(std::locale("")); which
would otherwise default to the default C locale (aka: unaffected by
setlocale) effects the formatting of numeric types in IO streams, which
for output for humans is perfectly sensible, but breaks our many text
interfaces used and parsed by us and others without expecting the
numbers to be formatted.
Closes: #825396
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/test-apt-download-progress | 10 | ||||
-rwxr-xr-x | test/integration/test-apt-progress-fd | 68 | ||||
-rwxr-xr-x | test/integration/test-apt-progress-fd-deb822 | 10 |
3 files changed, 42 insertions, 46 deletions
diff --git a/test/integration/test-apt-download-progress b/test/integration/test-apt-download-progress index b48e7ebb3..7ac044a57 100755 --- a/test/integration/test-apt-download-progress +++ b/test/integration/test-apt-download-progress @@ -11,13 +11,9 @@ setupenvironment changetohttpswebserver assertprogress() { - T="$1" - testsuccess grep "dlstatus:1:0:Retrieving file 1 of 1" "$T" - if ! grep -E -q "dlstatus:1:(0\..*|([1-9](\..*)?)|[1-9][0-9](\..*)?):Retrieving file 1 of 1" "$T"; then - cat "$T" - msgfail "Failed to detect download progress" - fi - testsuccess grep "dlstatus:1:100:Retrieving file 1 of 1" "$T" + testsuccess grep "dlstatus:1:0.0000:Retrieving file 1 of 1" "$1" + testsuccess grep -E "dlstatus:1:[1-9][0-9]{0,1}\.[0-9]{1,4}:Retrieving file 1 of 1" "$1" + testsuccess grep "dlstatus:1:100.0000:Retrieving file 1 of 1" "$1" } # we need to ensure the file is reasonable big so that apt has a chance to diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd index c6650bc2e..86eaa1354 100755 --- a/test/integration/test-apt-progress-fd +++ b/test/integration/test-apt-progress-fd @@ -15,15 +15,15 @@ setupaptarchive # install native exec 3> apt-progress.log testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3 -testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:100:Retrieving file 1 of 1 -pmstatus:dpkg-exec:0:Running dpkg -pmstatus:testing:0:Installing testing (amd64) +testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 +dlstatus:1:100.0000:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0.0000:Running dpkg +pmstatus:testing:0.0000:Installing testing (amd64) pmstatus:testing:16.6667:Preparing testing (amd64) pmstatus:testing:33.3333:Unpacking testing (amd64) -pmstatus:testing:50:Preparing to configure testing (amd64) -pmstatus:dpkg-exec:50:Running dpkg -pmstatus:testing:50:Configuring testing (amd64) +pmstatus:testing:50.0000:Preparing to configure testing (amd64) +pmstatus:dpkg-exec:50.0000:Running dpkg +pmstatus:testing:50.0000:Configuring testing (amd64) pmstatus:testing:66.6667:Configuring testing (amd64) pmstatus:testing:83.3333:Installed testing (amd64) pmstatus:dpkg-exec:83.3333:Running dpkg' @@ -31,15 +31,15 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' # upgrade exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3 -testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:100:Retrieving file 1 of 1 -pmstatus:dpkg-exec:0:Running dpkg -pmstatus:testing:0:Installing testing (amd64) +testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 +dlstatus:1:100.0000:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0.0000:Running dpkg +pmstatus:testing:0.0000:Installing testing (amd64) pmstatus:testing:16.6667:Preparing testing (amd64) pmstatus:testing:33.3333:Unpacking testing (amd64) -pmstatus:testing:50:Preparing to configure testing (amd64) -pmstatus:dpkg-exec:50:Running dpkg -pmstatus:testing:50:Configuring testing (amd64) +pmstatus:testing:50.0000:Preparing to configure testing (amd64) +pmstatus:dpkg-exec:50.0000:Running dpkg +pmstatus:testing:50.0000:Configuring testing (amd64) pmstatus:testing:66.6667:Configuring testing (amd64) pmstatus:testing:83.3333:Installed testing (amd64) pmstatus:dpkg-exec:83.3333:Running dpkg' @@ -47,15 +47,15 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' # reinstall exec 3> apt-progress.log testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3 -testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:100:Retrieving file 1 of 1 -pmstatus:dpkg-exec:0:Running dpkg -pmstatus:testing:0:Installing testing (amd64) +testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 +dlstatus:1:100.0000:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0.0000:Running dpkg +pmstatus:testing:0.0000:Installing testing (amd64) pmstatus:testing:16.6667:Preparing testing (amd64) pmstatus:testing:33.3333:Unpacking testing (amd64) -pmstatus:testing:50:Preparing to configure testing (amd64) -pmstatus:dpkg-exec:50:Running dpkg -pmstatus:testing:50:Configuring testing (amd64) +pmstatus:testing:50.0000:Preparing to configure testing (amd64) +pmstatus:dpkg-exec:50.0000:Running dpkg +pmstatus:testing:50.0000:Configuring testing (amd64) pmstatus:testing:66.6667:Configuring testing (amd64) pmstatus:testing:83.3333:Installed testing (amd64) pmstatus:dpkg-exec:83.3333:Running dpkg' @@ -63,25 +63,25 @@ pmstatus:dpkg-exec:83.3333:Running dpkg' # and remove exec 3> apt-progress.log testsuccess aptget remove testing -y -o APT::Status-Fd=3 -testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0:Running dpkg -pmstatus:testing:0:Removing testing (amd64) -pmstatus:testing:25:Preparing for removal of testing (amd64) -pmstatus:testing:50:Removing testing (amd64) -pmstatus:testing:75:Removed testing (amd64) -pmstatus:dpkg-exec:75:Running dpkg' +testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0.0000:Running dpkg +pmstatus:testing:0.0000:Removing testing (amd64) +pmstatus:testing:25.0000:Preparing for removal of testing (amd64) +pmstatus:testing:50.0000:Removing testing (amd64) +pmstatus:testing:75.0000:Removed testing (amd64) +pmstatus:dpkg-exec:75.0000:Running dpkg' # install non-native and ensure we get proper progress info exec 3> apt-progress.log testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3 -testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1 -dlstatus:1:100:Retrieving file 1 of 1 -pmstatus:dpkg-exec:0:Running dpkg -pmstatus:testing2:0:Installing testing2 (i386) +testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1 +dlstatus:1:100.0000:Retrieving file 1 of 1 +pmstatus:dpkg-exec:0.0000:Running dpkg +pmstatus:testing2:0.0000:Installing testing2 (i386) pmstatus:testing2:16.6667:Preparing testing2 (i386) pmstatus:testing2:33.3333:Unpacking testing2 (i386) -pmstatus:testing2:50:Preparing to configure testing2 (i386) -pmstatus:dpkg-exec:50:Running dpkg -pmstatus:testing2:50:Configuring testing2 (i386) +pmstatus:testing2:50.0000:Preparing to configure testing2 (i386) +pmstatus:dpkg-exec:50.0000:Running dpkg +pmstatus:testing2:50.0000:Configuring testing2 (i386) pmstatus:testing2:66.6667:Configuring testing2 (i386) pmstatus:testing2:83.3333:Installed testing2 (i386) pmstatus:dpkg-exec:83.3333:Running dpkg' diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822 index 58fd73275..a8d59608d 100755 --- a/test/integration/test-apt-progress-fd-deb822 +++ b/test/integration/test-apt-progress-fd-deb822 @@ -17,12 +17,12 @@ exec 3> apt-progress.log testsuccess aptget install testing=0.1 -y -o APT::Status-deb822-Fd=3 testfileequal './apt-progress.log' 'Status: progress -Percent: 0 +Percent: 0.0000 Message: Running dpkg Status: progress Package: testing:amd64 -Percent: 0 +Percent: 0.0000 Message: Installing testing (amd64) Status: progress @@ -37,16 +37,16 @@ Message: Unpacking testing (amd64) Status: progress Package: testing:amd64 -Percent: 50 +Percent: 50.0000 Message: Preparing to configure testing (amd64) Status: progress -Percent: 50 +Percent: 50.0000 Message: Running dpkg Status: progress Package: testing:amd64 -Percent: 50 +Percent: 50.0000 Message: Configuring testing (amd64) Status: progress |