Author: Dmitri Gribenko Date: 2020-05-20T12:44:18+02:00 New Revision: 79fcd35c688b94becadd162a6c37e9b95df5c084
URL: https://github.com/llvm/llvm-project/commit/79fcd35c688b94becadd162a6c37e9b95df5c084 DIFF: https://github.com/llvm/llvm-project/commit/79fcd35c688b94becadd162a6c37e9b95df5c084.diff LOG: Revert "[lldb/test] Move "DataFormatters/Mock.h" to "Plugins/Language/ObjC/Utilities.h"" This reverts commit 82dbf4aca84ec889d0dc390674ff44e30441bcfd. It is a follow-up to b783f70a42575a5d9147bea1ac97e872370fe55b, which I'm reverting -- see the explanation in that revert. Added: lldb/include/lldb/DataFormatters/Mock.h lldb/unittests/DataFormatter/MockTests.cpp Modified: lldb/source/Plugins/Language/ObjC/Cocoa.cpp lldb/unittests/DataFormatter/CMakeLists.txt lldb/unittests/Language/CMakeLists.txt Removed: lldb/source/Plugins/Language/ObjC/Utilities.h lldb/unittests/Language/ObjC/CMakeLists.txt lldb/unittests/Language/ObjC/UtilitiesTests.cpp ################################################################################ diff --git a/lldb/source/Plugins/Language/ObjC/Utilities.h b/lldb/include/lldb/DataFormatters/Mock.h similarity index 73% rename from lldb/source/Plugins/Language/ObjC/Utilities.h rename to lldb/include/lldb/DataFormatters/Mock.h index 4cfeb2b28bfd..b3fc10cd2e51 100644 --- a/lldb/source/Plugins/Language/ObjC/Utilities.h +++ b/lldb/include/lldb/DataFormatters/Mock.h @@ -1,4 +1,4 @@ -//===-- Utilities.h ---------------------------------------------*- C++ -*-===// +//===-- Mock.h --------------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLDB_PLUGINS_LANGUAGE_OBJC_UTILITIES_H -#define LLDB_PLUGINS_LANGUAGE_OBJC_UTILITIES_H +#ifndef LLDB_DATAFORMATTERS_MOCK_H +#define LLDB_DATAFORMATTERS_MOCK_H namespace lldb_private { @@ -23,4 +23,4 @@ bool FormatDateValue(double date_value, Stream &stream); } // namespace formatters } // namespace lldb_private -#endif // LLDB_PLUGINS_LANGUAGE_OBJC_UTILITIES_H +#endif // LLDB_DATAFORMATTERS_MOCK_H diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp index 5128f2865879..37b352263260 100644 --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -8,12 +8,12 @@ #include "Cocoa.h" -#include "Plugins/Language/ObjC/Utilities.h" #include "Plugins/TypeSystem/Clang/TypeSystemClang.h" #include "lldb/Core/Mangled.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" +#include "lldb/DataFormatters/Mock.h" #include "lldb/DataFormatters/StringPrinter.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/Host/Time.h" diff --git a/lldb/unittests/DataFormatter/CMakeLists.txt b/lldb/unittests/DataFormatter/CMakeLists.txt index 45011c56b0b0..716c8e735287 100644 --- a/lldb/unittests/DataFormatter/CMakeLists.txt +++ b/lldb/unittests/DataFormatter/CMakeLists.txt @@ -1,5 +1,6 @@ add_lldb_unittest(LLDBFormatterTests FormatManagerTests.cpp + MockTests.cpp StringPrinterTests.cpp LINK_LIBS diff --git a/lldb/unittests/Language/ObjC/UtilitiesTests.cpp b/lldb/unittests/DataFormatter/MockTests.cpp similarity index 84% rename from lldb/unittests/Language/ObjC/UtilitiesTests.cpp rename to lldb/unittests/DataFormatter/MockTests.cpp index b28060973d86..f7daaf22d140 100644 --- a/lldb/unittests/Language/ObjC/UtilitiesTests.cpp +++ b/lldb/unittests/DataFormatter/MockTests.cpp @@ -1,4 +1,4 @@ -//===-- UtilitiesTests.cpp ------------------------------------------------===// +//===-- MockTests.cpp -----------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -#include "Plugins/Language/ObjC/Utilities.h" +#include "lldb/DataFormatters/Mock.h" #include "lldb/Utility/StreamString.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" @@ -25,8 +25,7 @@ static llvm::Optional<std::string> formatDateValue(double date_value) { } TEST(DataFormatterMockTest, NSDate) { - EXPECT_EQ(formatDateValue(-63114076800), - std::string("0001-12-30 00:00:00 +0000")); + EXPECT_EQ(*formatDateValue(-63114076800), "0001-12-30 00:00:00 +0000"); // Can't convert the date_value to a time_t. EXPECT_EQ(formatDateValue((double)(std::numeric_limits<time_t>::max()) + 1), @@ -35,10 +34,8 @@ TEST(DataFormatterMockTest, NSDate) { llvm::None); // Can't add the macOS epoch to the converted date_value (the add overflows). - EXPECT_EQ(formatDateValue((double)std::numeric_limits<time_t>::max()), - llvm::None); - EXPECT_EQ(formatDateValue((double)std::numeric_limits<time_t>::min()), - llvm::None); + EXPECT_EQ(formatDateValue((double)std::numeric_limits<time_t>::max()), llvm::None); + EXPECT_EQ(formatDateValue((double)std::numeric_limits<time_t>::min()), llvm::None); // FIXME: The formatting result is wrong on Windows because we adjust the // epoch when _WIN32 is defined (see GetOSXEpoch). diff --git a/lldb/unittests/Language/CMakeLists.txt b/lldb/unittests/Language/CMakeLists.txt index 51421bd84984..3a6e5de785e5 100644 --- a/lldb/unittests/Language/CMakeLists.txt +++ b/lldb/unittests/Language/CMakeLists.txt @@ -1,3 +1,2 @@ add_subdirectory(CPlusPlus) add_subdirectory(Highlighting) -add_subdirectory(ObjC) diff --git a/lldb/unittests/Language/ObjC/CMakeLists.txt b/lldb/unittests/Language/ObjC/CMakeLists.txt deleted file mode 100644 index e61ced1d5bfb..000000000000 --- a/lldb/unittests/Language/ObjC/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_lldb_unittest(LanguageObjCTests - UtilitiesTests.cpp - - LINK_LIBS - lldbPluginObjCLanguage - ) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits