]> git.proxmox.com Git - rustc.git/blame - src/llvm/unittests/Support/StreamingMemoryObject.cpp
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / unittests / Support / StreamingMemoryObject.cpp
CommitLineData
85aaf69f
SL
1//===- llvm/unittest/Support/StreamingMemoryObject.cpp - unit tests -------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/Support/StreamingMemoryObject.h"
11#include "gtest/gtest.h"
12#include <string.h>
13
14using namespace llvm;
15
16namespace {
17class NullDataStreamer : public DataStreamer {
18 size_t GetBytes(unsigned char *buf, size_t len) override {
19 memset(buf, 0, len);
20 return len;
21 }
22};
23}
24
25TEST(StreamingMemoryObject, Test) {
26 auto *DS = new NullDataStreamer();
27 StreamingMemoryObject O(DS);
28 EXPECT_TRUE(O.isValidAddress(32 * 1024));
29}