From 69ad6d6b7af4a7a121e04710695bb75196c5de95 Mon Sep 17 00:00:00 2001 From: Alex Young Date: Sat, 14 Jul 2012 17:25:26 +0100 Subject: [PATCH] Only copy constants from C to Ruby once This avoids unnecessary duplicate constant warnings for C constants that are defined in two legs of an #ifdef. --- tests/acceptance/flexnbd/constants.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/flexnbd/constants.rb b/tests/acceptance/flexnbd/constants.rb index 1989732..128a8bf 100644 --- a/tests/acceptance/flexnbd/constants.rb +++ b/tests/acceptance/flexnbd/constants.rb @@ -23,7 +23,8 @@ module FlexNBD txt_lines = File.readlines( header_filename ) txt_lines.each do |line| if line =~ /^#\s*define\s+([A-Z0-9_]+)\s+(\d+)\s*$/ - const_set($1, $2.to_i) + # Bodge until I can figure out what to do with #ifdefs + const_set($1, $2.to_i) unless constants.include?( $1 ) end end end