From 6f1a3c4648bf06862dca0b3725cbb3b7ee0284e3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 6 Mar 2021 22:12:27 +0100 Subject: [PATCH] =?UTF-8?q?gie=5Fself=5Ftests:=20fix=20use=20of=20uninitia?= =?UTF-8?q?lized=20memory=20(fixes=C2=A0#2557)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/unit/gie_self_tests.cpp | 39 ++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp index 4244766ebf..92f1c758dc 100644 --- a/test/unit/gie_self_tests.cpp +++ b/test/unit/gie_self_tests.cpp @@ -268,8 +268,10 @@ TEST_F(gieTest, proj_create_crs_to_crs) { ASSERT_TRUE(P != nullptr); PJ_COORD a, b; - a.xy.x = 700000.0; - a.xy.y = 6000000.0; + a.xyzt.x = 700000.0; + a.xyzt.y = 6000000.0; + a.xyzt.z = 0; + a.xyzt.t = HUGE_VAL; b.xy.x = 307788.8761171057; b.xy.y = 5999669.3036037628; @@ -306,8 +308,10 @@ TEST_F(gieTest, proj_create_crs_to_crs_EPSG_4326) { PJ_COORD a, b; // Lat, long degrees - a.xy.x = 0.0; - a.xy.y = 3.0; + a.xyzt.x = 0.0; + a.xyzt.y = 3.0; + a.xyzt.z = 0; + a.xyzt.t = HUGE_VAL; b.xy.x = 500000.0; b.xy.y = 0.0; @@ -328,8 +332,10 @@ TEST_F(gieTest, proj_create_crs_to_crs_proj_longlat) { PJ_COORD a, b; // Long, lat degrees - a.xy.x = 3.0; - a.xy.y = 0; + a.xyzt.x = 3.0; + a.xyzt.y = 0; + a.xyzt.z = 0; + a.xyzt.t = HUGE_VAL; b.xy.x = 500000.0; b.xy.y = 0.0; @@ -718,9 +724,10 @@ TEST(gie, proj_create_crs_to_crs_PULKOVO42_ETRS89) { proj_destroy(target_crs); // Romania - c.xyz.x = 45; // Lat - c.xyz.y = 25; // Long - c.xyz.z = 0; + c.xyzt.x = 45; // Lat + c.xyzt.y = 25; // Long + c.xyzt.z = 0; + c.xyzt.t = HUGE_VAL; c = proj_trans(P, PJ_FWD, c); EXPECT_NEAR(c.xy.x, 44.999701238, 1e-9); EXPECT_NEAR(c.xy.y, 24.998474948, 1e-9); @@ -740,9 +747,10 @@ TEST(gie, proj_create_crs_to_crs_PULKOVO42_ETRS89) { EXPECT_NEAR(c.xy.x, 45, 1e-8); EXPECT_NEAR(c.xy.y, 25, 1e-8); - c.xyz.x = 45; // Lat - c.xyz.y = 25; // Long - c.xyz.z = 0; + c.xyzt.x = 45; // Lat + c.xyzt.y = 25; // Long + c.xyzt.z = 0; + c.xyzt.t = HUGE_VAL; proj_trans_generic(P, PJ_FWD, &(c.xyz.x), sizeof(double), 1, &(c.xyz.y), sizeof(double), 1, &(c.xyz.z), sizeof(double), 1, nullptr, 0, 0); @@ -783,9 +791,10 @@ TEST(gie, proj_create_crs_to_crs_outside_area_of_use) { EXPECT_EQ(P->fwd, nullptr); // Test point outside area of use of both candidate coordinate operations - c.xyz.x = 58; // Lat in deg - c.xyz.y = 5; // Long in deg - c.xyz.z = 0; + c.xyzt.x = 58; // Lat in deg + c.xyzt.y = 5; // Long in deg + c.xyzt.z = 0; + c.xyzt.t = HUGE_VAL; c = proj_trans(P, PJ_FWD, c); EXPECT_NEAR(c.xy.x, 64.44444444444444, 1e-9); // Lat in grad EXPECT_NEAR(c.xy.y, 2.958634259259258, 1e-9); // Long in grad title='2018-09-04 17:25:11 +0200'>2018-09-04Switch to Guile-Gcrypt....This removes (guix hash) and (guix pk-crypto), which now live as part of Guile-Gcrypt (version 0.1.0.) * guix/gcrypt.scm, guix/hash.scm, guix/pk-crypto.scm, tests/hash.scm, tests/pk-crypto.scm: Remove. * configure.ac: Test for Guile-Gcrypt. Remove LIBGCRYPT and LIBGCRYPT_LIBDIR assignments. * m4/guix.m4 (GUIX_ASSERT_LIBGCRYPT_USABLE): Remove. * README: Add Guile-Gcrypt to the dependencies; move libgcrypt as "required unless --disable-daemon". * doc/guix.texi (Requirements): Likewise. * gnu/packages/bash.scm, guix/derivations.scm, guix/docker.scm, guix/git.scm, guix/http-client.scm, guix/import/cpan.scm, guix/import/cran.scm, guix/import/crate.scm, guix/import/elpa.scm, guix/import/gnu.scm, guix/import/hackage.scm, guix/import/texlive.scm, guix/import/utils.scm, guix/nar.scm, guix/pki.scm, guix/scripts/archive.scm, guix/scripts/authenticate.scm, guix/scripts/download.scm, guix/scripts/hash.scm, guix/scripts/pack.scm, guix/scripts/publish.scm, guix/scripts/refresh.scm, guix/scripts/substitute.scm, guix/store.scm, guix/store/deduplication.scm, guix/tests.scm, tests/base32.scm, tests/builders.scm, tests/challenge.scm, tests/cpan.scm, tests/crate.scm, tests/derivations.scm, tests/gem.scm, tests/nar.scm, tests/opam.scm, tests/pki.scm, tests/publish.scm, tests/pypi.scm, tests/store-deduplication.scm, tests/store.scm, tests/substitute.scm: Adjust imports. * gnu/system/vm.scm: Likewise. (guile-sqlite3&co): Rename to... (gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT. (expression->derivation-in-linux-vm)[config]: Remove. (iso9660-image)[config]: Remove. (qemu-image)[config]: Remove. (system-docker-image)[config]: Remove. * guix/scripts/pack.scm: Adjust imports. (guile-sqlite3&co): Rename to... (gcrypt-sqlite3&co): ... this. Add GUILE-GCRYPT. (self-contained-tarball)[build]: Call 'make-config.scm' without #:libgcrypt argument. (squashfs-image)[libgcrypt]: Remove. [build]: Call 'make-config.scm' without #:libgcrypt. (docker-image)[config, json]: Remove. [build]: Add GUILE-GCRYPT to the extensions Remove (guix config) from the imported modules. * guix/self.scm (specification->package): Remove "libgcrypt", add "guile-gcrypt". (compiled-guix): Remove #:libgcrypt. [guile-gcrypt]: New variable. [dependencies]: Add it. [*core-modules*]: Remove #:libgcrypt from 'make-config.scm' call. Add #:extensions. [*config*]: Remove #:libgcrypt from 'make-config.scm' call. (%dependency-variables): Remove %libgcrypt. (make-config.scm): Remove #:libgcrypt. * build-aux/build-self.scm (guile-gcrypt): New variable. (make-config.scm): Remove #:libgcrypt. (build-program)[fake-gcrypt-hash]: New variable. Add (gcrypt hash) to the imported modules. Adjust load path assignments. * gnu/packages/package-management.scm (guix)[propagated-inputs]: Add GUILE-GCRYPT. [arguments]: In 'wrap-program' phase, add GUILE-GCRYPT to the search path. Ludovic Courtès