From: Eirik Tsarpalis Date: Fri, 7 Aug 2020 10:52:56 +0000 (+0100) Subject: Enable CBOR property tests in CI runs (#40135) X-Git-Tag: submit/tizen/20210909.063632~6162 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56b865af0a2e23903991d4922e9f6e3993b740e4;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Enable CBOR property tests in CI runs (#40135) * enable cbor property tests in CI runs * address feedback --- diff --git a/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs b/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs index 6aca08f..d265bae 100644 --- a/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs +++ b/src/libraries/System.Formats.Cbor/tests/PropertyTests/CborPropertyTests.cs @@ -12,7 +12,7 @@ namespace System.Formats.Cbor.Tests public static class CborPropertyTests { private const string? ReplaySeed = "(42,42)"; // set a seed for deterministic runs, null for randomized runs - private const int MaxTests = 10_000; + private const int MaxTests = 100; // FsCheck default is 100 [Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })] public static void Roundtrip_Int64(CborConformanceMode mode, long input) @@ -178,7 +178,7 @@ namespace System.Formats.Cbor.Tests } [Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })] - public static void PropertyTest_Roundtrip(CborPropertyTestContext input) + public static void CborDocument_Roundtrip(CborPropertyTestContext input) { byte[] encoding = CborDocumentSerializer.encode(input); @@ -188,7 +188,7 @@ namespace System.Formats.Cbor.Tests } [Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })] - public static void PropertyTest_SkipValue(CborPropertyTestContext input) + public static void CborDocument_SkipValue(CborPropertyTestContext input) { int length = input.RootDocuments.Length; input.RootDocuments = new[] { CborDocument.NewArray(_isDefiniteLength: true, input.RootDocuments) }; @@ -205,7 +205,7 @@ namespace System.Formats.Cbor.Tests } [Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })] - public static void PropertyTest_SkipToParent(CborPropertyTestContext input) + public static void CborDocument_SkipToParent(CborPropertyTestContext input) { input.RootDocuments = new[] { CborDocument.NewArray(_isDefiniteLength: true, input.RootDocuments) }; byte[] encoding = CborDocumentSerializer.encode(input); diff --git a/src/libraries/System.Formats.Cbor/tests/System.Formats.Cbor.Tests.csproj b/src/libraries/System.Formats.Cbor/tests/System.Formats.Cbor.Tests.csproj index 71735ea..c2211d7 100644 --- a/src/libraries/System.Formats.Cbor/tests/System.Formats.Cbor.Tests.csproj +++ b/src/libraries/System.Formats.Cbor/tests/System.Formats.Cbor.Tests.csproj @@ -1,20 +1,16 @@ - + $(NetCoreAppCurrent) enable - false - - - - $(DefineConstants),CBOR_PROPERTY_TESTS CS8002 - CommonTest\System\Security\Cryptography\ByteUtils.cs + + @@ -36,18 +32,11 @@ - - - - - - + - - - +