Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10158812 authored by Yifan Hong's avatar Yifan Hong Committed by Gerrit Code Review
Browse files

Merge "Move digital_stroage.h to its own library"

parents 530d8f1d f6fccc46
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@ cc_defaults {
        "libfs_mgr",
        "liblp",
    ] + liblp_lib_deps,
    header_libs: [
        "libstorage_literals_headers",
    ],
    stl: "libc++_static",
    srcs: [
        "builder_test.cpp",
+2 −7
Original line number Diff line number Diff line
@@ -17,11 +17,13 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <liblp/builder.h>
#include <storage_literals/storage_literals.h>

#include "liblp_test.h"
#include "utility.h"

using namespace std;
using namespace android::storage_literals;
using namespace android::fs_mgr;
using namespace android::fs_mgr::testing;
using ::testing::_;
@@ -591,13 +593,6 @@ TEST_F(BuilderTest, ChangeGroups) {
    ASSERT_NE(builder->Export(), nullptr);
}

constexpr unsigned long long operator"" _GiB(unsigned long long x) {  // NOLINT
    return x << 30;
}
constexpr unsigned long long operator"" _MiB(unsigned long long x) {  // NOLINT
    return x << 20;
}

TEST_F(BuilderTest, RemoveAndAddFirstPartition) {
    auto builder = MetadataBuilder::New(10_GiB, 65536, 2);
    ASSERT_NE(nullptr, builder);
+3 −0
Original line number Diff line number Diff line
@@ -103,4 +103,7 @@ cc_test {
        "libsparse",
        "libz",
    ],
    header_libs: [
        "libstorage_literals_headers",
    ],
}
+3 −3
Original line number Diff line number Diff line
@@ -32,8 +32,8 @@
#include <libfiemap/image_manager.h>
#include <liblp/builder.h>
#include <liblp/mock_property_fetcher.h>
#include <storage_literals/storage_literals.h>

#include "digital_storage.h"
#include "test_helpers.h"
#include "utility.h"

@@ -52,7 +52,7 @@ using android::fs_mgr::GetPartitionName;
using android::fs_mgr::MetadataBuilder;
using namespace ::testing;
using namespace android::fs_mgr::testing;
using namespace android::digital_storage;
using namespace android::storage_literals;
using namespace std::chrono_literals;
using namespace std::string_literals;

@@ -62,7 +62,7 @@ std::unique_ptr<SnapshotManager> sm;
TestDeviceInfo* test_device = nullptr;
std::string fake_super;

static constexpr uint64_t kSuperSize = (16_MiB).bytes();
static constexpr uint64_t kSuperSize = 16_MiB;

class SnapshotTest : public ::testing::Test {
  public:
+6 −0
Original line number Diff line number Diff line

cc_library_headers {
    name: "libstorage_literals_headers",
    host_supported: true,
    export_include_dirs: ["."],
}
Loading