Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(31)

Unified Diff: src/common/stabs_to_module_unittest.cc

Issue 267001: Put PUBLIC lines in Mac and Linux symbol files (Closed)
Patch Set: Updated with review comments Created 14 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/common/stabs_to_module.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/common/stabs_to_module_unittest.cc
===================================================================
--- a/src/common/stabs_to_module_unittest.cc
+++ b/src/common/stabs_to_module_unittest.cc
@@ -69,16 +69,41 @@ TEST(StabsToModule, SimpleCU) {
ASSERT_EQ((size_t) 1, function->lines.size());
Module::Line *line = &function->lines[0];
EXPECT_EQ(0xfde4abbed390c394LL, line->address);
EXPECT_EQ(0x10U, line->size); // derived from EndFunction
EXPECT_TRUE(line->file == file);
EXPECT_EQ(174823314, line->number);
}
+TEST(StabsToModule, Externs) {
+ Module m("name", "os", "arch", "id");
+ StabsToModule h(&m);
+
+ // Feed in a few Extern symbols.
+ EXPECT_TRUE(h.Extern("_foo", 0xffff));
+ EXPECT_TRUE(h.Extern("__Z21dyldGlobalLockAcquirev", 0xaaaa));
+ EXPECT_TRUE(h.Extern("_MorphTableGetNextMorphChain", 0x1111));
+ h.Finalize();
+
+ // Now check to see what has been added to the Module.
+ vector<Module::Extern *> externs;
+ m.GetExterns(&externs, externs.end());
+ ASSERT_EQ((size_t) 3, externs.size());
+ Module::Extern *extern1 = externs[0];
+ EXPECT_STREQ("MorphTableGetNextMorphChain", extern1->name.c_str());
+ EXPECT_EQ((Module::Address)0x1111, extern1->address);
+ Module::Extern *extern2 = externs[1];
+ EXPECT_STREQ("dyldGlobalLockAcquire()", extern2->name.c_str());
+ EXPECT_EQ((Module::Address)0xaaaa, extern2->address);
+ Module::Extern *extern3 = externs[2];
+ EXPECT_STREQ("foo", extern3->name.c_str());
+ EXPECT_EQ((Module::Address)0xffff, extern3->address);
+}
+
TEST(StabsToModule, DuplicateFunctionNames) {
Module m("name", "os", "arch", "id");
StabsToModule h(&m);
// Compilation unit with one function, mangled name.
EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0xf2cfda36ecf7f46cLL,
"build-directory"));
EXPECT_TRUE(h.StartFunction("funcfoo",
« no previous file with comments | « src/common/stabs_to_module.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted