summaryrefslogtreecommitdiffstats
path: root/clang/unittests/libclang
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-03-03 06:38:52 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-03-03 06:38:52 +0000
commit74c96c0c75c1827425543836258b7d903726841a (patch)
tree7c544d6dfb0e0d6c5ba80f7e447f81f5bdf62ba5 /clang/unittests/libclang
parent19dcc312ee157ef6e6cb3427311e0ff1ede19735 (diff)
downloadbcm5719-llvm-74c96c0c75c1827425543836258b7d903726841a.tar.gz
bcm5719-llvm-74c96c0c75c1827425543836258b7d903726841a.zip
[libclang] Change clang_VirtualFileOverlay_writeToBuffer to return a malloc'ed buffer.
Returning CXString is not appropriate if we want to switch to a non-string format buffer. llvm-svn: 202675
Diffstat (limited to 'clang/unittests/libclang')
-rw-r--r--clang/unittests/libclang/LibclangTest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/unittests/libclang/LibclangTest.cpp b/clang/unittests/libclang/LibclangTest.cpp
index f855ecdd3c6..3809c1ce889 100644
--- a/clang/unittests/libclang/LibclangTest.cpp
+++ b/clang/unittests/libclang/LibclangTest.cpp
@@ -51,10 +51,12 @@ struct TestVFO {
~TestVFO() {
if (!Contents)
return;
- CXString Buf;
- clang_VirtualFileOverlay_writeToBuffer(VFO, 0, &Buf);
- EXPECT_STREQ(Contents, clang_getCString(Buf));
- clang_disposeString(Buf);
+ char *BufPtr;
+ unsigned BufSize;
+ clang_VirtualFileOverlay_writeToBuffer(VFO, 0, &BufPtr, &BufSize);
+ std::string BufStr(BufPtr, BufSize);
+ EXPECT_STREQ(Contents, BufStr.c_str());
+ free(BufPtr);
clang_VirtualFileOverlay_dispose(VFO);
}
};
OpenPOWER on IntegriCloud