From a3b2ddfe2f7ea1e6a6781d25fb5e4b15cf30c9e7 Mon Sep 17 00:00:00 2001 From: Roy Stogner Date: Tue, 5 Jul 2022 12:11:06 -0500 Subject: [PATCH] Initialize values in our test instantiations We do want to allow our numeric classes to have uninitialized instantiations, because every operation here counts and because we want them to behave like built-in numeric types in that respect. But in a test where we're going to *output* their values, we really need to instantiate them. This fixes a bug for me where every several dozen runs was kicking up SIGFPE. --- test/instantiations_unit.C | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/instantiations_unit.C b/test/instantiations_unit.C index e0b8898..646603f 100644 --- a/test/instantiations_unit.C +++ b/test/instantiations_unit.C @@ -24,29 +24,29 @@ struct Instantiator { DualExpression test_de; #endif - DualNumber test_dn; - ShadowNumber test_shadow; - NumberArray<5, T1> test_na; - NumberVector<5, T1> test_nv; + DualNumber test_dn {1}; + ShadowNumber test_shadow {2}; + NumberArray<5, T1> test_na {3}; + NumberVector<5, T1> test_nv {4}; typename SemiDynamicSparseNumberArrayOf<4, 2, T1, 3, T2, 5, T1, 7, T2>::type - test_sdsna; + test_sdsna {0}; typename DynamicSparseNumberArrayOf<4, 2, T1, 3, T2, 5, T1, 7, T2>::type - test_dsna; + test_dsna {0}; typename DynamicSparseNumberVectorOf<4, 2, T1, 3, T2, 5, T1, 7, T2>::type - test_dsnv; + test_dsnv {0}; typename SparseNumberArrayOf<4, 2, T1, 3, T2, 5, T1, 7, T2>::type - test_sna; + test_sna {0}; typename SparseNumberVectorOf<4, 2, T1, 3, T2, 5, T1, 7, T2>::type - test_snv; + test_snv {0}; typename SparseNumberStructOf<4, 2, T1, 3, T2, 5, T1, 7, T2>::type - test_sns; + test_sns {0}; #if __cplusplus >= 201402L NamedIndexArray ::type> > indexed_by_two; + ULongSetConstructor<2>::type> > indexed_by_two {5, 0}; #endif };