forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_per_process.cc
More file actions
32 lines (24 loc) · 875 Bytes
/
test_per_process.cc
File metadata and controls
32 lines (24 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "node_builtins.h"
#include "node_threadsafe_cow-inl.h"
#include "gtest/gtest.h"
#include "node_test_fixture.h"
#include <string>
using node::builtins::BuiltinLoader;
using node::builtins::BuiltinSourceMap;
class PerProcessTest : public ::testing::Test {
protected:
static const BuiltinSourceMap get_sources_for_test() {
return *BuiltinLoader().source_.read();
}
};
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();
})) << "BuiltinLoader::source_ should have some 8bit items";
ASSERT_TRUE(std::any_of(sources.cbegin(), sources.cend(), [](auto p) {
return !p.second.is_one_byte();
})) << "BuiltinLoader::source_ should have some 16bit items";
}
} // end namespace