forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: nodejs#27980 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
- Loading branch information
Showing
4 changed files
with
59 additions
and
3 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
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
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_; | ||
} | ||
}; | ||
|
||
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 |
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