summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-07-22 21:03:56 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-07-22 21:03:56 +0000
commit29e449f22280b8c15619e5b3e9df30f1ae9dfb0a (patch)
tree83250c1587ab42fc65774d7be76c2b6e10dd6a8a /clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp
parent476f38a0c28f3cf94535b9eed2e2b2929f075c91 (diff)
downloadbcm5719-llvm-29e449f22280b8c15619e5b3e9df30f1ae9dfb0a.tar.gz
bcm5719-llvm-29e449f22280b8c15619e5b3e9df30f1ae9dfb0a.zip
Revert "cp11-migrate: Integration with LibFormat"
This reverts commit r186866. This breaks the build and the original author Guillaume Papin <guillaume.papin@epitech.eu> asked me to revert so he could look at it more with revane. llvm-svn: 186873
Diffstat (limited to 'clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp')
-rw-r--r--clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp50
1 files changed, 0 insertions, 50 deletions
diff --git a/clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp b/clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp
deleted file mode 100644
index fcde6b81db4..00000000000
--- a/clang-tools-extra/unittests/cpp11-migrate/ReformattingTest.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//===- cpp11-migrate/ReformattingTest.cpp - Reformatting unit tests -------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Core/Reformatting.h"
-#include "Core/FileOverrides.h"
-#include "gtest/gtest.h"
-#include "VirtualFileHelper.h"
-
-using namespace clang;
-using namespace clang::tooling;
-
-namespace {
-// convenience function to create a ChangedRanges containing one Range
-ChangedRanges makeChangedRanges(unsigned Offset, unsigned Length) {
- ChangedRanges Changes;
- Replacements Replaces;
-
- Replaces.insert(Replacement("", Offset, 0, std::string(Length, '~')));
- Changes.adjustChangedRanges(Replaces);
- return Changes;
-}
-} // end anonymous namespace
-
-TEST(Reformatter, SingleReformat) {
- VirtualFileHelper VFHelper;
- llvm::StringRef FileName = "<test>";
- VFHelper.mapFile(FileName, "int a;\n"
- "int b;\n");
-
- Reformatter ChangesReformatter(format::getLLVMStyle());
- ChangedRanges Changes = makeChangedRanges(0, 6);
- tooling::Replacements Replaces = ChangesReformatter.reformatSingleFile(
- FileName, Changes, VFHelper.getNewSourceManager());
-
- SourceOverrides Overrides(FileName, /*TrackChanges=*/false);
- Overrides.applyReplacements(Replaces, VFHelper.getNewSourceManager());
-
- std::string Expected, Result;
-
- Expected = "int a;\n"
- "int b;\n";
- Result = Overrides.getMainFileContent();
- EXPECT_EQ(Expected, Result);
-}
OpenPOWER on IntegriCloud