[Lldb-commits] [lldb] e3aa4cd - [lldb/test] Disable NSDate format check under _WIN32

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


Author: Vedant Kumar
Date: 2020-05-18T16:51:47-07:00
New Revision: e3aa4cd9dbcee6441f51102e3958c35321698c67

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

LOG: [lldb/test] Disable NSDate format check under _WIN32

Disable the test which attempts to format an NSDate with a date_value of
0 on _WIN32.

When _WIN32 is defined, GetOSXEpoch returns a date that should be in
2001, but after this is passed through timegm (which, afaict isn't
portable?) the result is a date in 1970:

```
lldb-x64-windows-ninja\llvm-project\lldb\unittests\DataFormatter\MockTests.cpp(39): error:       Expected: *formatDateValue(0)
      Which is: "1970-01-01 00:00:00 Pacific Standard Time"
      To be equal to: "2001-01-01 00:00:00 UTC"
```

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 752e3987dac9..1185d7bf2c9c 100644
--- a/lldb/unittests/DataFormatter/MockTests.cpp
+++ b/lldb/unittests/DataFormatter/MockTests.cpp
@@ -37,6 +37,10 @@ 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);
 
+  // FIXME: The formatting result is wrong on Windows because we adjust the
+  // epoch when _WIN32 is defined (see GetOSXEpoch).
+#ifndef _WIN32
   EXPECT_TRUE(
       llvm::StringRef(*formatDateValue(0)).startswith("2001-01-01 00:00:00"));
+#endif
 }


        


More information about the lldb-commits mailing list