File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -363,7 +363,27 @@ static void test_snake_case_key()
363363 TEST_CHECK (check_snake_case ("interval_Sec" , "interval_sec" ) == FLB_TRUE );
364364}
365365
366+ static void test_entry_stream (void )
367+ {
368+ struct flb_cf * cf ;
369+ struct flb_cf * parsed ;
370+ FILE * stream ;
371+
372+ stream = fopen (FLB_000 , "rb" );
373+ TEST_ASSERT (stream != NULL );
374+ cf = flb_cf_create ();
375+ TEST_ASSERT (cf != NULL );
376+ cf -> entry_file = stream ;
377+ parsed = flb_cf_create_from_file (cf , FLB_006 );
378+ TEST_CHECK (parsed == cf );
379+ TEST_CHECK (mk_list_size (& cf -> inputs ) == 1 );
380+ cf -> entry_file = NULL ;
381+ TEST_CHECK (fclose (stream ) == 0 );
382+ flb_cf_destroy (cf );
383+ }
384+
366385TEST_LIST = {
386+ {"entry_stream" , test_entry_stream },
367387 { "basic" , test_basic },
368388 { "missing_value_issue5880" , missing_value },
369389 { "indent_level_error" , indent_level_error },
Original file line number Diff line number Diff line change @@ -1090,7 +1090,28 @@ static void test_include_hardlink_cycle()
10901090}
10911091#endif
10921092
1093+ static void test_entry_stream (void )
1094+ {
1095+ struct flb_cf * cf ;
1096+ struct flb_cf * parsed ;
1097+ FILE * stream ;
1098+
1099+ stream = fopen (FLB_BASIC , "rb" );
1100+ TEST_ASSERT (stream != NULL );
1101+ cf = flb_cf_create ();
1102+ TEST_ASSERT (cf != NULL );
1103+ cf -> entry_file = stream ;
1104+ /* The named fixture fails on its own; the opened entry supplies the data. */
1105+ parsed = flb_cf_create_from_file (cf , FLB_007 );
1106+ TEST_CHECK (parsed == cf );
1107+ TEST_CHECK (mk_list_size (& cf -> inputs ) > 0 );
1108+ cf -> entry_file = NULL ;
1109+ TEST_CHECK (fclose (stream ) == 0 );
1110+ flb_cf_destroy (cf );
1111+ }
1112+
10931113TEST_LIST = {
1114+ {"entry_stream" , test_entry_stream },
10941115#ifdef FLB_SYSTEM_WINDOWS
10951116 { "include_hardlink_cycle" , test_include_hardlink_cycle },
10961117#endif
You can’t perform that action at this time.
0 commit comments