Skip to content

Commit 62b04dd

Browse files
Sanggyu Leeyichoi
authored andcommitted
Use smaller headers on low-memory devices in test_net_headers.js (#987)
Currently test_net_headers.js is skipped on NuttX. However, IoT.js supports getHeader and setHeader on NuttX. We can run and pass the test by setting the size of header depending on platforms. IoT.js-DCO-1.0-Signed-off-by: Sanggyu Lee [email protected]
1 parent 7164515 commit 62b04dd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

test/run_pass/test_net_headers.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,15 @@ var server = http.createServer(function (req, res) {
4141
}
4242
// final res.headers = { 'h1' : 'h1', 'h3': 'h3prime' }
4343

44-
// Large header on response.
45-
for (var i = 0; i < 500; i++) {
44+
var responseSize;
45+
if (process.platform === 'linux') {
46+
// For Desktop and RPI, test with large header.
47+
responseSize = 500;
48+
} else {
49+
// NuttX and TizenRt cannot handle large header.
50+
responseSize = 10;
51+
}
52+
for (var i = 0; i < responseSize; i++) {
4653
res.setHeader('h' + (5 + i), 'h' + (5 + i));
4754
}
4855

test/testsets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
{ "name": "test_net_9.js" },
6161
{ "name": "test_net_10.js" },
6262
{ "name": "test_net_connect.js", "timeout": 10 },
63-
{ "name": "test_net_headers.js", "skip": ["nuttx"], "reason": "not implemented for nuttx" },
63+
{ "name": "test_net_headers.js" },
6464
{ "name": "test_net_http_get.js", "timeout": 20 },
6565
{ "name": "test_net_http_response_twice.js", "timeout": 10 },
6666
{ "name": "test_net_http_request_response.js", "timeout": 10, "skip": ["nuttx"], "reason": "not implemented for nuttx" },

0 commit comments

Comments
 (0)