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

Side by Side Diff: tests/pnacl_dynamic_loading/pll_symbols_test.cc

Issue 1841113002: PNaCl Dynamic Linking: Tests storing dependencies from command line in PLL. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Code Review Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « tests/pnacl_dynamic_loading/nacl.scons ('k') | toolchain_build/toolchain_build_pnacl.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Native Client Authors. All rights reserved. 1 // Copyright (c) 2015 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdint.h> 5 #include <stdint.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include "native_client/src/include/nacl_assert.h" 8 #include "native_client/src/include/nacl_assert.h"
9 #include "native_client/src/untrusted/pll_loader/pll_loader.h" 9 #include "native_client/src/untrusted/pll_loader/pll_loader.h"
10 #include "native_client/src/untrusted/pll_loader/pll_root.h" 10 #include "native_client/src/untrusted/pll_loader/pll_root.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 // The bloom filter bitmask must be one less than a power of 2. 164 // The bloom filter bitmask must be one less than a power of 2.
165 ASSERT_EQ((pll_root->bloom_filter_maskwords_bitmask + 1) & 165 ASSERT_EQ((pll_root->bloom_filter_maskwords_bitmask + 1) &
166 pll_root->bloom_filter_maskwords_bitmask, 0); 166 pll_root->bloom_filter_maskwords_bitmask, 0);
167 167
168 return pll_root; 168 return pll_root;
169 } 169 }
170 170
171 void TestCoreFunctionality(const char *test_dso_file) { 171 void TestCoreFunctionality(const char *test_dso_file) {
172 const PLLRoot *pll_root = LoadTranslatedPLL(test_dso_file); 172 const PLLRoot *pll_root = LoadTranslatedPLL(test_dso_file);
173 173
174 // Test dependencies.
175 ASSERT_EQ(pll_root->dependencies_count, 2);
176 ASSERT_EQ(strcmp(pll_root->dependencies_list, "libfoo.so"), 0);
177 ASSERT_EQ(strcmp(pll_root->dependencies_list + strlen("libfoo.so") + 1,
178 "libbar.so"), 0);
179
174 // Test exports. 180 // Test exports.
175 181
176 DumpExportedSymbols(pll_root); 182 DumpExportedSymbols(pll_root);
177 183
178 ASSERT_EQ(GetExportedSym(pll_root, "does_not_exist"), NULL); 184 ASSERT_EQ(GetExportedSym(pll_root, "does_not_exist"), NULL);
179 185
180 int *var = (int *) GetExportedSym(pll_root, "var"); 186 int *var = (int *) GetExportedSym(pll_root, "var");
181 ASSERT_NE(var, NULL); 187 ASSERT_NE(var, NULL);
182 ASSERT_EQ(*var, 2345); 188 ASSERT_EQ(*var, 2345);
183 189
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 if (argc != 3) { 325 if (argc != 3) {
320 fprintf(stderr, "Usage: pll_symbols_test <ELF file> <ELF file>\n"); 326 fprintf(stderr, "Usage: pll_symbols_test <ELF file> <ELF file>\n");
321 return 1; 327 return 1;
322 } 328 }
323 329
324 TestCoreFunctionality(argv[1]); 330 TestCoreFunctionality(argv[1]);
325 TestTLS(argv[2]); 331 TestTLS(argv[2]);
326 332
327 return 0; 333 return 0;
328 } 334 }
OLDNEW
« no previous file with comments | « tests/pnacl_dynamic_loading/nacl.scons ('k') | toolchain_build/toolchain_build_pnacl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698