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 im Cournoyer 2024-08-31import: go: Emit new-style package inputs....Since PACKAGE-NAMES->PACKAGE-INPUTS is used by both the go and crate importers, give the crate importer a copy of the original so it continues to use old-style inputs until it is updated. * guix/import/utils.scm (package-names->package-inputs)[make-input]: Return new-style package inputs. (maybe-inputs): Wrap PACKAGE-INPUTS in 'list' instead of 'quasiquote'. * guix/import/crate.scm (package-names->package-inputs): New variable. * tests/go.scm ("go-module->guix-package"): Adjust to new-style package inputs. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Sarah Morgensen 2023-12-16guix: import: Report go version for go importer....* guix/import/go.scm (go-package, go.mod-go-version): New procedures. (go-module->guix-package): Add the #:go keyword in the generated package definition if the required go is newer than the default go. * tests/go.scm (mock-http-get): Use gexps for package arguments. Change-Id: I8d005740a442330ac307a40a53764c803ceffc4f Efraim Flashner 2021-09-28tests: go: Fix typo....* tests/go.scm (fixture-go-mod-unparseable): Rename this… (fixture-go-mod-unparsable): …to this. Adjust the only caller. Tobias Geerinckx-Rice 2021-09-01import: go: Improve error handling....* guix/import/go.scm (go-module->guix-package*): Handle errors, remove memoize. (go-module-recursive-import): Remove 'guard', add memoize. * guix/scripts/import/go.scm (guix-import-go): Adjust. * tests/go.scm: Adjust. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun