@@ -136,8 +136,11 @@ void test_collect_image_files_directory()
136136 std::vector<std::vector<std::string>> batches =
137137 collect_image_files ( paths );
138138
139- OIIO_CHECK_EQUAL ( batches.size (), 1 );
140- OIIO_CHECK_EQUAL ( batches[0 ].size (), 5 );
139+ OIIO_CHECK_EQUAL (
140+ batches.size (),
141+ 2 ); // Empty batch for file paths, one batch for directory
142+ OIIO_CHECK_EQUAL ( batches[0 ].size (), 0 );
143+ OIIO_CHECK_EQUAL ( batches[1 ].size (), 5 );
141144
142145 // Check that the correct files are included
143146 std::vector<std::string> expected_files = {
@@ -151,7 +154,7 @@ void test_collect_image_files_directory()
151154 for ( const auto &expected: expected_files )
152155 {
153156 bool found = false ;
154- for ( const auto &actual: batches[0 ] )
157+ for ( const auto &actual: batches[1 ] )
155158 {
156159 if ( actual == expected )
157160 {
@@ -183,8 +186,7 @@ void test_collect_image_files_single_file()
183186 OIIO_CHECK_EQUAL ( batches[0 ][0 ], test_file );
184187}
185188
186- // / Verifies that collect_image_files skips nonexistent paths and creates no batches
187- // / when given a path that doesn't exist, ensuring proper error handling for invalid input paths
189+ // / Verifies that collect_image_files skips nonexistent paths and creates no batches for them.
188190void test_collect_image_files_nonexistent_path ()
189191{
190192 std::cout << std::endl
@@ -193,7 +195,7 @@ void test_collect_image_files_nonexistent_path()
193195 std::vector<std::vector<std::string>> batches =
194196 collect_image_files ( paths );
195197
196- OIIO_CHECK_EQUAL ( batches.size (), 0 );
198+ OIIO_CHECK_EQUAL ( batches.size (), 1 ); // Empty batch for file paths
197199}
198200
199201// / Ensures that when given an empty directory, collect_image_files creates no batches
@@ -207,11 +209,15 @@ void test_collect_image_files_empty_directory()
207209 std::vector<std::vector<std::string>> batches =
208210 collect_image_files ( paths );
209211
210- OIIO_CHECK_EQUAL ( batches.size (), 0 );
212+ OIIO_CHECK_EQUAL (
213+ batches.size (),
214+ 2 ); // Empty batch for file paths, one batch for directory
215+ OIIO_CHECK_EQUAL ( batches[0 ].size (), 0 );
216+ OIIO_CHECK_EQUAL ( batches[1 ].size (), 0 );
211217}
212218
213219// / Verifies that when a directory contains only files that should be filtered out
214- // / (like .DS_Store, .jpg, .exr), collect_image_files does not create a batch,
220+ // / (like .DS_Store, .jpg, .exr)
215221void test_collect_image_files_directory_with_only_filtered_files ()
216222{
217223 std::cout << std::endl
@@ -224,7 +230,11 @@ void test_collect_image_files_directory_with_only_filtered_files()
224230 std::vector<std::vector<std::string>> batches =
225231 collect_image_files ( paths );
226232
227- OIIO_CHECK_EQUAL ( batches.size (), 0 );
233+ OIIO_CHECK_EQUAL (
234+ batches.size (),
235+ 2 ); // Empty batch for file paths, one batch for directory
236+ OIIO_CHECK_EQUAL ( batches[0 ].size (), 0 );
237+ OIIO_CHECK_EQUAL ( batches[1 ].size (), 0 );
228238}
229239
230240// / Tests collect_image_files with multiple input paths (files and directories)
0 commit comments