-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
tools: fix js2c regression #27980
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
tools: fix js2c regression #27980
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #include "node_native_module.h" | ||
|
|
||
| #include "gtest/gtest.h" | ||
| #include "node_test_fixture.h" | ||
|
|
||
| #include <string> | ||
|
|
||
|
|
||
| using node::native_module::NativeModuleLoader; | ||
| using node::native_module::NativeModuleRecordMap; | ||
|
|
||
| class PerProcessTest : public ::testing::Test { | ||
| protected: | ||
| static const NativeModuleRecordMap get_sources_for_test() { | ||
| return NativeModuleLoader::instance_.source_; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The builds are failing because this is private. I guess it would also make sense to add a public method to just return the source in a copy, though.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made it a friend
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like it was a namespace issue |
||
| } | ||
| }; | ||
|
|
||
| namespace { | ||
|
|
||
| TEST_F(PerProcessTest, EmbeddedSources) { | ||
| const auto& sources = PerProcessTest::get_sources_for_test(); | ||
| ASSERT_TRUE( | ||
| std::any_of(sources.cbegin(), sources.cend(), | ||
| [](auto p){ return p.second.is_one_byte(); })) | ||
| << "NativeModuleLoader::source_ should have some 8bit items"; | ||
|
|
||
| ASSERT_TRUE( | ||
| std::any_of(sources.cbegin(), sources.cend(), | ||
| [](auto p){ return !p.second.is_one_byte(); })) | ||
| << "NativeModuleLoader::source_ should have some 16bit items"; | ||
| } | ||
|
|
||
| } // end namespace | ||
Uh oh!
There was an error while loading. Please reload this page.