1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-08-29 17:07:58 +00:00

fixed failing unit test

I don't know how this didn't run before submitting the PR. CI tests are great!

The file-based signal sources were modified to not throw an exception on creation
but rather when connect() is called. The unit test was checking for an exception
upon construction.
This commit is contained in:
Jim Melton
2021-02-15 15:33:16 -07:00
parent fb6fef74e3
commit 3bf2deb2ae

View File

@@ -53,5 +53,9 @@ TEST(FileSignalSource, InstantiateFileNotExists)
config->set_property("Test.item_type", "gr_complex");
config->set_property("Test.repeat", "false");
EXPECT_THROW({ auto uptr = std::make_shared<FileSignalSource>(config.get(), "Test", 0, 1, queue.get()); }, std::exception);
// the file existence test was moved from the ctor to the connect() call. The argument to
// connect doesn't matter, since the exception should be thrown sooner than any connections
auto top = gr::make_top_block("GNSSUnitTest");
auto uptr = std::make_shared<FileSignalSource>(config.get(), "Test", 0, 1, queue.get());
EXPECT_THROW({ uptr->connect(top); }, std::exception);
}