summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/unittests/testStorage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/daemon/unittests/testStorage.cpp')
-rw-r--r--p2pvr/daemon/unittests/testStorage.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/p2pvr/daemon/unittests/testStorage.cpp b/p2pvr/daemon/unittests/testStorage.cpp
index 5083848..e7eee95 100644
--- a/p2pvr/daemon/unittests/testStorage.cpp
+++ b/p2pvr/daemon/unittests/testStorage.cpp
@@ -42,6 +42,10 @@ runTest(RecordingsPrx recordings, StoragePrx storage)
auto id = recordings->NewRecording(new Recording(0, 8, 2556));
auto rdc = storage->OpenForWrite(id);
BOOST_REQUIRE(rdc);
+ auto stats1 = storage->GetVideoStats(id);
+ BOOST_REQUIRE_EQUAL(id, stats1.RecordingId);
+ BOOST_REQUIRE_EQUAL(0, stats1.TotalSize);
+ BOOST_REQUIRE_EQUAL(0, stats1.Fragments);
Data data;
data.resize(1024);
@@ -50,10 +54,18 @@ runTest(RecordingsPrx recordings, StoragePrx storage)
storage->Close(rdc);
- BOOST_REQUIRE_EQUAL(1024, storage->GetSize(id));
+ auto stats2 = storage->GetVideoStats(id);
+ BOOST_REQUIRE_EQUAL(id, stats2.RecordingId);
+ BOOST_REQUIRE_EQUAL(1024, stats2.TotalSize);
+ BOOST_REQUIRE_EQUAL(1, stats2.Fragments);
recordings->DeleteRecording(id);
- BOOST_REQUIRE_EQUAL(0, storage->GetSize(id));
+ BOOST_REQUIRE_THROW(storage->GetVideoStats(id), NotFound);
+}
+
+BOOST_AUTO_TEST_CASE( not_found )
+{
+ BOOST_REQUIRE_THROW(storage->GetVideoStats(1), NotFound);
}
BOOST_AUTO_TEST_CASE( st_openWriteCloseMuxWithCat )