-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: convert most N-API tests from C++ to C #34615
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gabrielschulhof
requested review from
jasnell,
addaleax,
legendecas and
mhdawson
August 3, 2020 20:02
* 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` with `malloc()`/`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++. ```bash ls -l test/{node-api,js-native-api}/*/*.cc ``` for the rest. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com>
gabrielschulhof
force-pushed
the
n-api-make-tests-C
branch
from
August 3, 2020 20:10
63f1343
to
5ac8736
Compare
addaleax
approved these changes
Aug 3, 2020
Flarna
reviewed
Aug 3, 2020
Flarna
approved these changes
Aug 3, 2020
Flarna
approved these changes
Aug 3, 2020
gengjiawen
approved these changes
Aug 4, 2020
joyeecheung
approved these changes
Aug 4, 2020
jasnell
approved these changes
Aug 4, 2020
gabrielschulhof
pushed a commit
that referenced
this pull request
Aug 5, 2020
* 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` with `malloc()`/`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++. ```bash ls -l test/{node-api,js-native-api}/*/*.cc ``` for those remaining as C++ tests. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: #34615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Landed in 7343272. |
codebytere
pushed a commit
that referenced
this pull request
Aug 6, 2020
* 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` with `malloc()`/`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++. ```bash ls -l test/{node-api,js-native-api}/*/*.cc ``` for those remaining as C++ tests. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: #34615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Merged
codebytere
pushed a commit
that referenced
this pull request
Aug 11, 2020
* 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` with `malloc()`/`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++. ```bash ls -l test/{node-api,js-native-api}/*/*.cc ``` for those remaining as C++ tests. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: #34615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
addaleax
pushed a commit
that referenced
this pull request
Sep 22, 2020
* 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` with `malloc()`/`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++. ```bash ls -l test/{node-api,js-native-api}/*/*.cc ``` for those remaining as C++ tests. Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> PR-URL: #34615 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
@gabrielschulhof Can you backport this to v12.x? It applies cleanly but doesn’t compile successfully on all platforms. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
static
to make them localnullptr
->NULL
static_cast<x>()
->(x)()
new
/delete
withmalloc()
/free()
(only in test_callback_scope)
(only in test_callback_scope)
#include <vector>
(only in test_callback_scope_recurse)
Some tests are best left as C++.
for the rest.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes