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

Commit 9c0bfc68 authored by Nick Desaulniers's avatar Nick Desaulniers Committed by android-build-merger
Browse files

Merge "[dumpstate] fix -Wreturn-stack-address" am: 236f2f82 am: ee6cd20b am: b5c360e6

am: f6b55061

Change-Id: Ie3d77ac3de6e1059eb3678996768f53db8c781dd
parents 8fd84c99 f6b55061
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -214,8 +214,8 @@ class ZippedBugreportGenerationTest : public Test {
        duration = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
    }

    static const char* getZipFilePath() {
        return ds.GetPath(".zip").c_str();
    static const std::string getZipFilePath() {
        return ds.GetPath(".zip");
    }
};
std::shared_ptr<std::vector<SectionInfo>> ZippedBugreportGenerationTest::sections =
@@ -224,12 +224,12 @@ Dumpstate& ZippedBugreportGenerationTest::ds = Dumpstate::GetInstance();
std::chrono::milliseconds ZippedBugreportGenerationTest::duration = 0s;

TEST_F(ZippedBugreportGenerationTest, IsGeneratedWithoutErrors) {
    EXPECT_EQ(access(getZipFilePath(), F_OK), 0);
    EXPECT_EQ(access(getZipFilePath().c_str(), F_OK), 0);
}

TEST_F(ZippedBugreportGenerationTest, Is3MBto30MBinSize) {
    struct stat st;
    EXPECT_EQ(stat(getZipFilePath(), &st), 0);
    EXPECT_EQ(stat(getZipFilePath().c_str(), &st), 0);
    EXPECT_GE(st.st_size, 3000000 /* 3MB */);
    EXPECT_LE(st.st_size, 30000000 /* 30MB */);
}
@@ -248,7 +248,7 @@ class ZippedBugReportContentsTest : public Test {
  public:
    ZipArchiveHandle handle;
    void SetUp() {
        ASSERT_EQ(OpenArchive(ZippedBugreportGenerationTest::getZipFilePath(), &handle), 0);
        ASSERT_EQ(OpenArchive(ZippedBugreportGenerationTest::getZipFilePath().c_str(), &handle), 0);
    }
    void TearDown() {
        CloseArchive(handle);
@@ -312,7 +312,7 @@ TEST_F(ZippedBugReportContentsTest, ContainsSomeFileSystemFiles) {
class BugreportSectionTest : public Test {
  public:
    static void SetUpTestCase() {
        ParseSections(ZippedBugreportGenerationTest::getZipFilePath(),
        ParseSections(ZippedBugreportGenerationTest::getZipFilePath().c_str(),
                      ZippedBugreportGenerationTest::sections.get());
    }