--- /dev/null
+mocha.setup('bdd');
+
+var BASE_UUID_LAST_96_BITS = '-0000-1000-8000-00805f9b34fb';
+var ZEROS = '0000';
+
+describe('uuidTo128bit', function() {
+ it('should return 128 bit representation of given 16 bit UUID 1234', function(done) {
+ var UUID16Bit = '1234';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID16Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ it('should return 128 bit representation of given 16 bit UUID abcd', function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID16Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ it('should return 128 bit representation of given 16 bit UUID 90df', function(done) {
+ var UUID16Bit = '90df';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID16Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ it('should return 128 bit representation of given 16 bit UUID ABCD', function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID128Bit = ZEROS + UUID16Bit.toLowerCase() + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID16Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ it('should return 128 bit representation of given 16 bit UUID AbCd', function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID128Bit = ZEROS + UUID16Bit.toLowerCase() + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID16Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return 128 bit representation of given 32 bit UUID 1234abcd',
+ function(done) {
+ var UUID32Bit = '1234abcd';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID32Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return 128 bit representation of given 32 bit UUID 12340987',
+ function(done) {
+ var UUID32Bit = '12340987';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID32Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return 128 bit representation of given 32 bit UUID fedcabcd',
+ function(done) {
+ var UUID32Bit = 'fedcabcd';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID32Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return 128 bit representation of given 32 bit UUID ABCDEFAB',
+ function(done) {
+ var UUID32Bit = 'ABCDEFAB';
+ var UUID128Bit = UUID32Bit.toLowerCase() + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID32Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return 128 bit representation of given 32 bit UUID FeDcBaCA',
+ function(done) {
+ var UUID32Bit = 'FeDcBaCA';
+ var UUID128Bit = UUID32Bit.toLowerCase() + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID32Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bin UUID, 1234abcd-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID128Bit = '1234abcd-0000-1000-8000-00805f9b34fb';
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID128Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bin UUID, 12345678-9012-3456-7890-123456789012',
+ function(done) {
+ var UUID128Bit = '12345678-9012-3456-7890-123456789012';
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID128Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bin UUID, abcdefab-cdef-abcd-efab-cdefabcdefab',
+ function(done) {
+ var UUID128Bit = 'abcdefab-cdef-abcd-efab-cdefabcdefab';
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID128Bit)).to.equal(UUID128Bit);
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bin UUID, ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB',
+ function(done) {
+ var UUID128Bit = 'ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID128Bit)).to.equal(
+ UUID128Bit.toLowerCase()
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bin UUID, ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB',
+ function(done) {
+ var UUID128Bit = 'ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidTo128bit(UUID128Bit)).to.equal(
+ UUID128Bit.toLowerCase()
+ );
+ done();
+ });
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ 'NotAValidUUID',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('NotAValidUUID');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, 12t4',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('12t4');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, 123456t8',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('123456t8');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-00t0-0000-0000-1234567890ab',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('12345678-00t0-0000-0000-1234567890ab');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, 123',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('123');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, abcdef',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('abcdef');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-12345678901',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('12345678-9012-3456-7890-12345678901');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-1234567890123',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit('12345678-9012-3456-7890-1234567890123');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it('should throw InvalidValuesError if argument is undefined', function(done) {
+ try {
+ var undef;
+ tizen.bluetooth.uuidTo128bit(undef);
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it('should throw InvalidValuesError if argument is null', function(done) {
+ try {
+ tizen.bluetooth.uuidTo128bit(null);
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+});
+
+mocha.checkLeaks();
+mocha
+ .run()
+ .on('pass', function(test) {
+ console.log(test.title + ' OK');
+ })
+ .on('fail', function(test, err) {
+ console.error(test.title + ' FAILED');
+ console.error(err);
+ })
+ .on('end', function() {
+ console.log('All done');
+ });
--- /dev/null
+mocha.setup('bdd');
+var BASE_UUID_LAST_96_BITS = '-0000-1000-8000-00805f9b34fb';
+var ZEROS = '0000';
+
+describe('uuidToShortestPossible', function() {
+ it('should return 16 bit representation of given 128 bit UUID, 1234', function(done) {
+ var UUID16Bit = '1234';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 128 bit UUID, abcd', function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 128 bit UUID, 90df', function(done) {
+ var UUID16Bit = '90df';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 128 bit UUID, ABCD', function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ UUID16Bit = UUID16Bit.toLowerCase();
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 128 bit UUID, AbCd', function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ UUID16Bit = UUID16Bit.toLowerCase();
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 32 bit UUID, 1234', function(done) {
+ var UUID16Bit = '1234';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID32Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 32 bit UUID, abcd', function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID32Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 32 bit UUID, 90df', function(done) {
+ var UUID16Bit = '90df';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID32Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 32 bit UUID, ABCD', function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ UUID16Bit = UUID16Bit.toLowerCase();
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID32Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ it('should return 16 bit representation of given 32 bit UUID, AbCd', function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ UUID16Bit = UUID16Bit.toLowerCase();
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID32Bit)).to.equal(
+ UUID16Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return 32 bit representation of given 128 bit UUID, 12345678',
+ function(done) {
+ var UUID32Bit = '12347890';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID32Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return 32 bit representation of given 128 bit UUID, abcdefab',
+ function(done) {
+ var UUID32Bit = 'abcdefab';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID32Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return 32 bit representation of given 128 bit UUID, 9012cdef',
+ function(done) {
+ var UUID32Bit = '1560cdef';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID32Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return 32 bit representation of given 128 bit UUID, ABCDEFAB',
+ function(done) {
+ var UUID32Bit = 'ABCDEFAB';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ UUID32Bit = UUID32Bit.toLowerCase();
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID32Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return 32 bit representation of given 128 bit UUID, CdEfAbCd',
+ function(done) {
+ var UUID32Bit = 'CdEfAbCd';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ UUID32Bit = UUID32Bit.toLowerCase();
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID32Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bit UUID, 12345678-9012-3456-7890-123456789012',
+ function(done) {
+ var UUID128Bit = '12345678-9012-3456-7890-123456789012';
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID128Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bit UUID, abcdefab-cdef-abcd-efab-cdefabcdefab',
+ function(done) {
+ var UUID128Bit = 'abcdefab-cdef-abcd-efab-cdefabcdefab';
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID128Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bit UUID, 12345678-90ab-cdef-1234-567890abcdef',
+ function(done) {
+ var UUID128Bit = '12345678-90ab-cdef-1234-567890abcdef';
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID128Bit
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bit UUID, ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB',
+ function(done) {
+ var UUID128Bit = 'ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID128Bit.toLowerCase()
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should return given 128 bit UUID, ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB',
+ function(done) {
+ var UUID128Bit = 'ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidToShortestPossible(UUID128Bit)).to.equal(
+ UUID128Bit.toLowerCase()
+ );
+ done();
+ });
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, NotAValidUUID',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidToShortestPossible('NotAValidUUID');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, 123',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidToShortestPossible('123');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ // prettier-ignore
+ it('should throw InvalidValuesError if argument is not valid UUID, abcdef',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidToShortestPossible('abcdef');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-12345678901',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidToShortestPossible(
+ '12345678-9012-3456-7890-12345678901'
+ );
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-1234567890123',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidToShortestPossible(
+ '12345678-9012-3456-7890-1234567890123'
+ );
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it('should throw InvalidValuesError if argument is undefined', function(done) {
+ try {
+ var undef;
+ tizen.bluetooth.uuidToShortestPossible(undef);
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it('should throw InvalidValuesError if argument is null', function(done) {
+ try {
+ tizen.bluetooth.uuidToShortestPossible(null);
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+});
+
+mocha.checkLeaks();
+mocha
+ .run()
+ .on('pass', function(test) {
+ console.log(test.title + ' OK');
+ })
+ .on('fail', function(test, err) {
+ console.error(test.title + ' FAILED');
+ console.error(err);
+ })
+ .on('end', function() {
+ console.log('All done');
+ });
--- /dev/null
+mocha.setup('bdd');
+
+var BASE_UUID_LAST_96_BITS = '-0000-1000-8000-00805f9b34fb';
+var ZEROS = '0000';
+
+describe('uuidsEqual', function() {
+ it('should return true, 1234', function(done) {
+ var UUID16Bit = '1234';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, abcd', function(done) {
+ var UUID16Bit = 'abcd';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, 56df', function(done) {
+ var UUID16Bit = '56df';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, aBcD and AbCd', function(done) {
+ var UUID16Bit1 = 'aBcD';
+ var UUID16Bit2 = 'AbCd';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(true);
+ done();
+ });
+ it('should return true, abcd and ABCD', function(done) {
+ var UUID16Bit1 = 'abcd';
+ var UUID16Bit2 = 'ABCD';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(true);
+ done();
+ });
+ it('should return false, 1234 and 1235', function(done) {
+ var UUID16Bit1 = '1234';
+ var UUID16Bit2 = '1235';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(false);
+ done();
+ });
+ it('should return false, abcd and abce', function(done) {
+ var UUID16Bit1 = 'abcd';
+ var UUID16Bit2 = 'abce';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(false);
+ done();
+ });
+ it('should return false, 89df and 89de', function(done) {
+ var UUID16Bit1 = '89df';
+ var UUID16Bit2 = '89de';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(false);
+ done();
+ });
+ it('should return false, CDEF and CDEA', function(done) {
+ var UUID16Bit1 = 'CDEF';
+ var UUID16Bit2 = 'CDEA';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(false);
+ done();
+ });
+ it('should return false, aBcD and aBce', function(done) {
+ var UUID16Bit1 = 'aBcD';
+ var UUID16Bit2 = 'aBce';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit1, UUID16Bit2)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit2, UUID16Bit1)).to.equal(false);
+ done();
+ });
+
+ it('should return true, 1234 and 00001234', function(done) {
+ var UUID16Bit = '1234';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, abcd and 0000abcd', function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, 56ef and 000056ef', function(done) {
+ var UUID16Bit = '56ef';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, ABCD and 0000ABCD', function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, AbCd and 0000AbCd', function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID32Bit = ZEROS + UUID16Bit;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ it('should return false, 1234 and 00001233', function(done) {
+ var UUID16Bit = '1234';
+ var UUID32Bit = ZEROS + '1233';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(false);
+ done();
+ });
+ it('should return false, abcd and 0000abcd', function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID32Bit = ZEROS + 'bbcd';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(false);
+ done();
+ });
+ it('should return false, 56ef and 000056ef', function(done) {
+ var UUID16Bit = '56ef';
+ var UUID32Bit = ZEROS + '56e0';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(false);
+ done();
+ });
+ it('should return false, ABCD and 0000AACD', function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID32Bit = ZEROS + 'AACD';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(false);
+ done();
+ });
+ it('should return false, AbCd and 0000Abdd', function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID32Bit = ZEROS + 'Abdd';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID32Bit)).to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID16Bit)).to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, 1234 and 00001234-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = '1234';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, abcd and 0000abcd-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, 56ef and 000056ef-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = '56ef';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, ABCD and 0000ABCD-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, AbCd and 0000AbCd-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID128Bit = ZEROS + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, 1234 and 00002234-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = '1234';
+ var UUID128Bit = ZEROS + '2234' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, abcd and 0000aacd-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = 'abcd';
+ var UUID128Bit = ZEROS + 'aacd' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, 56ef and 000056ff-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = '56ef';
+ var UUID128Bit = ZEROS + '56ff' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, ABCD and 0000ABCC-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = 'ABCD';
+ var UUID128Bit = ZEROS + 'ABCC' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, AbCd and 1000AbCd-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID16Bit = 'AbCd';
+ var UUID128Bit = '1000' + UUID16Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID16Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID16Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, 12345678 and 12345678-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = '12345678';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, abcdefab and abcdefab-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'abcdefab';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, cdef9012 and cdef9012-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'cdef9012';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, ABCDEFAB and ABCDEFAB-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'ABCDEFAB';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return true, CdEfAbdC and CdEfAbdC-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'CdEfAbdC';
+ var UUID128Bit = UUID32Bit + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit)).to.equal(true);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit)).to.equal(true);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, 12345678 and 34345678-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = '12345678';
+ var UUID128Bit = '34345678' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, abcdefab and ababefab-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'abcdefab';
+ var UUID128Bit = 'ababefab' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, cdef9012 and cdef1212-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'cdef9012';
+ var UUID128Bit = 'cdef1212' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, ABCDEFAB and ABCDEFEF-0000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'ABCDEFAB';
+ var UUID128Bit = 'ABCDEFEF' + BASE_UUID_LAST_96_BITS;
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit))
+ .to.equal(false);
+ done();
+ });
+ // prettier-ignore
+ it('should return false, CdEfAbdC and CdEfAbdC-1000-1000-8000-00805f9b34fb',
+ function(done) {
+ var UUID32Bit = 'CdEfAbdC';
+ var UUID128Bit = 'CdEfAbdC-1000-1000-8000-00805f9b34fb';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID32Bit, UUID128Bit))
+ .to.equal(false);
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID32Bit))
+ .to.equal(false);
+ done();
+ });
+
+ it('should return true, 12345678-9012-3456-7890-123456789012', function(done) {
+ var UUID128Bit = '12345678-9012-3456-7890-123456789012';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID128Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, abcdefab-cdef-abcd-efab-cdefabcdefab', function(done) {
+ var UUID128Bit = 'abcdefab-cdef-abcd-efab-cdefabcdefab';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID128Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, 12345678-90ab-cdef-1234-567890abcdef', function(done) {
+ var UUID128Bit = '12345678-90ab-cdef-1234-567890abcdef';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID128Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB', function(done) {
+ var UUID128Bit = 'ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID128Bit)).to.equal(true);
+ done();
+ });
+ it('should return true, ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB', function(done) {
+ var UUID128Bit = 'ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit, UUID128Bit)).to.equal(true);
+ done();
+ });
+ it('should return false, 12345678-9012-3456-7890-123456789012', function(done) {
+ var UUID128Bit1 = '12345678-9012-3456-7890-123456789012';
+ var UUID128Bit2 = '22345678-9012-3456-7890-123456789012';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit1, UUID128Bit2)).to.equal(false);
+ done();
+ });
+ it('should return false, abcdefab-cdef-abcd-efab-cdefabcdefab', function(done) {
+ var UUID128Bit1 = 'abcdefab-cdef-abcd-efab-cdefabcdefab';
+ var UUID128Bit2 = 'abcdefab-ddef-abcd-efab-cdefabcdefab';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit1, UUID128Bit2)).to.equal(false);
+ done();
+ });
+ it('should return false, 12345678-90ab-cdef-1234-567890abcdef', function(done) {
+ var UUID128Bit1 = '12345678-90ab-cdef-1234-567890abcdef';
+ var UUID128Bit2 = '12345678-90ab-ddef-1234-567890abcdef';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit1, UUID128Bit2)).to.equal(false);
+ done();
+ });
+ it('should return false, ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB', function(done) {
+ var UUID128Bit1 = 'ABCDEFAB-CDEF-ABCD-EFAB-CDEFABCDEFAB';
+ var UUID128Bit2 = 'ABCDEFAB-CDEF-ABCD-EFAA-CDEFABCDEFAB';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit1, UUID128Bit2)).to.equal(false);
+ done();
+ });
+ it('should return false, ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB', function(done) {
+ var UUID128Bit1 = 'ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAB';
+ var UUID128Bit2 = 'ABCDEFAB-cdef-ABCD-efab-CDEFABCDEFAA';
+ chai.expect(tizen.bluetooth.uuidsEqual(UUID128Bit1, UUID128Bit2)).to.equal(false);
+ done();
+ });
+
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ 'NotAValidUUID - first argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('NotAValidUUID', '1234');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '123 - first argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('123', '1234');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ 'abcdef - first argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('abcdef', '1234');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-12345678901 - first argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('12345678-9012-3456-7890-12345678901', '1234');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-1234567890123 - first argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual(
+ '12345678-9012-3456-7890-1234567890123',
+ '1234'
+ );
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it('should throw InvalidValuesError if first argument is undefined', function(done) {
+ try {
+ var undef;
+ tizen.bluetooth.uuidsEqual(undef, '1234');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it('should throw InvalidValuesError if first argument is null', function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual(null, '1234');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ 'NotAValidUUID - second argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('1234', 'NotAValidUUID');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '123 - second argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('1234', '123');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ 'abcdef - second argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('1234', 'abcdef');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-12345678901 - second argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('1234', '12345678-9012-3456-7890-12345678901');
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it(
+ 'should throw InvalidValuesError if argument is not valid UUID, ' +
+ '12345678-9012-3456-7890-1234567890123 - second argument',
+ function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual(
+ '1234',
+ '12345678-9012-3456-7890-1234567890123'
+ );
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ }
+ );
+ it('should throw InvalidValuesError if second argument is undefined', function(done) {
+ try {
+ var undef;
+ tizen.bluetooth.uuidsEqual('1234', undef);
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+ it('should throw InvalidValuesError if second argument is null', function(done) {
+ try {
+ tizen.bluetooth.uuidsEqual('1234', null);
+ done(new Error('Expected InvalidValuesError.'));
+ } catch (error) {
+ chai.expect(error.name).to.equal('InvalidValuesError');
+ done();
+ }
+ });
+});
+
+mocha.checkLeaks();
+mocha
+ .run()
+ .on('pass', function(test) {
+ console.log(test.title + ' OK');
+ })
+ .on('fail', function(test, err) {
+ console.error(test.title + ' FAILED');
+ console.error(err);
+ })
+ .on('end', function() {
+ console.log('All done');
+ });