summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-04-01 03:03:21 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-04-01 03:03:21 +0000
commit85fb9e058ed74ad9b4fe919056d1d6874f398b39 (patch)
treed0f0ef115da3cf8137ba894af8426b9c6e82ce71 /llvm/unittests
parentf83ab6de56eeb651b1ce06ea98ada9175a2beb17 (diff)
downloadbcm5719-llvm-85fb9e058ed74ad9b4fe919056d1d6874f398b39.tar.gz
bcm5719-llvm-85fb9e058ed74ad9b4fe919056d1d6874f398b39.zip
Revert "Add support for computing SHA1 in LLVM"
This reverts commit r265096, r265095, and r265094. Windows build is broken, and the validation does not pass. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265102
Diffstat (limited to 'llvm/unittests')
-rw-r--r--llvm/unittests/Support/CMakeLists.txt1
-rw-r--r--llvm/unittests/Support/raw_sha1_ostream_test.cpp72
2 files changed, 0 insertions, 73 deletions
diff --git a/llvm/unittests/Support/CMakeLists.txt b/llvm/unittests/Support/CMakeLists.txt
index 9a4a1445091..f02d501538b 100644
--- a/llvm/unittests/Support/CMakeLists.txt
+++ b/llvm/unittests/Support/CMakeLists.txt
@@ -52,7 +52,6 @@ add_llvm_unittest(SupportTests
formatted_raw_ostream_test.cpp
raw_ostream_test.cpp
raw_pwrite_stream_test.cpp
- raw_sha1_ostream_test.cpp
)
# ManagedStatic.cpp uses <pthread>.
diff --git a/llvm/unittests/Support/raw_sha1_ostream_test.cpp b/llvm/unittests/Support/raw_sha1_ostream_test.cpp
deleted file mode 100644
index ca80cdac49e..00000000000
--- a/llvm/unittests/Support/raw_sha1_ostream_test.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===- llvm/unittest/Support/raw_ostream_test.cpp - raw_ostream tests -----===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "gtest/gtest.h"
-#include "llvm/ADT/SmallString.h"
-#include "llvm/Support/Format.h"
-#include "llvm/Support/raw_sha1_ostream.h"
-
-#include <string>
-
-using namespace llvm;
-
-static std::string toHex(StringRef Input) {
- static const char *const LUT = "0123456789ABCDEF";
- size_t Length = Input.size();
-
- std::string Output;
- Output.reserve(2 * Length);
- for (size_t i = 0; i < Length; ++i) {
- const unsigned char c = Input[i];
- Output.push_back(LUT[c >> 4]);
- Output.push_back(LUT[c & 15]);
- }
- return Output;
-}
-
-TEST(raw_sha1_ostreamTest, Basic) {
- llvm::raw_sha1_ostream Sha1Stream;
- Sha1Stream << "Hello World!";
- auto Hash = toHex(Sha1Stream.sha1());
-
- ASSERT_EQ("2EF7BDE608CE5404E97D5F042F95F89F1C232871", Hash);
-}
-
-// Check that getting the intermediate hash in the middle of the stream does
-// not invalidate the final result.
-TEST(raw_sha1_ostreamTest, Intermediate) {
- llvm::raw_sha1_ostream Sha1Stream;
- Sha1Stream << "Hello";
- auto Hash = toHex(Sha1Stream.sha1());
-
- ASSERT_EQ("F7FF9E8B7BB2E09B70935A5D785E0CC5D9D0ABF0", Hash);
- Sha1Stream << " World!";
- Hash = toHex(Sha1Stream.sha1());
-
- // Compute the non-split hash separately as a reference.
- llvm::raw_sha1_ostream NonSplitSha1Stream;
- NonSplitSha1Stream << "Hello World!";
- auto NonSplitHash = toHex(NonSplitSha1Stream.sha1());
-
- ASSERT_EQ(NonSplitHash, Hash);
-}
-
-TEST(raw_sha1_ostreamTest, Reset) {
- llvm::raw_sha1_ostream Sha1Stream;
- Sha1Stream << "Hello";
- auto Hash = toHex(Sha1Stream.sha1());
-
- ASSERT_EQ("F7FF9E8B7BB2E09B70935A5D785E0CC5D9D0ABF0", Hash);
-
- Sha1Stream.resetHash();
- Sha1Stream << " World!";
- Hash = toHex(Sha1Stream.sha1());
-
- ASSERT_EQ("7447F2A5A42185C8CF91E632789C431830B59067", Hash);
-}
OpenPOWER on IntegriCloud