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

Commit e9da9852 authored by Xusong Wang's avatar Xusong Wang
Browse files

Add memory domain VTS generated tests.

Bug: 141353602
Bug: 141363565
Test: 1.3 VTS
Change-Id: Ifc7eb3fd6f15e28ba403f02bdf66b4568bddcb64
Merged-In: Ifc7eb3fd6f15e28ba403f02bdf66b4568bddcb64
(cherry picked from commit 1f50e54c)
parent b345a468
Loading
Loading
Loading
Loading
+16 −14
Original line number Diff line number Diff line
@@ -456,7 +456,7 @@ TEST_P(CompilationCachingTest, CacheSavingAndRetrieval) {
    }

    // Execute and verify results.
    EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
    EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
}

TEST_P(CompilationCachingTest, CacheSavingAndRetrievalNonZeroOffset) {
@@ -518,7 +518,7 @@ TEST_P(CompilationCachingTest, CacheSavingAndRetrievalNonZeroOffset) {
    }

    // Execute and verify results.
    EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
    EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
}

TEST_P(CompilationCachingTest, SaveToCacheInvalidNumCache) {
@@ -539,7 +539,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumCache) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -563,7 +563,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumCache) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -586,7 +586,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumCache) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -610,7 +610,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumCache) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -721,7 +721,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumFd) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -745,7 +745,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumFd) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -768,7 +768,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumFd) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -792,7 +792,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidNumFd) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -904,7 +904,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidAccessMode) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -926,7 +926,7 @@ TEST_P(CompilationCachingTest, SaveToCacheInvalidAccessMode) {
        saveModelToCache(model, modelCache, dataCache, &preparedModel);
        ASSERT_NE(preparedModel, nullptr);
        // Execute and verify results.
        EvaluatePreparedModel(preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        EvaluatePreparedModel(kDevice, preparedModel, testModel, /*testKind=*/TestKind::GENERAL);
        // Check if prepareModelFromCache fails.
        preparedModel = nullptr;
        ErrorStatus status;
@@ -1070,7 +1070,8 @@ TEST_P(CompilationCachingTest, SaveToCache_TOCTOU) {
                ASSERT_EQ(preparedModel, nullptr);
            } else {
                ASSERT_NE(preparedModel, nullptr);
                EvaluatePreparedModel(preparedModel, testModelAdd, /*testKind=*/TestKind::GENERAL);
                EvaluatePreparedModel(kDevice, preparedModel, testModelAdd,
                                      /*testKind=*/TestKind::GENERAL);
            }
        }
    }
@@ -1131,7 +1132,8 @@ TEST_P(CompilationCachingTest, PrepareFromCache_TOCTOU) {
                ASSERT_EQ(preparedModel, nullptr);
            } else {
                ASSERT_NE(preparedModel, nullptr);
                EvaluatePreparedModel(preparedModel, testModelAdd, /*testKind=*/TestKind::GENERAL);
                EvaluatePreparedModel(kDevice, preparedModel, testModelAdd,
                                      /*testKind=*/TestKind::GENERAL);
            }
        }
    }