From 71dc033fcaf9b6a779642fd413738cd01bac1ac2 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Thu, 16 Aug 2018 07:09:52 +0900 Subject: [PATCH] Add a test for #2919 --- tests/source/macro_rules.rs | 16 ++++++++++++++++ tests/target/macro_rules.rs | 28 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/tests/source/macro_rules.rs b/tests/source/macro_rules.rs index e8f9aa505ac..b2d9c1199c5 100644 --- a/tests/source/macro_rules.rs +++ b/tests/source/macro_rules.rs @@ -263,3 +263,19 @@ macro_rules! impl_as_byte_slice_arrays { } }; } + +// #2919 +fn foo() { + { + macro_rules! touch_value { + ($func:ident, $value:expr) => {{ + let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendMode::paTouch); + let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppend); + let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM); + let result = APIIIIIIIII::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM); + let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendMMMMMMMMMM); + debug_assert!(result == 0); + }}; + } + } +} diff --git a/tests/target/macro_rules.rs b/tests/target/macro_rules.rs index 4f31519faaf..281d655a8d8 100644 --- a/tests/target/macro_rules.rs +++ b/tests/target/macro_rules.rs @@ -305,3 +305,31 @@ macro_rules! impl_as_byte_slice_arrays { } }; } + +// #2919 +fn foo() { + { + macro_rules! touch_value { + ($func:ident, $value:expr) => {{ + let result = API::get_cached().$func( + self, + key.as_ptr(), + $value, + ffi::VSPropAppendMode::paTouch, + ); + let result = API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppend); + let result = + API::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM); + let result = + APIIIIIIIII::get_cached().$func(self, key.as_ptr(), $value, ffi::VSPropAppendM); + let result = API::get_cached().$func( + self, + key.as_ptr(), + $value, + ffi::VSPropAppendMMMMMMMMMM, + ); + debug_assert!(result == 0); + }}; + } + } +}