{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/7535","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/7535/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/7535/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/7535/events","html_url":"https://github.com/nodejs/node/issues/7535","id":163742199,"number":7535,"title":"Add test for native addon making use of zlib","user":{"login":"alexhultman","id":3397140,"avatar_url":"https://avatars.githubusercontent.com/u/3397140?v=3","gravatar_id":"","url":"https://api.github.com/users/alexhultman","html_url":"https://github.com/alexhultman","followers_url":"https://api.github.com/users/alexhultman/followers","following_url":"https://api.github.com/users/alexhultman/following{/other_user}","gists_url":"https://api.github.com/users/alexhultman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexhultman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexhultman/subscriptions","organizations_url":"https://api.github.com/users/alexhultman/orgs","repos_url":"https://api.github.com/users/alexhultman/repos","events_url":"https://api.github.com/users/alexhultman/events{/privacy}","received_events_url":"https://api.github.com/users/alexhultman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/addons","name":"addons","color":"ededed"},{"url":"https://api.github.com/repos/nodejs/node/labels/test","name":"test","color":"990099"},{"url":"https://api.github.com/repos/nodejs/node/labels/zlib","name":"zlib","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-04T21:01:02Z","updated_at":"2016-08-09T22:01:13Z","closed_at":null,"body":"Just like #6274 we need a test for zlib usage. The node.exe binary on Windows does not export zlib symbols and this can be fixed by linking against a .def file with these symbols added.\r\n\r\nA basic test could be something like this:\r\n\r\n```c++\r\n#include <zlib.h>\r\n#include <cassert>\r\n\r\nint main() {\r\n    z_stream zStream = {};\r\n    int err = deflateInit2(&zStream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -15, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY);\r\n    assert(Z_OK == err);\r\n\r\n    unsigned char helloString[] = \"hello\";\r\n    unsigned char expectedDeflation[] = {0xca, 0x48, 0xcd, 0xc9, 0xc9, 0x7, 0x0, 0x0, 0x0, 0xff, 0xff};\r\n    unsigned char outputString[512];\r\n\r\n    zStream.avail_in = sizeof(helloString) - 1;\r\n    zStream.next_in = (unsigned char *) helloString;\r\n    zStream.avail_out = sizeof(outputString);\r\n    zStream.next_out = outputString;\r\n    err = deflate(&zStream, Z_SYNC_FLUSH);\r\n    assert(err == Z_OK || err == Z_STREAM_END);\r\n\r\n    int deflatedLength = sizeof(outputString) - zStream.avail_out;\r\n    for (int i = 0; i < deflatedLength; i++) {\r\n        assert(outputString[i] == expectedDeflation[i]);\r\n    }\r\n\r\n    deflateEnd(&zStream);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/238705975","html_url":"https://github.com/nodejs/node/issues/7535#issuecomment-238705975","issue_url":"https://api.github.com/repos/nodejs/node/issues/7535","id":238705975,"user":{"login":"addaleax","id":899444,"avatar_url":"https://avatars.githubusercontent.com/u/899444?v=3","gravatar_id":"","url":"https://api.github.com/users/addaleax","html_url":"https://github.com/addaleax","followers_url":"https://api.github.com/users/addaleax/followers","following_url":"https://api.github.com/users/addaleax/following{/other_user}","gists_url":"https://api.github.com/users/addaleax/gists{/gist_id}","starred_url":"https://api.github.com/users/addaleax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addaleax/subscriptions","organizations_url":"https://api.github.com/users/addaleax/orgs","repos_url":"https://api.github.com/users/addaleax/repos","events_url":"https://api.github.com/users/addaleax/events{/privacy}","received_events_url":"https://api.github.com/users/addaleax/received_events","type":"User","site_admin":false},"created_at":"2016-08-09T22:01:13Z","updated_at":"2016-08-09T22:01:13Z","body":"Yeah, this should be possible since 359352c9e90aa735b61b37d080377970719b98ef. I’ll try and see if I can get something together based on what @bnoordhuis already did in #6274."}}
{"actor":{"display_login":"addaleax"}}