diff options
Diffstat (limited to 'tests/headers')
-rw-r--r-- | tests/headers/blocklist-file.hpp | 18 | ||||
-rw-r--r-- | tests/headers/blocklisted/fake-stdint.h | 7 | ||||
-rw-r--r-- | tests/headers/blocklisted/file.hpp | 26 |
3 files changed, 51 insertions, 0 deletions
diff --git a/tests/headers/blocklist-file.hpp b/tests/headers/blocklist-file.hpp new file mode 100644 index 00000000..ad8bcd66 --- /dev/null +++ b/tests/headers/blocklist-file.hpp @@ -0,0 +1,18 @@ +// bindgen-flags: --blocklist-file ".*/blocklisted/file.*" -- -Itests/headers + +// Forward declaration of struct that's defined in a blocklisted file. +struct StructWithBlocklistedDefinition; + +#include "blocklisted/file.hpp" +#include "blocklisted/fake-stdint.h" + +struct SizedIntegers { + uint8_t x; + uint16_t y; + uint32_t z; +}; + +// Actual definition of struct that has a forward declaration in a blocklisted file. +struct StructWithBlocklistedFwdDecl { + uint8_t b; +}; diff --git a/tests/headers/blocklisted/fake-stdint.h b/tests/headers/blocklisted/fake-stdint.h new file mode 100644 index 00000000..a8cfe010 --- /dev/null +++ b/tests/headers/blocklisted/fake-stdint.h @@ -0,0 +1,7 @@ +// <stdint.h>-like types get special treatment even when blocklisted. +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; diff --git a/tests/headers/blocklisted/file.hpp b/tests/headers/blocklisted/file.hpp new file mode 100644 index 00000000..4bcb589e --- /dev/null +++ b/tests/headers/blocklisted/file.hpp @@ -0,0 +1,26 @@ +void SomeFunction(); +extern int someVar; +#define SOME_DEFUN 123 + +class someClass { + void somePrivateMethod(); +public: + void somePublicMethod(int foo); +}; + +extern "C" void ExternFunction(); + +namespace foo { + void NamespacedFunction(); +} + +namespace bar { + void NamespacedFunction(); +} + + +struct StructWithBlocklistedFwdDecl; + +struct StructWithBlocklistedDefinition { + StructWithBlocklistedFwdDecl* other; +}; |