@@ -114,13 +114,10 @@ void test_horizons_stack()
114114 absl::StrCat ( geode::DATA_PATH , " test_HorizonStack_v0.og_hst3d" ) );
115115}
116116
117- void test_create_horizons_stack ( )
117+ void test_horizons_stack ( const geode::HorizonsStack2D& horizons_stack )
118118{
119119 std::array< std::string, 4 > horizons_list{ " h1" , " h2" , " h3" , " h4" };
120120 std::array< std::string, 3 > units_list{ " su1" , " su2" , " su3" };
121- const auto horizons_stack =
122- geode::detail::horizons_stack_from_bottom_to_top_names< 2 >(
123- horizons_list, units_list );
124121 OPENGEODE_EXCEPTION ( horizons_stack.nb_horizons () == 4 ,
125122 " [Test] Created Horizons Stack should have 4 horizons." );
126123 OPENGEODE_EXCEPTION ( horizons_stack.nb_stratigraphic_units () == 5 ,
@@ -194,14 +191,35 @@ void test_create_horizons_stack()
194191 " pass through all stratigraphic units" );
195192}
196193
194+ void test_create_horizons_stack_top_to_bottom ()
195+ {
196+ std::array< std::string, 4 > horizons_list{ " h4" , " h3" , " h2" , " h1" };
197+ std::array< std::string, 3 > units_list{ " su3" , " su2" , " su1" };
198+ const auto horizons_stack =
199+ geode::detail::horizons_stack_from_top_to_bottom_names< 2 >(
200+ horizons_list, units_list );
201+ test_horizons_stack ( horizons_stack );
202+ }
203+
204+ void test_create_horizons_stack_bottom_to_top ()
205+ {
206+ std::array< std::string, 4 > horizons_list{ " h1" , " h2" , " h3" , " h4" };
207+ std::array< std::string, 3 > units_list{ " su1" , " su2" , " su3" };
208+ const auto horizons_stack =
209+ geode::detail::horizons_stack_from_bottom_to_top_names< 2 >(
210+ horizons_list, units_list );
211+ test_horizons_stack ( horizons_stack );
212+ }
213+
197214int main ()
198215{
199216 try
200217 {
201218 geode::Logger::info ( " Starting test" );
202219 geode::GeosciencesImplicitLibrary::initialize ();
203220 test_horizons_stack ();
204- test_create_horizons_stack ();
221+ test_create_horizons_stack_bottom_to_top ();
222+ test_create_horizons_stack_top_to_bottom ();
205223
206224 geode::Logger::info ( " TEST SUCCESS" );
207225 return 0 ;
0 commit comments