[Lldb-commits] [lldb] r373114 - [Reproducer] Update the unit tests to specify the path style.
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 27 12:12:18 PDT 2019
Author: jdevlieghere
Date: Fri Sep 27 12:12:18 2019
New Revision: 373114
URL: http://llvm.org/viewvc/llvm-project?rev=373114&view=rev
Log:
[Reproducer] Update the unit tests to specify the path style.
The unit tests started failing on Windows after my recent patch that
ensured we always deal with absolute paths. This should fix that.
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=373114&r1=373113&r2=373114&view=diff
==============================================================================
--- lldb/trunk/unittests/Utility/ReproducerTest.cpp (original)
+++ lldb/trunk/unittests/Utility/ReproducerTest.cpp Fri Sep 27 12:12:18 2019
@@ -52,14 +52,19 @@ TEST(ReproducerTest, SetCapture) {
EXPECT_EQ(nullptr, reproducer.GetLoader());
// Enable capture and check that means we have a generator.
- EXPECT_THAT_ERROR(reproducer.SetCapture(FileSpec("/bogus/path")),
- Succeeded());
+ EXPECT_THAT_ERROR(
+ reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Succeeded());
EXPECT_NE(nullptr, reproducer.GetGenerator());
- EXPECT_EQ(FileSpec("/bogus/path"), reproducer.GetGenerator()->GetRoot());
- EXPECT_EQ(FileSpec("/bogus/path"), reproducer.GetReproducerPath());
+ EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
+ reproducer.GetGenerator()->GetRoot());
+ EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
+ reproducer.GetReproducerPath());
// Ensure that we cannot enable replay.
- EXPECT_THAT_ERROR(reproducer.SetReplay(FileSpec("/bogus/path")), Failed());
+ EXPECT_THAT_ERROR(
+ reproducer.SetReplay(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Failed());
EXPECT_EQ(nullptr, reproducer.GetLoader());
// Ensure we can disable the generator again.
@@ -76,36 +81,45 @@ TEST(ReproducerTest, SetReplay) {
EXPECT_EQ(nullptr, reproducer.GetLoader());
// Expected to fail because we can't load the index.
- EXPECT_THAT_ERROR(reproducer.SetReplay(FileSpec("/bogus/path")), Failed());
+ EXPECT_THAT_ERROR(
+ reproducer.SetReplay(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Failed());
// However the loader should still be set, which we check here.
EXPECT_NE(nullptr, reproducer.GetLoader());
// Make sure the bogus path is correctly set.
- EXPECT_EQ(FileSpec("/bogus/path"), reproducer.GetLoader()->GetRoot());
- EXPECT_EQ(FileSpec("/bogus/path"), reproducer.GetReproducerPath());
+ EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
+ reproducer.GetLoader()->GetRoot());
+ EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
+ reproducer.GetReproducerPath());
// Ensure that we cannot enable replay.
- EXPECT_THAT_ERROR(reproducer.SetCapture(FileSpec("/bogus/path")), Failed());
+ EXPECT_THAT_ERROR(
+ reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Failed());
EXPECT_EQ(nullptr, reproducer.GetGenerator());
}
TEST(GeneratorTest, Create) {
DummyReproducer reproducer;
- EXPECT_THAT_ERROR(reproducer.SetCapture(FileSpec("/bogus/path")),
- Succeeded());
+ EXPECT_THAT_ERROR(
+ reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Succeeded());
auto &generator = *reproducer.GetGenerator();
auto *provider = generator.Create<DummyProvider>();
EXPECT_NE(nullptr, provider);
- EXPECT_EQ(FileSpec("/bogus/path"), provider->GetRoot());
+ EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
+ provider->GetRoot());
}
TEST(GeneratorTest, Get) {
DummyReproducer reproducer;
- EXPECT_THAT_ERROR(reproducer.SetCapture(FileSpec("/bogus/path")),
- Succeeded());
+ EXPECT_THAT_ERROR(
+ reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Succeeded());
auto &generator = *reproducer.GetGenerator();
auto *provider = generator.Create<DummyProvider>();
@@ -118,12 +132,14 @@ TEST(GeneratorTest, Get) {
TEST(GeneratorTest, GetOrCreate) {
DummyReproducer reproducer;
- EXPECT_THAT_ERROR(reproducer.SetCapture(FileSpec("/bogus/path")),
- Succeeded());
+ EXPECT_THAT_ERROR(
+ reproducer.SetCapture(FileSpec("/bogus/path", FileSpec::Style::posix)),
+ Succeeded());
auto &generator = *reproducer.GetGenerator();
auto &provider = generator.GetOrCreate<DummyProvider>();
- EXPECT_EQ(FileSpec("/bogus/path"), provider.GetRoot());
+ EXPECT_EQ(FileSpec("/bogus/path", FileSpec::Style::posix),
+ provider.GetRoot());
auto &provider_alt = generator.GetOrCreate<DummyProvider>();
EXPECT_EQ(&provider, &provider_alt);
More information about the lldb-commits
mailing list