[AMDGPU][AsmParser][NFC] Translate parsed MIMG instructions to MCInsts automatically.
[llvm-project.git] / clang-tools-extra / clangd / unittests / RIFFTests.cpp
blob1430abd98ef1f7328bd2fd5994d40973b42578a5
1 //===-- RIFFTests.cpp - Binary container unit tests -----------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "RIFF.h"
10 #include "llvm/Support/ScopedPrinter.h"
11 #include "gmock/gmock.h"
12 #include "gtest/gtest.h"
14 namespace clang {
15 namespace clangd {
16 namespace {
18 TEST(RIFFTest, File) {
19 riff::File File{riff::fourCC("test"),
21 {riff::fourCC("even"), "abcd"},
22 {riff::fourCC("oddd"), "abcde"},
23 }};
24 llvm::StringRef Serialized = llvm::StringRef("RIFF\x1e\0\0\0test"
25 "even\x04\0\0\0abcd"
26 "oddd\x05\0\0\0abcde\0",
27 38);
29 EXPECT_EQ(llvm::to_string(File), Serialized);
30 auto Parsed = riff::readFile(Serialized);
31 ASSERT_TRUE(bool(Parsed)) << Parsed.takeError();
32 EXPECT_EQ(*Parsed, File);
35 } // namespace
36 } // namespace clangd
37 } // namespace clang