@@ -1944,6 +1944,44 @@ static void missingHeader4()
19441944 ASSERT_EQUALS (" file0,1,syntax_error,No header in #include\n " , toString (outputList));
19451945}
19461946
1947+ #ifndef _WIN32
1948+ static void missingHeader5 ()
1949+ {
1950+ // this is a directory
1951+ const char code[] = " #include \" /\"\n " ;
1952+ simplecpp::OutputList outputList;
1953+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1954+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: \" /\"\n " , toString (outputList));
1955+ }
1956+
1957+ static void missingHeader6 ()
1958+ {
1959+ // this is a directory
1960+ const char code[] = " #include \" /usr\"\n " ;
1961+ simplecpp::OutputList outputList;
1962+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1963+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: \" /usr\"\n " , toString (outputList));
1964+ }
1965+
1966+ static void missingHeader7 ()
1967+ {
1968+ // this is a directory
1969+ const char code[] = " #include </>\n " ;
1970+ simplecpp::OutputList outputList;
1971+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1972+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: </>\n " , toString (outputList));
1973+ }
1974+
1975+ static void missingHeader8 ()
1976+ {
1977+ // this is a directory
1978+ const char code[] = " #include </usr>\n " ;
1979+ simplecpp::OutputList outputList;
1980+ ASSERT_EQUALS (" " , preprocess (code, &outputList));
1981+ ASSERT_EQUALS (" file0,1,missing_header,Header not found: </usr>\n " , toString (outputList));
1982+ }
1983+ #endif
1984+
19471985static void nestedInclude ()
19481986{
19491987 const char code[] = " #include \" test.h\"\n " ;
@@ -3180,6 +3218,12 @@ int main(int argc, char **argv)
31803218 TEST_CASE (missingHeader2);
31813219 TEST_CASE (missingHeader3);
31823220 TEST_CASE (missingHeader4);
3221+ #ifndef _WIN32
3222+ TEST_CASE (missingHeader5);
3223+ TEST_CASE (missingHeader6);
3224+ TEST_CASE (missingHeader7);
3225+ TEST_CASE (missingHeader8);
3226+ #endif
31833227 TEST_CASE (nestedInclude);
31843228 TEST_CASE (systemInclude);
31853229
0 commit comments