// Copyright (c) 2013, Benjamin J. Kelly ("Author")
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

'use strict';

var UdpStream = require('../stream');

module.exports.nop = function(test) {
  test.expect(1);
  var ustream = new UdpStream();
  test.ok(ustream instanceof UdpStream);
  test.done();
};

@@ -1429,125 +1429,1190 @@
 );%0A%0A
-module.exports.nop = function(test) %7B%0A  test.expect(1);%0A  var ustream = new UdpStream();%0A  test.ok(ustream instanceof
+var UdpHeader = require('udp-header');%0A%0Amodule.exports.writeBuffer = function(test) %7B%0A  test.expect(1);%0A%0A  var udp = new UdpHeader(%7B%0A    srcPort: 123,%0A    dstPort: 456,%0A    dataLength: 50%0A  %7D);%0A%0A  var ustream = new UdpStream();%0A  ustream.on('readable', function() %7B%0A    var msg = ustream.read();%0A%0A    test.deepEqual(udp, msg.udp);%0A  %7D);%0A%0A  ustream.on('end', function() %7B%0A    test.done();%0A  %7D);%0A%0A  ustream.read(0);%0A%0A  ustream.write(udp.toBuffer());%0A  ustream.end();%0A%7D;%0A%0Amodule.exports.writeObject = function(test) %7B%0A  test.expect(1);%0A%0A  var udp = new UdpHeader(%7B%0A    srcPort: 123,%0A    dstPort: 456,%0A    dataLength: 50%0A  %7D);%0A%0A  var ustream = new UdpStream();%0A  ustream.on('readable', function() %7B%0A    var msg = ustream.read();%0A%0A    test.deepEqual(udp, msg.udp);%0A  %7D);%0A%0A  ustream.on('end', function() %7B%0A    test.done();%0A  %7D);%0A%0A  ustream.read(0);%0A%0A  ustream.write(%7B data: udp.toBuffer(), ip: %7B protocol: 'udp' %7D %7D);%0A  ustream.end();%0A%7D;%0A%0Amodule.exports.ignoreObject = function(test) %7B%0A  test.expect(1);%0A%0A  var udp = new UdpHeader(%7B%0A    srcPort: 123,%0A    dstPort: 456,%0A    dataLength: 50%0A  %7D);%0A%0A  var msg = %7B%0A    data: udp.toBuffer(),%0A    ip: %7B protocol: 'tcp' %7D%0A  %7D;%0A%0A  var ustream = new
  Udp
@@ -2621,22 +2621,209 @@
 ream
+(
 );%0A  
-test.done
+ustream.on('ignored', function(ignored) %7B%0A    test.deepEqual(msg, ignored);%0A  %7D);%0A%0A  ustream.on('end', function() %7B%0A    test.done();%0A  %7D);%0A%0A  ustream.read(0);%0A%0A  ustream.write(msg);%0A  ustream.end
 ();%0A

Add tests.