1 //===- llvm/unittest/Object/YAMLTest.cpp - Tests for Object YAML ----------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/Object/YAML.h"
11 #include "llvm/Support/YAMLTraits.h"
12 #include "gtest/gtest.h"
18 object::yaml::BinaryRef Binary;
20 } // end anonymous namespace
25 struct MappingTraits<BinaryHolder> {
26 static void mapping(IO &IO, BinaryHolder &BH) {
27 IO.mapRequired("Binary", BH.Binary);
30 } // end namespace yaml
31 } // end namespace llvm
33 TEST(ObjectYAML, BinaryRef) {
35 SmallVector<char, 32> Buf;
36 llvm::raw_svector_ostream OS(Buf);
37 yaml::Output YOut(OS);
39 EXPECT_NE(OS.str().find("\"\""), StringRef::npos);