-#!/usr/bin/ruby
+#!/usr/bin/ruby
# nessie_check.rb
=begin
This file is part of the AVR-Crypto-Lib.
def skip_header(file)
begin
l = file.gets().strip
+ l = '' if !l
end until /[*]{10,}.*/.match(l)
begin
l = file.gets().strip
+ l = '' if !l
end until /[*]{10,}.*/.match(l)
begin
l = file.gets().strip
+ l = '' if !l
end until /[=]{5,}.*/.match(l)
begin
l = file.gets().strip
+ l = '' if !l
end until /[=]{5,}.*/.match(l)
end
return nil if file.eof
l = file.gets().strip()
if not /[^=]+=[^=]+/.match(l)
- value += l if /[0-9A-Fa-f]{5}/.match(l)
+ value += l if /^[0-9A-Fa-f]{5}/.match(l)
end
end until /[^=]+=[^=]+/.match(l)
$last_assign[i] = l
return nil if file.eof
l = file.gets().strip()
if not /[^=]+=[^=]+/.match(l)
- value += l if /[0-9A-Fa-f]{5}/.match(l)
+ value += l if /^[0-9A-Fa-f]{5}/.match(l)
end
end until /[^=]+=[^=]+/.match(l)
$last_assign[i] = l
pos +=1
end
if(a!=b and a!=nil and b!=nil)
- $error = 1
- puts("a key: "+a[0]+" value: "+a[1])
- puts("b key: "+b[0]+" value: "+b[1])
- end
+ $error += 1
+# puts("a key: "+a[0]+" value: "+a[1])
+# puts("b key: "+b[0]+" value: "+b[1])
+ end
end until a==nil or b==nil
end
$quiet=true
end
else
- f1 = ARGV[1]
- f2 = ARGV[2]
+ f1 = ARGV[0]
+ f2 = ARGV[1]
end
-
+
puts("compare("+f1+", "+f2+")")
compare(f1, f2)
-puts($error==0?"[ok]":"[failed]")
+if $error!=0
+ puts("[failed] ("+$error.to_s()+")")
+else
+ puts("[ok]")
+end
exit($error)