summaryrefslogtreecommitdiff
path: root/chromium/components/metal_util/test_shader_unittest.cc
blob: c12e7751df95d8b4a7fba76bce5f191374879fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/metal_util/test_shader.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {

TEST(GetAlteredLibraryDataTest, TestInvalidAccess) {
  for (int j = 0; j < 4096; ++j) {
    std::vector<uint8_t> data = metal::GetAlteredLibraryData();
    EXPECT_EQ(data.size(), metal::kTestLibSize);
    for (size_t i = 0; i < metal::kLiteralSize; ++i)
      EXPECT_NE(data[metal::kLiteralOffset + i], 0);
  }
}

}  // namespace