Skip to content

Commit

Permalink
Add test cases for 'sort_by' option
Browse files Browse the repository at this point in the history
  • Loading branch information
systec-ad authored and emilio committed Jan 27, 2020
1 parent f5edc2c commit 723e690
Show file tree
Hide file tree
Showing 17 changed files with 256 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/expectations/both/function_sort_name.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

void A(void);

void B(void);

void C(void);

void D(void);
20 changes: 20 additions & 0 deletions tests/expectations/both/function_sort_name.compat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void A(void);

void B(void);

void C(void);

void D(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
12 changes: 12 additions & 0 deletions tests/expectations/both/function_sort_none.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

void C(void);

void B(void);

void D(void);

void A(void);
20 changes: 20 additions & 0 deletions tests/expectations/both/function_sort_none.compat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void C(void);

void B(void);

void D(void);

void A(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
12 changes: 12 additions & 0 deletions tests/expectations/function_sort_name.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

void A(void);

void B(void);

void C(void);

void D(void);
20 changes: 20 additions & 0 deletions tests/expectations/function_sort_name.compat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void A(void);

void B(void);

void C(void);

void D(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
16 changes: 16 additions & 0 deletions tests/expectations/function_sort_name.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <new>

extern "C" {

void A();

void B();

void C();

void D();

} // extern "C"
12 changes: 12 additions & 0 deletions tests/expectations/function_sort_none.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

void C(void);

void B(void);

void D(void);

void A(void);
20 changes: 20 additions & 0 deletions tests/expectations/function_sort_none.compat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void C(void);

void B(void);

void D(void);

void A(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
16 changes: 16 additions & 0 deletions tests/expectations/function_sort_none.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <new>

extern "C" {

void C();

void B();

void D();

void A();

} // extern "C"
12 changes: 12 additions & 0 deletions tests/expectations/tag/function_sort_name.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

void A(void);

void B(void);

void C(void);

void D(void);
20 changes: 20 additions & 0 deletions tests/expectations/tag/function_sort_name.compat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void A(void);

void B(void);

void C(void);

void D(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
12 changes: 12 additions & 0 deletions tests/expectations/tag/function_sort_none.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

void C(void);

void B(void);

void D(void);

void A(void);
20 changes: 20 additions & 0 deletions tests/expectations/tag/function_sort_none.compat.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus

void C(void);

void B(void);

void D(void);

void A(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
15 changes: 15 additions & 0 deletions tests/rust/function_sort_name.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#[no_mangle]
pub extern "C" fn C()
{ }

#[no_mangle]
pub extern "C" fn B()
{ }

#[no_mangle]
pub extern "C" fn D()
{ }

#[no_mangle]
pub extern "C" fn A()
{ }
15 changes: 15 additions & 0 deletions tests/rust/function_sort_none.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#[no_mangle]
pub extern "C" fn C()
{ }

#[no_mangle]
pub extern "C" fn B()
{ }

#[no_mangle]
pub extern "C" fn D()
{ }

#[no_mangle]
pub extern "C" fn A()
{ }
2 changes: 2 additions & 0 deletions tests/rust/function_sort_none.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[fn]
sort_by = "None"

0 comments on commit 723e690

Please sign in to comment.