Skip to content

Commit ac304d5

Browse files
authored
[libc] newheadergen: quick fixes to tests (#98561)
- if there is an object made there is a space after - fixed tests.yaml -- spacing between characters issue
1 parent d0d05ae commit ac304d5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

libc/newhdrgen/header.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def __str__(self):
6262
content.append("")
6363
for object in self.objects:
6464
content.append(str(object))
65-
content.append("__END_C_DECLS")
65+
if self.objects:
66+
content.append("\n__END_C_DECLS")
67+
else:
68+
content.append("__END_C_DECLS")
6669

6770
return "\n".join(content)

libc/newhdrgen/tests/expected_output/test_header.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ enum {
2727
__BEGIN_C_DECLS
2828

2929
#ifdef FUNC_A_16
30-
void func_a()CONST_FUNC_A;
30+
CONST_FUNC_A void func_a() __NOEXCEPT;
3131
#endif // FUNC_A_16
3232

3333
#ifdef FUNC_B_16
34-
int func_b(int, float)CONST_FUNC_B;
34+
CONST_FUNC_B int func_b(int, float) __NOEXCEPT;
3535
#endif // FUNC_B_16
3636

3737
extern obj object_1;

libc/newhdrgen/tests/input/test_small.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ functions:
2424
standards:
2525
- stdc
2626
guard: FUNC_A_16
27-
attributes: CONST_FUNC_A
27+
attributes:
28+
- CONST_FUNC_A
2829
- name: func_b
2930
return_type: int
3031
arguments:
@@ -33,4 +34,5 @@ functions:
3334
standards:
3435
- stdc
3536
guard: FUNC_B_16
36-
attributes: CONST_FUNC_B
37+
attributes:
38+
- CONST_FUNC_B

0 commit comments

Comments
 (0)