npalardy / KitchenSink

A starter project that has piles of utilities and extensions for Xojo (one of everything including the kitchen sink)
Other
5 stars 2 forks source link

Running the project causes error in UnitTest for testDate #1

Closed markuswinter closed 2 months ago

markuswinter commented 2 months ago

Running the template without modifications results in

Preferences.RunUnitTests testDate did not match wrote 2033-01-02 03:04:05 got 2032-01-02 03:04:05

which is out by a year.

Last line is the exception raised:

Protected Sub Assert(condition As Boolean, message As String)
  If condition = False Then

    #If DebugBuild Then

      Dim skipShowingMsgBox As Boolean

      // threaded ?
      If (app.CurrentThread Is Nil) = False Then
        skipShowingMsgBox = True
      End If

      #If TargetMacOS
        If skipShowingMsgBox = False Then
          Try
            Raise New nilobjectException

System macOS 10.14.6 Mojave Xojo 2021 R3.1

npalardy commented 2 months ago

scratching my head trying to figure out how thats possible

npalardy commented 2 months ago

only thing to try is in MacOSPrefs.ReadDate try making line 18

setDateFormat(dataFormatterPtr, "yyyy-MM-dd HH:mm:ss") 

note YYYY changed to yyyy (change of case only)

markuswinter commented 2 months ago

Thanks - that does indeed fix the problem. 👍

npalardy commented 2 months ago

fixed & pushed