Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: tests/pnacl_dynamic_loading/pll_loader_test.cc

Issue 1832623002: PNaCl Dynamic Linking: Using unordered_set to disallow duplicate modules. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Code review Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/pnacl_dynamic_loading/nacl.scons ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/pnacl_dynamic_loading/pll_loader_test.cc
diff --git a/tests/pnacl_dynamic_loading/pll_loader_test.cc b/tests/pnacl_dynamic_loading/pll_loader_test.cc
index ba4ed5a8d35e36a273f4ce438df361bde973d5de..89a28e0a2c0d2c3da3964002a13b68ea17c306cd 100644
--- a/tests/pnacl_dynamic_loading/pll_loader_test.cc
+++ b/tests/pnacl_dynamic_loading/pll_loader_test.cc
@@ -22,32 +22,36 @@ void CheckTlsVar(ModuleSet *modset, const char *name_of_getter,
} // namespace
int main(int argc, char **argv) {
- if (argc != 4) {
- fprintf(stderr, "Usage: pll_loader_test <3 ELF files>\n");
+ if (argc != 5) {
+ fprintf(stderr, "Usage: pll_loader_test <Directory path> <3 ELF files>\n");
return 1;
}
- const char *module_a_filename = argv[1];
- const char *module_b_filename = argv[2];
- const char *module_tls_filename = argv[3];
+ const char *module_directory = argv[1];
+ const char *module_a_soname = argv[2];
+ const char *module_b_soname = argv[3];
+ const char *module_tls_soname = argv[4];
ModuleSet modset;
+ std::vector<std::string> search_path;
+ search_path.push_back(module_directory);
+ modset.SetSonameSearchPath(search_path);
// "module_a_var" should only be resolvable after we load module A.
int *module_a_var = (int *) modset.GetSym("module_a_var");
ASSERT_EQ(module_a_var, NULL);
- modset.AddByFilename(module_a_filename);
+ modset.AddBySoname(module_a_soname);
module_a_var = (int *) modset.GetSym("module_a_var");
ASSERT_NE(module_a_var, NULL);
ASSERT_EQ(*module_a_var, 2345);
- modset.AddByFilename(module_b_filename);
+ modset.AddBySoname(module_b_soname);
int *module_b_var = (int *) modset.GetSym("module_b_var");
ASSERT_NE(module_b_var, NULL);
ASSERT_EQ(*module_b_var, 1234);
- modset.AddByFilename(module_tls_filename);
+ modset.AddBySoname(module_tls_soname);
modset.ResolveRefs();
« no previous file with comments | « tests/pnacl_dynamic_loading/nacl.scons ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698