@@ -1960,6 +1960,44 @@ static void missingHeader4()
19601960 ASSERT_EQUALS (" file0,1,syntax_error,No header in #include\n " , toString (outputList));
19611961}
19621962
1963+ #ifndef _WIN32
1964+ static void missingHeader5 ()
1965+ {
1966+ // this is a directory
1967+ const char code[] = " #include \" /\"\n " ;
1968+ simplecpp::OutputList outputList;
1969+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1970+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: \" /\"\n " , toString (outputList));
1971+ }
1972+
1973+ static void missingHeader6 ()
1974+ {
1975+ // this is a directory
1976+ const char code[] = " #include \" /usr\"\n " ;
1977+ simplecpp::OutputList outputList;
1978+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1979+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: \" /usr\"\n " , toString (outputList));
1980+ }
1981+
1982+ static void missingHeader7 ()
1983+ {
1984+ // this is a directory
1985+ const char code[] = " #include </>\n " ;
1986+ simplecpp::OutputList outputList;
1987+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1988+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: </>\n " , toString (outputList));
1989+ }
1990+
1991+ static void missingHeader8 ()
1992+ {
1993+ // this is a directory
1994+ const char code[] = " #include </usr>\n " ;
1995+ simplecpp::OutputList outputList;
1996+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1997+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: </usr>\n " , toString (outputList));
1998+ }
1999+ #endif
2000+
19632001static void nestedInclude ()
19642002{
19652003 const char code[] = " #include \" test.h\"\n " ;
@@ -3197,6 +3235,12 @@ int main(int argc, char **argv)
31973235 TEST_CASE (missingHeader2);
31983236 TEST_CASE (missingHeader3);
31993237 TEST_CASE (missingHeader4);
3238+ #ifndef _WIN32
3239+ TEST_CASE (missingHeader5);
3240+ TEST_CASE (missingHeader6);
3241+ TEST_CASE (missingHeader7);
3242+ TEST_CASE (missingHeader8);
3243+ #endif
32003244 TEST_CASE (nestedInclude);
32013245 TEST_CASE (systemInclude);
32023246
0 commit comments