Fix ProfileNodeFindOrAddChildForSameFunction test on Win32 debug.
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Sep 2010 12:25:45 +0000 (12:25 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Sep 2010 12:25:45 +0000 (12:25 +0000)
Test was failing is due to a fact that MSVC in debug mode uses
separate instances for identical string literals.

TBR=sgjesse@chromium.org

Review URL: http://codereview.chromium.org/3381013

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5496 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-profile-generator.cc

index d8f1c10..f46191a 100644 (file)
@@ -90,18 +90,20 @@ TEST(ProfileNodeFindOrAddChild) {
 
 
 TEST(ProfileNodeFindOrAddChildForSameFunction) {
+  const char* empty = "";
+  const char* aaa = "aaa";
   ProfileNode node(NULL, NULL);
-  CodeEntry entry1(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
+  CodeEntry entry1(i::Logger::FUNCTION_TAG, empty, aaa, empty, 0,
                      TokenEnumerator::kNoSecurityToken);
   ProfileNode* childNode1 = node.FindOrAddChild(&entry1);
   CHECK_NE(NULL, childNode1);
   CHECK_EQ(childNode1, node.FindOrAddChild(&entry1));
   // The same function again.
-  CodeEntry entry2(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
+  CodeEntry entry2(i::Logger::FUNCTION_TAG, empty, aaa, empty, 0,
                    TokenEnumerator::kNoSecurityToken);
   CHECK_EQ(childNode1, node.FindOrAddChild(&entry2));
   // Now with a different security token.
-  CodeEntry entry3(i::Logger::FUNCTION_TAG, "", "aaa", "", 0,
+  CodeEntry entry3(i::Logger::FUNCTION_TAG, empty, aaa, empty, 0,
                    TokenEnumerator::kNoSecurityToken + 1);
   CHECK_EQ(childNode1, node.FindOrAddChild(&entry3));
 }