1
0
Fork 0

Use the debug assert macros

This commit is contained in:
Robbert van der Helm 2022-01-26 11:38:26 +01:00
parent 922aa58a7a
commit d8db0e64cf
2 changed files with 4 additions and 3 deletions

View file

@ -70,7 +70,6 @@ macro_rules! impl_plainparam {
/// ///
/// TODO: After implementing VST3, check if we handle parsing failures correctly /// TODO: After implementing VST3, check if we handle parsing failures correctly
pub fn from_string(&mut self, string: &str) -> bool { pub fn from_string(&mut self, string: &str) -> bool {
// TODO: Debug asserts on failures
let value = match &self.string_to_value { let value = match &self.string_to_value {
Some(f) => f(string), Some(f) => f(string),
// TODO: Check how Rust's parse function handles trailing garbage // TODO: Check how Rust's parse function handles trailing garbage

View file

@ -14,6 +14,9 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#[macro_use]
extern crate nih_plug;
use nih_plug::{ use nih_plug::{
params::{FloatParam, Params, Range}, params::{FloatParam, Params, Range},
plugin::{BufferConfig, BusConfig, Plugin}, plugin::{BufferConfig, BusConfig, Plugin},
@ -87,9 +90,8 @@ impl Plugin for Gain {
let num_channels = samples.len(); let num_channels = samples.len();
let num_samples = samples[0].len(); let num_samples = samples[0].len();
for channel in &samples[1..] { for channel in &samples[1..] {
nih_debug_assert_eq!(channel.len(), num_samples);
if channel.len() != num_samples { if channel.len() != num_samples {
// TODO: Debug assert
eprintln!("Mismatched channel lengths, aborting");
return; return;
} }
} }