Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: unittests/Support/StreamingMemoryObject.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « unittests/Bitcode/NaClTextFormatterTest.cpp ('k') | utils/Makefile » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- llvm/unittest/Support/StreamingMemoryObject.cpp - unit tests -------===// 1 //===- llvm/unittest/Support/StreamingMemoryObject.cpp - unit tests -------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 9
10 #include "llvm/Support/StreamingMemoryObject.h" 10 #include "llvm/Support/StreamingMemoryObject.h"
11 #include "gtest/gtest.h" 11 #include "gtest/gtest.h"
12 12
13 #include <string.h> 13 #include <string.h>
14 14
15 using namespace llvm; 15 using namespace llvm;
16 16
17 namespace { 17 namespace {
18 class NullDataStreamer : public DataStreamer { 18 class NullDataStreamer : public DataStreamer {
19 size_t GetBytes(unsigned char *buf, size_t len) override { 19 size_t GetBytes(unsigned char *buf, size_t len) override {
20 memset(buf, 0, len); 20 memset(buf, 0, len);
21 return len; 21 return len;
22 } 22 }
23 }; 23 };
24 } 24 }
25 25
26 TEST(StreamingMemoryObject, Test) { 26 TEST(StreamingMemoryObject, Test) {
27 auto *DS = new NullDataStreamer(); 27 auto *DS = new NullDataStreamer();
28 StreamingMemoryObject O(DS); 28 // @LOCALMOD -- Separated StreamingMemoryObject into interface + Impl.
29 StreamingMemoryObjectImpl O(DS);
29 EXPECT_TRUE(O.isValidAddress(32 * 1024)); 30 EXPECT_TRUE(O.isValidAddress(32 * 1024));
30 } 31 }
OLDNEW
« no previous file with comments | « unittests/Bitcode/NaClTextFormatterTest.cpp ('k') | utils/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698