[Lldb-commits] [lldb] fff3a84 - [lldb/test] Relax NSDate mock test for non-Apple platforms

Vedant Kumar via lldb-commits lldb-commits at lists.llvm.org
Mon May 18 16:00:19 PDT 2020


Author: Vedant Kumar
Date: 2020-05-18T16:00:10-07:00
New Revision: fff3a8464d4d518c7086c928fba967908eb294d7

URL: https://github.com/llvm/llvm-project/commit/fff3a8464d4d518c7086c928fba967908eb294d7
DIFF: https://github.com/llvm/llvm-project/commit/fff3a8464d4d518c7086c928fba967908eb294d7.diff

LOG: [lldb/test] Relax NSDate mock test for non-Apple platforms

On Ubuntu, a formatted date prints as "GMT" instead of "UTC", which is
ok.

http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/4520/steps/test/logs/stdio

Added: 
    

Modified: 
    lldb/unittests/DataFormatter/MockTests.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/DataFormatter/MockTests.cpp b/lldb/unittests/DataFormatter/MockTests.cpp
index 0042888243f7..752e3987dac9 100644
--- a/lldb/unittests/DataFormatter/MockTests.cpp
+++ b/lldb/unittests/DataFormatter/MockTests.cpp
@@ -9,6 +9,7 @@
 #include "lldb/DataFormatters/Mock.h"
 #include "lldb/Utility/StreamString.h"
 #include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringRef.h"
 #include "gtest/gtest.h"
 #include <string>
 
@@ -36,5 +37,6 @@ TEST(DataFormatterMockTest, NSDate) {
   EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::max()), llvm::None);
   EXPECT_EQ(formatDateValue(std::numeric_limits<time_t>::min()), llvm::None);
 
-  EXPECT_EQ(*formatDateValue(0), "2001-01-01 00:00:00 UTC");
+  EXPECT_TRUE(
+      llvm::StringRef(*formatDateValue(0)).startswith("2001-01-01 00:00:00"));
 }


        


More information about the lldb-commits mailing list