Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Dec 9, 2024
1 parent 1e0d99f commit c51d82a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cursor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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 |>
Expand Down
5 changes: 5 additions & 0 deletions test/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions test/include/elaborateEnum.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdint.h>

enum X : uint32_t {
A = 2,
B = 4,
C = 6,
};

0 comments on commit c51d82a

Please sign in to comment.