Skip to content

Commit

Permalink
[libc] newheadergen: quick fixes to tests (#98561)
Browse files Browse the repository at this point in the history
- if there is an object made there is a space after
- fixed tests.yaml -- spacing between characters issue
  • Loading branch information
aaryanshukla authored Jul 11, 2024
1 parent d0d05ae commit ac304d5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion libc/newhdrgen/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def __str__(self):
content.append("")
for object in self.objects:
content.append(str(object))
content.append("__END_C_DECLS")
if self.objects:
content.append("\n__END_C_DECLS")
else:
content.append("__END_C_DECLS")

return "\n".join(content)
4 changes: 2 additions & 2 deletions libc/newhdrgen/tests/expected_output/test_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ enum {
__BEGIN_C_DECLS

#ifdef FUNC_A_16
void func_a()CONST_FUNC_A;
CONST_FUNC_A void func_a() __NOEXCEPT;
#endif // FUNC_A_16

#ifdef FUNC_B_16
int func_b(int, float)CONST_FUNC_B;
CONST_FUNC_B int func_b(int, float) __NOEXCEPT;
#endif // FUNC_B_16

extern obj object_1;
Expand Down
6 changes: 4 additions & 2 deletions libc/newhdrgen/tests/input/test_small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ functions:
standards:
- stdc
guard: FUNC_A_16
attributes: CONST_FUNC_A
attributes:
- CONST_FUNC_A
- name: func_b
return_type: int
arguments:
Expand All @@ -33,4 +34,5 @@ functions:
standards:
- stdc
guard: FUNC_B_16
attributes: CONST_FUNC_B
attributes:
- CONST_FUNC_B

0 comments on commit ac304d5

Please sign in to comment.