test: convert most N-API tests from C++ to C
- Prefix functions with
static
to make them local - Remove anonymous namespaces
-
nullptr
->NULL
- .cc -> .c and update binding.gyp
-
static_cast<x>()
->(x)()
- Replace
new
/delete
withmalloc()
/free()
(only in test_callback_scope) - Move lambda out and convert to local function (only in test_callback_scope)
- Remove superfluous
#include <vector>
(only in test_callback_scope_recurse)
Some tests are best left as C++.
ls -l test/{node-api,js-native-api}/*/*.cc
for the rest.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines