File: BlobStoreTest.h

package info (click to toggle)
cryfs 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,412 kB
  • sloc: cpp: 150,187; asm: 10,493; python: 1,455; javascript: 65; sh: 50; makefile: 17; xml: 7
file content (29 lines) | stat: -rw-r--r-- 784 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once
#ifndef MESSMER_BLOBSTORE_TEST_IMPLEMENTATIONS_ONBLOCKS_TESTUTILS_BLOBSTORETEST_H_
#define MESSMER_BLOBSTORE_TEST_IMPLEMENTATIONS_ONBLOCKS_TESTUTILS_BLOBSTORETEST_H_

#include <gtest/gtest.h>

#include "blobstore/interface/BlobStore.h"

class BlobStoreTest: public ::testing::Test {
public:
  BlobStoreTest();

  static constexpr uint32_t BLOCKSIZE_BYTES = 4096;

  cpputils::unique_ref<blobstore::BlobStore> blobStore;

  cpputils::unique_ref<blobstore::Blob> loadBlob(const blockstore::BlockId &blockId) {
    auto loaded = blobStore->load(blockId);
    EXPECT_TRUE(static_cast<bool>(loaded));
    return std::move(*loaded);
  }

  void reset(cpputils::unique_ref<blobstore::Blob> ref) {
    UNUSED(ref);
    //ref is moved into here and then destructed
  }
};

#endif