Skip to content

Commit

Permalink
adding tests for double64 type
Browse files Browse the repository at this point in the history
  • Loading branch information
aberant committed Aug 18, 2013
1 parent 9d43128 commit c3c092a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/builders/message_builder.rb
Expand Up @@ -16,6 +16,11 @@ def with_float( float )
with_arg( "f", float )
self
end

def with_double( double )
with_arg( "d", double)
self
end

def with_int( int )
with_arg( "i", int )
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/osc_simple_packets_spec.rb
Expand Up @@ -105,4 +105,14 @@
args = msg.first.to_a
args.first.must_equal( @first_blob )
end

it "should decode messages with double64 types" do
pi = 3.14159

sent_msg = @builder.with_double( pi ).build
msg = OSC::OSCPacket.messages_from_network( sent_msg.encode )

args = msg.first.to_a
args.first.must_be_close_to( pi, 0.001 )
end
end
6 changes: 6 additions & 0 deletions spec/unit/osc_types_spec.rb
Expand Up @@ -12,6 +12,12 @@
end
end

describe OSC::OSCDouble64 do
it "should not blow up" do
OSC::OSCDouble64.new 1.0
end
end

describe OSC::OSCString do
it "should not blow up" do
OSC::OSCString.new "1"
Expand Down

0 comments on commit c3c092a

Please sign in to comment.