-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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` 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 <[email protected]> PR-URL: #34615 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]>
- Loading branch information
Showing
8 changed files
with
67 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"targets": [ | ||
{ | ||
"target_name": "test_async", | ||
"sources": [ "test_async.cc" ] | ||
"sources": [ "test_async.c" ] | ||
} | ||
] | ||
} |
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
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
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
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
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
Oops, something went wrong.