From 723e690027209c8e613c729def6a9367e197b00f Mon Sep 17 00:00:00 2001 From: Andreas Dinter Date: Sun, 26 Jan 2020 13:26:25 +0100 Subject: [PATCH] Add test cases for 'sort_by' option --- tests/expectations/both/function_sort_name.c | 12 +++++++++++ .../both/function_sort_name.compat.c | 20 +++++++++++++++++++ tests/expectations/both/function_sort_none.c | 12 +++++++++++ .../both/function_sort_none.compat.c | 20 +++++++++++++++++++ tests/expectations/function_sort_name.c | 12 +++++++++++ .../expectations/function_sort_name.compat.c | 20 +++++++++++++++++++ tests/expectations/function_sort_name.cpp | 16 +++++++++++++++ tests/expectations/function_sort_none.c | 12 +++++++++++ .../expectations/function_sort_none.compat.c | 20 +++++++++++++++++++ tests/expectations/function_sort_none.cpp | 16 +++++++++++++++ tests/expectations/tag/function_sort_name.c | 12 +++++++++++ .../tag/function_sort_name.compat.c | 20 +++++++++++++++++++ tests/expectations/tag/function_sort_none.c | 12 +++++++++++ .../tag/function_sort_none.compat.c | 20 +++++++++++++++++++ tests/rust/function_sort_name.rs | 15 ++++++++++++++ tests/rust/function_sort_none.rs | 15 ++++++++++++++ tests/rust/function_sort_none.toml | 2 ++ 17 files changed, 256 insertions(+) create mode 100644 tests/expectations/both/function_sort_name.c create mode 100644 tests/expectations/both/function_sort_name.compat.c create mode 100644 tests/expectations/both/function_sort_none.c create mode 100644 tests/expectations/both/function_sort_none.compat.c create mode 100644 tests/expectations/function_sort_name.c create mode 100644 tests/expectations/function_sort_name.compat.c create mode 100644 tests/expectations/function_sort_name.cpp create mode 100644 tests/expectations/function_sort_none.c create mode 100644 tests/expectations/function_sort_none.compat.c create mode 100644 tests/expectations/function_sort_none.cpp create mode 100644 tests/expectations/tag/function_sort_name.c create mode 100644 tests/expectations/tag/function_sort_name.compat.c create mode 100644 tests/expectations/tag/function_sort_none.c create mode 100644 tests/expectations/tag/function_sort_none.compat.c create mode 100644 tests/rust/function_sort_name.rs create mode 100644 tests/rust/function_sort_none.rs create mode 100644 tests/rust/function_sort_none.toml diff --git a/tests/expectations/both/function_sort_name.c b/tests/expectations/both/function_sort_name.c new file mode 100644 index 0000000..341f6a7 --- /dev/null +++ b/tests/expectations/both/function_sort_name.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +void A(void); + +void B(void); + +void C(void); + +void D(void); diff --git a/tests/expectations/both/function_sort_name.compat.c b/tests/expectations/both/function_sort_name.compat.c new file mode 100644 index 0000000..9e8c7d6 --- /dev/null +++ b/tests/expectations/both/function_sort_name.compat.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void A(void); + +void B(void); + +void C(void); + +void D(void); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/both/function_sort_none.c b/tests/expectations/both/function_sort_none.c new file mode 100644 index 0000000..c7138c9 --- /dev/null +++ b/tests/expectations/both/function_sort_none.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +void C(void); + +void B(void); + +void D(void); + +void A(void); diff --git a/tests/expectations/both/function_sort_none.compat.c b/tests/expectations/both/function_sort_none.compat.c new file mode 100644 index 0000000..a6138f7 --- /dev/null +++ b/tests/expectations/both/function_sort_none.compat.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void C(void); + +void B(void); + +void D(void); + +void A(void); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/function_sort_name.c b/tests/expectations/function_sort_name.c new file mode 100644 index 0000000..341f6a7 --- /dev/null +++ b/tests/expectations/function_sort_name.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +void A(void); + +void B(void); + +void C(void); + +void D(void); diff --git a/tests/expectations/function_sort_name.compat.c b/tests/expectations/function_sort_name.compat.c new file mode 100644 index 0000000..9e8c7d6 --- /dev/null +++ b/tests/expectations/function_sort_name.compat.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void A(void); + +void B(void); + +void C(void); + +void D(void); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/function_sort_name.cpp b/tests/expectations/function_sort_name.cpp new file mode 100644 index 0000000..267c080 --- /dev/null +++ b/tests/expectations/function_sort_name.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include + +extern "C" { + +void A(); + +void B(); + +void C(); + +void D(); + +} // extern "C" diff --git a/tests/expectations/function_sort_none.c b/tests/expectations/function_sort_none.c new file mode 100644 index 0000000..c7138c9 --- /dev/null +++ b/tests/expectations/function_sort_none.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +void C(void); + +void B(void); + +void D(void); + +void A(void); diff --git a/tests/expectations/function_sort_none.compat.c b/tests/expectations/function_sort_none.compat.c new file mode 100644 index 0000000..a6138f7 --- /dev/null +++ b/tests/expectations/function_sort_none.compat.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void C(void); + +void B(void); + +void D(void); + +void A(void); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/function_sort_none.cpp b/tests/expectations/function_sort_none.cpp new file mode 100644 index 0000000..715dcc8 --- /dev/null +++ b/tests/expectations/function_sort_none.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include + +extern "C" { + +void C(); + +void B(); + +void D(); + +void A(); + +} // extern "C" diff --git a/tests/expectations/tag/function_sort_name.c b/tests/expectations/tag/function_sort_name.c new file mode 100644 index 0000000..341f6a7 --- /dev/null +++ b/tests/expectations/tag/function_sort_name.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +void A(void); + +void B(void); + +void C(void); + +void D(void); diff --git a/tests/expectations/tag/function_sort_name.compat.c b/tests/expectations/tag/function_sort_name.compat.c new file mode 100644 index 0000000..9e8c7d6 --- /dev/null +++ b/tests/expectations/tag/function_sort_name.compat.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void A(void); + +void B(void); + +void C(void); + +void D(void); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/expectations/tag/function_sort_none.c b/tests/expectations/tag/function_sort_none.c new file mode 100644 index 0000000..c7138c9 --- /dev/null +++ b/tests/expectations/tag/function_sort_none.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include + +void C(void); + +void B(void); + +void D(void); + +void A(void); diff --git a/tests/expectations/tag/function_sort_none.compat.c b/tests/expectations/tag/function_sort_none.compat.c new file mode 100644 index 0000000..a6138f7 --- /dev/null +++ b/tests/expectations/tag/function_sort_none.compat.c @@ -0,0 +1,20 @@ +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +void C(void); + +void B(void); + +void D(void); + +void A(void); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/tests/rust/function_sort_name.rs b/tests/rust/function_sort_name.rs new file mode 100644 index 0000000..ecd23c1 --- /dev/null +++ b/tests/rust/function_sort_name.rs @@ -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() +{ } diff --git a/tests/rust/function_sort_none.rs b/tests/rust/function_sort_none.rs new file mode 100644 index 0000000..ecd23c1 --- /dev/null +++ b/tests/rust/function_sort_none.rs @@ -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() +{ } diff --git a/tests/rust/function_sort_none.toml b/tests/rust/function_sort_none.toml new file mode 100644 index 0000000..27c7839 --- /dev/null +++ b/tests/rust/function_sort_none.toml @@ -0,0 +1,2 @@ +[fn] +sort_by = "None"