[Lldb-commits] [lldb] r351524 - [Reproducers] Fix reproducers unittest.

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 17 23:17:06 PST 2019


Author: jdevlieghere
Date: Thu Jan 17 23:17:05 2019
New Revision: 351524

URL: http://llvm.org/viewvc/llvm-project?rev=351524&view=rev
Log:
[Reproducers] Fix reproducers unittest.

Fix fallout from r351501 in the reproducer unittest.

Modified:
    lldb/trunk/unittests/Utility/ReproducerTest.cpp

Modified: lldb/trunk/unittests/Utility/ReproducerTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Utility/ReproducerTest.cpp?rev=351524&r1=351523&r2=351524&view=diff
==============================================================================
--- lldb/trunk/unittests/Utility/ReproducerTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ReproducerTest.cpp Thu Jan 17 23:17:05 2019
@@ -20,14 +20,19 @@ using namespace llvm;
 using namespace lldb_private;
 using namespace lldb_private::repro;
 
+struct DummyInfo {
+  static const char *name;
+  static const char *file;
+};
+
+const char *DummyInfo::name = "dummy";
+const char *DummyInfo::file = "dummy.yaml";
+
 class DummyProvider : public repro::Provider<DummyProvider> {
 public:
-  static constexpr const char *NAME = "dummy";
+  typedef DummyInfo info;
 
-  DummyProvider(const FileSpec &directory) : Provider(directory) {
-    m_info.name = "dummy";
-    m_info.files.push_back("dummy.yaml");
-  }
+  DummyProvider(const FileSpec &directory) : Provider(directory) {}
 
   static char ID;
 };
@@ -97,9 +102,6 @@ TEST(GeneratorTest, Create) {
   auto *provider = generator.Create<DummyProvider>();
   EXPECT_NE(nullptr, provider);
   EXPECT_EQ(FileSpec("/bogus/path"), provider->GetRoot());
-  EXPECT_EQ(std::string("dummy"), provider->GetInfo().name);
-  EXPECT_EQ((size_t)1, provider->GetInfo().files.size());
-  EXPECT_EQ(std::string("dummy.yaml"), provider->GetInfo().files.front());
 }
 
 TEST(GeneratorTest, Get) {
@@ -125,9 +127,6 @@ TEST(GeneratorTest, GetOrCreate) {
 
   auto &provider = generator.GetOrCreate<DummyProvider>();
   EXPECT_EQ(FileSpec("/bogus/path"), provider.GetRoot());
-  EXPECT_EQ(std::string("dummy"), provider.GetInfo().name);
-  EXPECT_EQ((size_t)1, provider.GetInfo().files.size());
-  EXPECT_EQ(std::string("dummy.yaml"), provider.GetInfo().files.front());
 
   auto &provider_alt = generator.GetOrCreate<DummyProvider>();
   EXPECT_EQ(&provider, &provider_alt);




More information about the lldb-commits mailing list