Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13610

Test passes on macOS and crashes (not fails) on Linux

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: XCTest
    • Labels:
      None
    • Environment:

      Ubuntu Linux 18.04

      Swift 5.2.4 and 5.3

      Description

      Steps to reproduce:

      1. clone this repo on linux http://github.com/nysander/twitter-text branch main

      2. run 

      swift test --enable-test-discovery --filter "testExtract"

      test will crash 

      Test Suite 'Selected tests' started at 2020-09-25 15:13:32.087
      Test Suite 'TwitterTextTests' started at 2020-09-25 15:13:32.090
      Test Case 'TwitterTextTests.testExtract' started at 2020-09-25 15:13:32.090
      free(): invalid pointer
      Exited with signal code 6
      

       

      3. checkout branch main

      replace line:https://github.com/nysander/twitter-text/blob/011711c6a34af351d83eed143d094fe67d5109ef/Tests/TwitterTextTests/TwitterTextTests.swift#L268

      with 

       

      var counter = 0
      for testCase in urls {
          counter += 1
          print(counter)
      // rest without change

      4. run test again - test passes

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            PawelMadej Paweł Madej
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: