From 73d82eee94f1e9b03ad1001ee2b377515de5cc04 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Tue, 27 Mar 2018 19:48:41 +0200 Subject: [PATCH] Make tests more portable. The estimated index size depends on the architecture, so just make sure the code path is tested, without really caring of what the estimated size is. Thanks to Christoph Berg for the report. --- expected/hypopg.out | 12 ++++++------ test/sql/hypopg.sql | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/expected/hypopg.out b/expected/hypopg.out index 79a67f7..e51e948 100644 --- a/expected/hypopg.out +++ b/expected/hypopg.out @@ -95,14 +95,14 @@ FROM public.hypopg_create_index('CREATE INDEX ON hypo(id) WITH (fillfactor = 1)' ERROR: value 1 out of bounds for option "fillfactor" DETAIL: Valid values are between "10" and "100". -- Index size estimation -SELECT pg_size_pretty(hypopg_relation_size(indexrelid)) +SELECT hypopg_relation_size(indexrelid) = current_setting('block_size')::bigint AS one_block FROM hypopg() ORDER BY indexrelid; - pg_size_pretty ----------------- - 2544 kB - 8192 bytes - 4120 kB + one_block +----------- + f + t + f (3 rows) -- locally disable hypoopg diff --git a/test/sql/hypopg.sql b/test/sql/hypopg.sql index a8c859d..3aac4af 100644 --- a/test/sql/hypopg.sql +++ b/test/sql/hypopg.sql @@ -66,7 +66,7 @@ SELECT COUNT(*) AS NB FROM public.hypopg_create_index('CREATE INDEX ON hypo(id) WITH (fillfactor = 1)'); -- Index size estimation -SELECT pg_size_pretty(hypopg_relation_size(indexrelid)) +SELECT hypopg_relation_size(indexrelid) = current_setting('block_size')::bigint AS one_block FROM hypopg() ORDER BY indexrelid;