From 26e5948617e4aad8612bfb0ac958a5f483898716 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 20 May 2019 23:50:38 +0100 Subject: Close #2516 - Handle problems with inlined functions --- test/handler/test_gcc_handler.vader | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'test/handler/test_gcc_handler.vader') diff --git a/test/handler/test_gcc_handler.vader b/test/handler/test_gcc_handler.vader index 3daa9e60..b67483a6 100644 --- a/test/handler/test_gcc_handler.vader +++ b/test/handler/test_gcc_handler.vader @@ -217,3 +217,65 @@ Execute(The GCC handler should handle fatal error messages due to missing files) \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [ \ ':3:12: fatal error: foo.h: No such file or directory', \ ]) + +Execute(The GCC handler should handle errors for inlined header functions): + AssertEqual + \ [ + \ { + \ 'lnum': 50, + \ 'col': 4, + \ 'filename': '/usr/include/bits/fcntl2.h', + \ 'type': 'E', + \ 'text': 'call to ''__open_missing_mode'' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments', + \ }, + \ { + \ 'lnum': 44, + \ 'col': 5, + \ 'filename': '/usr/include/bits/fcntl2.h', + \ 'type': 'E', + \ 'text': 'call to ''__open_too_many_args'' declared with attribute error: open can be called either with 2 or 3 arguments, not more', + \ }, + \ { + \ 'lnum': 7, + \ 'col': 10, + \ 'type': 'E', + \ 'text': 'call to ''__open_missing_mode'' declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments', + \ }, + \ { + \ 'lnum': 13, + \ 'col': 11, + \ 'type': 'E', + \ 'text': 'call to ''__open_too_many_args'' declared with attribute error: open can be called either with 2 or 3 arguments, not more', + \ }, + \ { + \ 'lnum': 1, + \ 'text': 'Error found in header. See :ALEDetail', + \ 'detail': join([ + \ 'In file included from /usr/include/fcntl.h:328,', + \ ' from :1:', + \ 'In function ‘open’,', + \ ' inlined from ‘main’ at :7:10:', + \ '/usr/include/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments', + \ ' __open_missing_mode ();', + \ ' ^~~~~~~~~~~~~~~~~~~~~~', + \ 'In function ‘open’,', + \ ' inlined from ‘main’ at :13:11:', + \ '/usr/include/bits/fcntl2.h:44:5: error: call to ‘__open_too_many_args’ declared with attribute error: open can be called either with 2 or 3 arguments, not more', + \ ' __open_too_many_args ();', + \ ], "\n") + \ }, + \], + \ ale#handlers#gcc#HandleGCCFormatWithIncludes(347, [ + \ 'In file included from /usr/include/fcntl.h:328,', + \ ' from :1:', + \ 'In function ‘open’,', + \ ' inlined from ‘main’ at :7:10:', + \ '/usr/include/bits/fcntl2.h:50:4: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT or O_TMPFILE in second argument needs 3 arguments', + \ ' __open_missing_mode ();', + \ ' ^~~~~~~~~~~~~~~~~~~~~~', + \ 'In function ‘open’,', + \ ' inlined from ‘main’ at :13:11:', + \ '/usr/include/bits/fcntl2.h:44:5: error: call to ‘__open_too_many_args’ declared with attribute error: open can be called either with 2 or 3 arguments, not more', + \ ' __open_too_many_args ();', + \ ' ^~~~~~~~~~~~~~~~~~~~~~~', + \ ]) -- cgit v1.2.3