src: disable fast math on arm
[platform/upstream/nodejs.git] / test / parallel / test-tls-zero-clear-in.js
1 var common = require('../common');
2 var assert = require('assert');
3
4 if (!common.hasCrypto) {
5   console.log('1..0 # Skipped: missing crypto');
6   process.exit();
7 }
8 var tls = require('tls');
9
10 var fs = require('fs');
11 var path = require('path');
12
13 var cert = fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem'));
14 var key = fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'));
15
16 var errorEmitted = false;
17
18 var server = tls.createServer({
19   cert: cert,
20   key: key
21 }, function(c) {
22   // Nop
23   setTimeout(function() {
24     c.destroy();
25     server.close();
26   }, 20);
27 }).listen(common.PORT, function() {
28   var conn = tls.connect({
29     cert: cert,
30     key: key,
31     rejectUnauthorized: false,
32     port: common.PORT
33   }, function() {
34     setTimeout(function() {
35       conn.destroy();
36     }, 20);
37   });
38
39   // SSL_write() call's return value, when called 0 bytes, should not be
40   // treated as error.
41   conn.end('');
42
43   conn.on('error', function(err) {
44     console.log(err);
45     errorEmitted = true;
46   });
47 });
48
49 process.on('exit', function() {
50   assert.ok(!errorEmitted);
51 });