11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ciconst dgram = require('dgram');
51cb0ef41Sopenharmony_ciconst socket = dgram.createSocket('udp4');
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ciconst errObj = {
81cb0ef41Sopenharmony_ci  code: 'ERR_INVALID_ARG_TYPE',
91cb0ef41Sopenharmony_ci  name: 'TypeError',
101cb0ef41Sopenharmony_ci  message: 'The "offset" argument must be of type number. Received ' +
111cb0ef41Sopenharmony_ci           'undefined'
121cb0ef41Sopenharmony_ci};
131cb0ef41Sopenharmony_ciassert.throws(() => socket.sendto(), errObj);
141cb0ef41Sopenharmony_ci
151cb0ef41Sopenharmony_cierrObj.message = 'The "length" argument must be of type number. Received ' +
161cb0ef41Sopenharmony_ci                 "type string ('offset')";
171cb0ef41Sopenharmony_ciassert.throws(
181cb0ef41Sopenharmony_ci  () => socket.sendto('buffer', 1, 'offset', 'port', 'address', 'cb'),
191cb0ef41Sopenharmony_ci  errObj);
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_cierrObj.message = 'The "offset" argument must be of type number. Received ' +
221cb0ef41Sopenharmony_ci                 "type string ('offset')";
231cb0ef41Sopenharmony_ciassert.throws(
241cb0ef41Sopenharmony_ci  () => socket.sendto('buffer', 'offset', 1, 'port', 'address', 'cb'),
251cb0ef41Sopenharmony_ci  errObj);
261cb0ef41Sopenharmony_ci
271cb0ef41Sopenharmony_cierrObj.message = 'The "address" argument must be of type string. Received ' +
281cb0ef41Sopenharmony_ci                 'type boolean (false)';
291cb0ef41Sopenharmony_ciassert.throws(
301cb0ef41Sopenharmony_ci  () => socket.sendto('buffer', 1, 1, 10, false, 'cb'),
311cb0ef41Sopenharmony_ci  errObj);
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_cierrObj.message = 'The "port" argument must be of type number. Received ' +
341cb0ef41Sopenharmony_ci                 'type boolean (false)';
351cb0ef41Sopenharmony_ciassert.throws(
361cb0ef41Sopenharmony_ci  () => socket.sendto('buffer', 1, 1, false, 'address', 'cb'),
371cb0ef41Sopenharmony_ci  errObj);
38