C0 code coverage information
Generated on Wed Aug 01 14:04:27 -0300 2007 with rcov 0.8.0
Code reported as executed by Ruby looks like this...
and this: this line is also marked as covered.
Lines considered as run by rcov, but not reported by Ruby, look like this,
and this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not executed.
| Name |
Total lines |
Lines of code |
Total coverage |
Code coverage |
|
lib/utils.rb
|
78
|
53
|
|
|
1 module YAJD
2
3 module Util
4
5 class SignedNum
6
7 #TODO how can I prohibit the creation of instances?
8
9 #TODO change the name or merge it with to_little_endian
10 def self.to_little_endian_byte(value)
def self.to_little_endian_byte(value)
26 lib/visitor/javap/code_info.rb:179 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
18 lib/visitor/javap/code_info.rb:152 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
11 (value & 0x7f) + (value & 0x80 == 0x80 ? -128 : 0)
12 end
13
14 # change the array content (2 or 4 bytes) from a number in
15 # network order to a signed number in little endian.
16 def self.to_little_endian(arr)
def self.to_little_endian(arr)
1393 lib/visitor/javap/code_info.rb:236 in 'YAJD::Visitor::Javap::CodeInfoVisitor#object_ref'
518 lib/constant_pool/numbers.rb:47 in 'YAJD::ConstantPool::CLong#value'
217 lib/visitor/javap/code_info.rb:175 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
29 lib/visitor/javap/code_info.rb:120 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
10 lib/visitor/javap/code_info.rb:186 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
7 lib/ext/file.rb:46 in 'File#read_int'
3 lib/visitor/javap/code_info.rb:202 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
1 lib/visitor/javap/code_info.rb:191 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
1 lib/visitor/javap/code_info.rb:190 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
1 lib/visitor/javap/code_info.rb:192 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
17 if [2, 4, 8].include?(arr.size)
18 size = arr.size
19 x = 0
20 exp = 8 * size - 1
21 size.times do |i|
22 x += arr[i] << (8 * (size - 1 - i))
23 end
24 aux = x & ((2 ** exp) - 1)
25 aux -= (2 ** exp) unless x & (2 ** exp) == 0
26 aux
27 else
28 raise "invalid length (#{arr.size})"
29 end
30 end
31 end
32
33 module Java
34 def self.quote(value)
def self.quote(value)
978 lib/visitor/javap/class_file.rb:117 in 'YAJD::Visitor::Javap::ClassFileVisitor#constant_entry'
48 lib/visitor/javap/code_info.rb:116 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
47 lib/visitor/javap/class_file.rb:115 in 'YAJD::Visitor::Javap::ClassFileVisitor#constant_entry'
29 lib/visitor/javap/code_info.rb:125 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
35 #TODO http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4324508 a char \u0000 is represented as C0 80. I think there will be problems with utf-8
36 replaces = {
37 /\xC0\x80/ => "\x0",
38 /"/ => '\"',
39 /\t/ => '\t',
40 /\r/ => '\r',
41 /\n/ => '\n',
42 }
43 aux = value.dup
44 replaces.each { |k, v| aux.gsub!(k, v) }
45
46 aux
47 end
48
49 #TODO find another place to put this function
50 def self.is_init?(what)
def self.is_init?(what)
676 lib/visitor/javap/class_file.rb:145 in 'YAJD::Visitor::Javap::ClassFileVisitor#name_type'
164 lib/visitor/javap/code_info.rb:92 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
51 '<init>' == what or '<clinit>' == what
52 end
53
54 #TODO find another place to put this function
55 def self.is_array?(what)
def self.is_array?(what)
472 lib/visitor/javap/class_file.rb:152 in 'YAJD::Visitor::Javap::ClassFileVisitor#klass'
36 lib/visitor/javap/code_info.rb:149 in 'YAJD::Visitor::Javap::CodeInfoVisitor#refactor_me'
56 #TODO rewrite it
57 !what.nil? && what.length > 0 && what[0] == '['[0]
58 end
59
60 # Internal Fully Qualified Form
61 class FQF
62 private
63 def initialize
64 end
65 public
66 # converts an internal class/interface name to a java classname (also deletes the java.lang. package reference)
67 def self.to_java(method_descriptor)
def self.to_java(method_descriptor)
491 lib/constant_pool/cpinfo.rb:99 in 'YAJD::ConstantPool::CClass#name'
433 lib/descriptor.rb:42 in 'YAJD::Descriptor#parse'
68 method_descriptor.tr('/', '.')
69 #TODO might be useful later
70 #gsub(/^java\.lang\./, '')
71 end
72 end
73
74 end
75
76 end
77
78 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.