From c51d82a0ed0e3bf2e1dcd9cc106686a02ca94988 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:31:16 -0400 Subject: [PATCH] Add test --- src/cursor.jl | 2 +- test/generators.jl | 5 +++++ test/include/elaborateEnum.h | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/include/elaborateEnum.h diff --git a/src/cursor.jl b/src/cursor.jl index c791dd31..91ce21f6 100644 --- a/src/cursor.jl +++ b/src/cursor.jl @@ -228,7 +228,7 @@ Return the integer value of an enum constant declaration. function value(c::CLEnumConstantDecl)::Integer typeKind = kind(getCursorType(c)) - # PR ??? + # PR 519 if typeKind == CXType_Elaborated typeKind = getCursorType(c) |> get_elaborated_cursor |> diff --git a/test/generators.jl b/test/generators.jl index 3f8c9d28..d17673d4 100644 --- a/test/generators.jl +++ b/test/generators.jl @@ -206,6 +206,11 @@ end @test_logs (:info, "Done!") match_mode = :any build!(ctx) end +@testset "PR 519 - Elaborated Enum" begin + ctx = create_context([joinpath(@__DIR__, "include/elaborateEnum.h")], get_default_args()) + @test_logs (:info, "Done!") match_mode = :any build!(ctx) +end + @testset "Issue 452 - StructMutualRef" begin ctx = create_context([joinpath(@__DIR__, "include/struct-mutual-ref.h")], get_default_args()) @test_logs (:info, "Done!") match_mode = :any build!(ctx) diff --git a/test/include/elaborateEnum.h b/test/include/elaborateEnum.h new file mode 100644 index 00000000..9923df66 --- /dev/null +++ b/test/include/elaborateEnum.h @@ -0,0 +1,7 @@ +#include + +enum X : uint32_t { + A = 2, + B = 4, + C = 6, +};