diff --git a/TestFiles/x-11-pthreads.txt b/TestFiles/x-11-pthreads.txt new file mode 100644 index 00000000..00a238e8 --- /dev/null +++ b/TestFiles/x-11-pthreads.txt @@ -0,0 +1,21 @@ +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. diff --git a/src/test/java/org/spdx/utility/compare/LicenseCompareHelperTest.java b/src/test/java/org/spdx/utility/compare/LicenseCompareHelperTest.java index aad79917..455e6443 100644 --- a/src/test/java/org/spdx/utility/compare/LicenseCompareHelperTest.java +++ b/src/test/java/org/spdx/utility/compare/LicenseCompareHelperTest.java @@ -101,6 +101,7 @@ public class LicenseCompareHelperTest extends TestCase { static final String GPL_2_NL = "TestFiles" + File.separator + "GPL-2.0-NL.txt"; static final String GPL_2_TEMPLATE = "TestFiles" + File.separator + "GPL-2.0-only.template.txt"; static final String IMAGE_MAGIK_TEMPLATE = "TestFiles" + File.separator + "ImageMagick.template.txt"; + static final String X_11_PTHREADS = "TestFiles" + File.separator + "x-11-pthreads.txt"; IModelStore modelStore; IModelCopyManager copyManager; @@ -989,4 +990,12 @@ public void testAPIConsistency() throws InvalidSPDXAnalysisException, SpdxCompar assertAPIConsistency("MPL-2.0", UnitTestHelper.fileToText(MPL_2_FROM_MOZILLA_FILE)); } } + + public void testX11Pthreads() throws InvalidSPDXAnalysisException, SpdxCompareException, IOException { + String licText = UnitTestHelper.fileToText(X_11_PTHREADS); + String[] result = LicenseCompareHelper.matchingStandardLicenseIds(licText); + assertEquals(0, result.length); + ListedLicense license = ListedLicenses.getListedLicenses().getListedLicenseById("X11-distribute-modifications-variant"); + assertTrue(LicenseCompareHelper.isTextStandardLicense(license, licText).isDifferenceFound()); + } }