diff --git a/.brazil.json b/.brazil.json index dbb2135d1b..1b1a908eb0 100644 --- a/.brazil.json +++ b/.brazil.json @@ -2,7 +2,6 @@ "dependencies": { "org.jetbrains.kotlin:kotlin-stdlib:2.*": "KotlinStdlib-2.x", "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.*": "KotlinxCoroutinesCoreJvm-1.x", - "com.squareup.okhttp3:okhttp-coroutines:5.*": "OkHttp3Coroutines-5.x", "com.squareup.okhttp3:okhttp:5.*": "OkHttp3-5.x", "com.squareup.okio:okio-jvm:3.*": "OkioJvm-3.x", @@ -10,7 +9,8 @@ "org.slf4j:slf4j-api:2.*": "Maven-org-slf4j_slf4j-api-2.x", "aws.sdk.kotlin.crt:aws-crt-kotlin:0.9.*": "AwsCrtKotlin-0.9.x", "aws.sdk.kotlin.crt:aws-crt-kotlin:0.8.*": "AwsCrtKotlin-0.8.x", - "com.squareup.okhttp3:okhttp:4.*": "OkHttp3-4.x" + "com.squareup.okhttp3:okhttp:4.*": "OkHttp3-4.x", + "org.jetbrains.kotlinx:kotlinx-datetime-jvm:0.*": "KotlinxDatetimeJvm-0.x" }, "packageHandlingRules": { "versioning": { diff --git a/.changes/4820850c-8916-47f5-a7e1-8880e6a00d22.json b/.changes/4820850c-8916-47f5-a7e1-8880e6a00d22.json new file mode 100644 index 0000000000..297f7e603f --- /dev/null +++ b/.changes/4820850c-8916-47f5-a7e1-8880e6a00d22.json @@ -0,0 +1,5 @@ +{ + "id": "4820850c-8916-47f5-a7e1-8880e6a00d22", + "type": "bugfix", + "description": "Fix errors in equality checks for `CaseInsensitiveMap` which affect `Headers` and `ValuesMap` implementations" +} \ No newline at end of file diff --git a/.changes/c0040355-ffdc-4813-80e9-baf859ef02b9.json b/.changes/c0040355-ffdc-4813-80e9-baf859ef02b9.json new file mode 100644 index 0000000000..42302b920d --- /dev/null +++ b/.changes/c0040355-ffdc-4813-80e9-baf859ef02b9.json @@ -0,0 +1,5 @@ +{ + "id": "c0040355-ffdc-4813-80e9-baf859ef02b9", + "type": "bugfix", + "description": "fix: correct hash code calculation for case-insensitive map entries" +} \ No newline at end of file diff --git a/.github/workflows/artifact-size-metrics.yml b/.github/workflows/artifact-size-metrics.yml index ecb4f4bf7d..a9d3c7b6e9 100644 --- a/.github/workflows/artifact-size-metrics.yml +++ b/.github/workflows/artifact-size-metrics.yml @@ -31,6 +31,8 @@ jobs: with: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main - name: Generate Artifact Size Metrics run: ./gradlew artifactSizeMetrics - name: Save Artifact Size Metrics @@ -54,6 +56,8 @@ jobs: with: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main - name: Generate Artifact Size Metrics run: ./gradlew -Paws.kotlin.native=false artifactSizeMetrics - name: Analyze Artifact Size Metrics diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3486c8e707..b09ce9173d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -89,6 +89,11 @@ jobs: with: path: 'smithy-kotlin' + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main + with: + working-directory: 'smithy-kotlin' + - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build @@ -152,12 +157,10 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build - - name: Configure JDK - uses: actions/setup-java@v3 + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main with: - distribution: 'corretto' - java-version: 17 - cache: 'gradle' + working-directory: 'smithy-kotlin' - name: Test working-directory: ./smithy-kotlin @@ -186,6 +189,11 @@ jobs: - name: Setup build uses: ./smithy-kotlin/.github/actions/setup-build + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main + with: + working-directory: 'smithy-kotlin' + - name: Test working-directory: ./smithy-kotlin shell: bash @@ -211,6 +219,16 @@ jobs: path: 'aws-sdk-kotlin' repository: 'awslabs/aws-sdk-kotlin' + - name: Configure Gradle - smithy-kotlin + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main + with: + working-directory: ./smithy-kotlin + + - name: Configure Gradle - aws-sdk-kotlin + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main + with: + working-directory: ./aws-sdk-kotlin + - name: Build and Test aws-sdk-kotlin downstream working-directory: ./smithy-kotlin run: | diff --git a/.github/workflows/kat-transform.yml b/.github/workflows/kat-transform.yml index c3a5b23c5c..b4efd9e5a9 100644 --- a/.github/workflows/kat-transform.yml +++ b/.github/workflows/kat-transform.yml @@ -38,6 +38,11 @@ jobs: role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }} aws-region: us-west-2 + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main + with: + working-directory: ./smithy-kotlin + - name: Setup kat uses: awslabs/aws-kotlin-repo-tools/.github/actions/setup-kat@main diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e95b98aded..809b2bc451 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,6 +21,8 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 + - name: Configure Gradle + uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main - name: Lint ${{ env.PACKAGE_NAME }} run: | ./gradlew ktlint diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9bf7bd3397..b136486be8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionUrl=https://services.gradle.org/distributions/gradle-8.12.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/runtime/auth/aws-credentials/common/test/aws/smithy/kotlin/runtime/auth/awscredentials/CachedCredentialsProviderTest.kt b/runtime/auth/aws-credentials/common/test/aws/smithy/kotlin/runtime/auth/awscredentials/CachedCredentialsProviderTest.kt index 15a5ba1adf..6eb9b0d034 100644 --- a/runtime/auth/aws-credentials/common/test/aws/smithy/kotlin/runtime/auth/awscredentials/CachedCredentialsProviderTest.kt +++ b/runtime/auth/aws-credentials/common/test/aws/smithy/kotlin/runtime/auth/awscredentials/CachedCredentialsProviderTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.auth.awscredentials -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.collections.Attributes import aws.smithy.kotlin.runtime.time.Instant import aws.smithy.kotlin.runtime.time.ManualClock @@ -37,7 +36,6 @@ class CachedCredentialsProviderTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testLoadFirstCall() = runTest { // explicit expiration @@ -52,7 +50,6 @@ class CachedCredentialsProviderTest { assertEquals(1, source.callCount) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testDefaultExpiration() = runTest { // expiration should come from the cached provider @@ -65,7 +62,6 @@ class CachedCredentialsProviderTest { assertEquals(1, source.callCount) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReloadExpiredCredentials() = runTest { val source = TestCredentialsProvider(expiration = testExpiration) @@ -81,7 +77,6 @@ class CachedCredentialsProviderTest { assertEquals(2, source.callCount) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testRefreshBufferWindow() = runTest { val source = TestCredentialsProvider(expiration = testExpiration) @@ -103,7 +98,6 @@ class CachedCredentialsProviderTest { assertEquals(2, source.callCount) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testLoadFailed() = runTest { val source = object : CredentialsProvider { @@ -126,7 +120,6 @@ class CachedCredentialsProviderTest { provider.resolve() } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testItThrowsOnGetCredentialsAfterClose() = runTest { val source = TestCredentialsProvider(expiration = testExpiration) @@ -144,7 +137,6 @@ class CachedCredentialsProviderTest { assertEquals(1, source.callCount) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testCachedConvenienceFunction() = runTest { val source = TestCredentialsProvider(expiration = testExpiration) diff --git a/runtime/auth/aws-signing-common/common/test/aws/smithy/kotlin/runtime/auth/awssigning/PresignerTest.kt b/runtime/auth/aws-signing-common/common/test/aws/smithy/kotlin/runtime/auth/awssigning/PresignerTest.kt index 3f6e4eb5de..ec7a9d4ec7 100644 --- a/runtime/auth/aws-signing-common/common/test/aws/smithy/kotlin/runtime/auth/awssigning/PresignerTest.kt +++ b/runtime/auth/aws-signing-common/common/test/aws/smithy/kotlin/runtime/auth/awssigning/PresignerTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.auth.awssigning -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider import aws.smithy.kotlin.runtime.client.endpoints.Endpoint @@ -25,14 +24,12 @@ import kotlin.test.assertTrue class PresignerTest { // Verify that custom endpoint URL schemes aren't changed. // See https://github.com/awslabs/aws-sdk-kotlin/issues/938 - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testSignedUrlAllowsHttp() = testSigningUrl("http://localhost:8080/path/to/resource?foo=bar") // Verify that custom endpoint URL schemes aren't changed. // See https://github.com/awslabs/aws-sdk-kotlin/issues/938 @Test - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation fun testSignedUrlAllowsHttps() = testSigningUrl("https://localhost:8088/path/to/resource?bar=foo") private fun testSigningUrl(url: String) = runTest { diff --git a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt index 734371cb10..2dfbdf48e1 100644 --- a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt +++ b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultCanonicalizerTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.auth.awssigning -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import aws.smithy.kotlin.runtime.auth.awssigning.tests.DEFAULT_TEST_CREDENTIALS import aws.smithy.kotlin.runtime.http.Headers @@ -23,7 +22,6 @@ import kotlin.test.assertEquals class DefaultCanonicalizerTest { // Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCanonicalize() = runTest { val request = HttpRequest { @@ -84,7 +82,6 @@ class DefaultCanonicalizerTest { } // Targeted test for proper URI path escaping. See https://github.com/smithy-lang/smithy-kotlin/issues/657 - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testEscapablePath() { val uri = Url.Builder() @@ -101,7 +98,6 @@ class DefaultCanonicalizerTest { assertEquals("/2013-04-01/healthcheck/foo%253Cbar%253Ebaz%253C%252Fbar%253E", uri.canonicalPath(config)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCanonicalPath() { val config = AwsSigningConfig { @@ -117,7 +113,6 @@ class DefaultCanonicalizerTest { assertEquals("/foo/%40bar/baz%253Cqux%253Aquux", uri.canonicalPath(config)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCanonicalQueryParams() { Url.Builder().apply { @@ -132,7 +127,6 @@ class DefaultCanonicalizerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testUnsignedHeaders() = runTest { val request = HttpRequest { @@ -166,7 +160,6 @@ class DefaultCanonicalizerTest { assertEquals(expectedSignedHeaders, actual.signedHeaders) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCustomPort() = runTest { val request = HttpRequest { diff --git a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultRequestMutatorTest.kt b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultRequestMutatorTest.kt index 7f84e8658a..7eb10ab692 100644 --- a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultRequestMutatorTest.kt +++ b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultRequestMutatorTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.auth.awssigning -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import aws.smithy.kotlin.runtime.http.Headers import aws.smithy.kotlin.runtime.http.HttpBody @@ -16,7 +15,6 @@ import kotlin.test.Test import kotlin.test.assertEquals class DefaultRequestMutatorTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testAppendAuthHeader() { val canonical = CanonicalRequest(baseRequest.toBuilder(), "", "action;host;x-amz-date", "") diff --git a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt index 60264a43ac..fc5c23304c 100644 --- a/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt +++ b/runtime/auth/aws-signing-default/common/test/aws/smithy/kotlin/runtime/auth/awssigning/DefaultSignatureCalculatorTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.auth.awssigning -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import aws.smithy.kotlin.runtime.auth.awssigning.tests.DEFAULT_TEST_CREDENTIALS import aws.smithy.kotlin.runtime.hashing.sha256 @@ -17,7 +16,6 @@ import kotlin.test.assertEquals class DefaultSignatureCalculatorTest { // Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCalculate() { val signingKey = "c4afb1cc5771d871763a393e44b703571b55cc28424d1a5e86da6ed3c154a4b9".decodeHexBytes() @@ -34,7 +32,6 @@ class DefaultSignatureCalculatorTest { } // Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testSigningKey() = runTest { val config = AwsSigningConfig { @@ -50,7 +47,6 @@ class DefaultSignatureCalculatorTest { } // Test adapted from https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testStringToSign() { val canonicalRequest = """ @@ -84,7 +80,6 @@ class DefaultSignatureCalculatorTest { private data class ChunkStringToSignTest(val signatureType: AwsSignatureType, val expectedNonSignatureHeaderHash: String) - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testChunkStringToSign() { // Test event stream signing diff --git a/runtime/auth/http-auth-aws/common/test/aws/smithy/kotlin/runtime/http/auth/AwsHttpSignerTestBase.kt b/runtime/auth/http-auth-aws/common/test/aws/smithy/kotlin/runtime/http/auth/AwsHttpSignerTestBase.kt index 51be65b92a..1786744b01 100644 --- a/runtime/auth/http-auth-aws/common/test/aws/smithy/kotlin/runtime/http/auth/AwsHttpSignerTestBase.kt +++ b/runtime/auth/http-auth-aws/common/test/aws/smithy/kotlin/runtime/http/auth/AwsHttpSignerTestBase.kt @@ -108,7 +108,6 @@ public abstract class AwsHttpSignerTestBase( return operation.context[HttpOperationContext.HttpCallList].last().request } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test public fun testSignRequest(): TestResult = runTest { val op = buildOperation() @@ -122,7 +121,6 @@ public abstract class AwsHttpSignerTestBase( assertEquals(expectedSig, signed.headers["Authorization"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test public fun testUnsignedRequest(): TestResult = runTest { val op = buildOperation(unsigned = true) @@ -136,7 +134,7 @@ public abstract class AwsHttpSignerTestBase( assertEquals(expectedSig, signed.headers["Authorization"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation + @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation. @Test public fun testSignReplayableStreamingRequest(): TestResult = runTest { val op = buildOperation(streaming = true) @@ -150,7 +148,7 @@ public abstract class AwsHttpSignerTestBase( assertEquals(expectedSig, signed.headers["Authorization"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation + @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation. @Test public fun testSignAwsChunkedStreamNonReplayable(): TestResult = runTest { val op = buildOperation(streaming = true, replayable = false, requestBody = "a".repeat(AWS_CHUNKED_THRESHOLD + 1)) @@ -164,7 +162,7 @@ public abstract class AwsHttpSignerTestBase( assertEquals(expectedSig, signed.headers["Authorization"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation + @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation. @Test public fun testSignAwsChunkedStreamReplayable(): TestResult = runTest { val op = buildOperation(streaming = true, replayable = true, requestBody = "a".repeat(AWS_CHUNKED_THRESHOLD + 1)) @@ -178,7 +176,7 @@ public abstract class AwsHttpSignerTestBase( assertEquals(expectedSig, signed.headers["Authorization"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation + @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation. @Test public fun testSignOneShotStream(): TestResult = runTest { val op = buildOperation(streaming = true, replayable = false) diff --git a/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt b/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt index eb4209c74a..4c8ee5c3ba 100644 --- a/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt +++ b/runtime/crt-util/jvmAndNative/test/aws/smithy/kotlin/runtime/crt/SdkSourceBodyStreamTest.kt @@ -6,7 +6,6 @@ package aws.smithy.kotlin.runtime.crt import aws.sdk.kotlin.crt.io.MutableBuffer -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.io.SdkBuffer import aws.smithy.kotlin.runtime.io.SdkSource import aws.smithy.kotlin.runtime.io.source @@ -22,7 +21,6 @@ class SdkSourceBodyStreamTest { return MutableBuffer.of(dest) to dest } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadFully() = runTest { val data = byteArrayOf(1, 2, 3, 4, 5) @@ -37,7 +35,6 @@ class SdkSourceBodyStreamTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testPartialRead() = runTest { val source = "123456".encodeToByteArray().source() @@ -55,7 +52,6 @@ class SdkSourceBodyStreamTest { assertEquals("456", sent2.decodeToString()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testLargeTransfer() = runTest { val data = "foobar" diff --git a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/EventStreamSigningTest.kt b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/EventStreamSigningTest.kt index f9333af4a9..b672571184 100644 --- a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/EventStreamSigningTest.kt +++ b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/EventStreamSigningTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.auth.awscredentials.Credentials import aws.smithy.kotlin.runtime.auth.awscredentials.CredentialsProvider import aws.smithy.kotlin.runtime.auth.awssigning.* @@ -29,7 +28,6 @@ class EventStreamSigningTest { override suspend fun resolve(attributes: Attributes) = testCredentials } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSignPayload() = runTest { val messageToSign = buildMessage { @@ -68,7 +66,6 @@ class EventStreamSigningTest { assertEquals(expected, actualSignature) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEmptyEndFrameSent() = runTest { val messageToSign = buildMessage { diff --git a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameDecoderTest.kt b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameDecoderTest.kt index a9214f46e4..4e35cb58dc 100644 --- a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameDecoderTest.kt +++ b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameDecoderTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.io.* import io.kotest.matchers.string.shouldContain import kotlinx.coroutines.flow.* @@ -15,7 +14,6 @@ import kotlin.test.assertEquals import kotlin.test.assertFailsWith class FrameDecoderTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testFrameStreamSingleMessage() = runTest { val encoded = validMessageWithAllHeaders() @@ -29,7 +27,6 @@ class FrameDecoderTest { assertEquals(expected, actual.first()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testFrameStreamMultipleMessagesChunked() = runTest { val encoded = SdkBuffer().apply { @@ -53,7 +50,6 @@ class FrameDecoderTest { assertEquals(expected3, actual[2]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testChannelClosed() = runTest { // contents don't matter diff --git a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameEncoderTest.kt b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameEncoderTest.kt index ae82292eec..ccc80102ed 100644 --- a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameEncoderTest.kt +++ b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/FrameEncoderTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.readAll import aws.smithy.kotlin.runtime.io.SdkBuffer import kotlinx.coroutines.flow.flowOf @@ -17,7 +16,6 @@ import kotlin.test.assertContentEquals import kotlin.test.assertEquals class FrameEncoderTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEncode() = runTest { val expected = listOf( @@ -44,7 +42,6 @@ class FrameEncoderTest { assertContentEquals(expected[2], actual[2].readByteArray()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testAsEventStreamHttpBody() = runTest { val messages = flowOf( diff --git a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/HeaderValueTest.kt b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/HeaderValueTest.kt index 8478472b32..16602572ea 100644 --- a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/HeaderValueTest.kt +++ b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/HeaderValueTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.time.Instant import aws.smithy.kotlin.runtime.util.Uuid import io.kotest.matchers.string.shouldContain @@ -16,7 +15,6 @@ import kotlin.test.assertFails class HeaderValueTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testExpectAs() { assertEquals(true, HeaderValue.Bool(true).expectBool()) diff --git a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/MessageTest.kt b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/MessageTest.kt index 95ec4e8dbd..4b37771253 100644 --- a/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/MessageTest.kt +++ b/runtime/protocol/aws-event-stream/common/test/aws/smithy/kotlin/runtime/awsprotocol/eventstream/MessageTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.eventstream -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.io.EOFException import aws.smithy.kotlin.runtime.io.SdkBuffer import aws.smithy.kotlin.runtime.time.Instant @@ -53,7 +52,6 @@ fun validMessageNoHeaders(): ByteArray = byteArrayFrom( class MessageTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testMessageNoHeaders() { // Test message taken from the CRT: @@ -70,7 +68,6 @@ class MessageTest { assertEquals(expectedPayload, actual.payload.decodeToString()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testMessageOneHeader() { // Test message taken from the CRT: @@ -92,7 +89,6 @@ class MessageTest { assertEquals(expectedHeaders, actual.headers) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testRoundTripAllHeadersPayload() { val encoded = validMessageWithAllHeaders() @@ -122,7 +118,6 @@ class MessageTest { assertContentEquals(message.payload, result.payload) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidHeaderStringValueLength() { // header length = -1 @@ -144,7 +139,6 @@ class MessageTest { }.message.shouldContain("Invalid HeaderValue; type=STRING, len=65535") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidHeaderStringLengthCutoff() { val encoded = byteArrayFrom( @@ -161,7 +155,6 @@ class MessageTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidHeaderValueType() { val encoded = byteArrayFrom( @@ -182,7 +175,6 @@ class MessageTest { }.message.shouldContain("Unknown HeaderType: 96") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidHeaderNameLength() { val encoded = byteArrayFrom( @@ -203,7 +195,6 @@ class MessageTest { }.message.shouldContain("Invalid header name length") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidHeadersLength() { val encoded = byteArrayFrom( @@ -220,7 +211,6 @@ class MessageTest { }.message.shouldContain("Not enough bytes to read header name; needed: 3; remaining: 1") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidPreludeChecksum() { val encoded = byteArrayFrom( @@ -241,7 +231,6 @@ class MessageTest { }.message.shouldContain("Prelude checksum mismatch; expected=0xdeadbeef; calculated=0x8bb495fb") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidMessageChecksum() { val encoded = byteArrayFrom( @@ -262,7 +251,6 @@ class MessageTest { }.message.shouldContain("Message checksum mismatch; expected=0xdeadbeef; calculated=0x01a05860") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidHeaderNameLengthTooLong() { val encoded = byteArrayFrom( diff --git a/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt b/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt index 41cbabfe8f..b26ed992af 100644 --- a/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt +++ b/runtime/protocol/aws-json-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/json/AwsJsonProtocolTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.awsprotocol.json -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.operation.* @@ -18,7 +17,6 @@ import kotlin.test.Test import kotlin.test.assertEquals class AwsJsonProtocolTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSetJsonProtocolHeaders() = runTest { @Suppress("DEPRECATION") @@ -41,7 +39,6 @@ class AwsJsonProtocolTest { assertEquals("FooService_blah.Bar", request.headers["X-Amz-Target"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEmptyBody() = runTest { @Suppress("DEPRECATION") @@ -61,7 +58,6 @@ class AwsJsonProtocolTest { assertEquals("{}", actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testDoesNotOverride() = runTest { @Suppress("DEPRECATION") diff --git a/runtime/protocol/aws-protocol-core/common/test/ClockSkewInterceptorTest.kt b/runtime/protocol/aws-protocol-core/common/test/ClockSkewInterceptorTest.kt index 67bd5c90a4..71afea0700 100644 --- a/runtime/protocol/aws-protocol-core/common/test/ClockSkewInterceptorTest.kt +++ b/runtime/protocol/aws-protocol-core/common/test/ClockSkewInterceptorTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.awsprotocol -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.SdkBaseException import aws.smithy.kotlin.runtime.ServiceErrorMetadata import aws.smithy.kotlin.runtime.awsprotocol.ClockSkewInterceptor.Companion.CLOCK_SKEW_THRESHOLD @@ -32,50 +31,45 @@ private val POSSIBLE_SKEWED_RESPONSE_CODE_DESCRIPTION = "InvalidSignatureExcepti private val NOT_SKEWED_RESPONSE_CODE_DESCRIPTION = "RequestThrottled" class ClockSkewInterceptorTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testNotSkewed() { - val clientTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400") - val serverTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400") + val clientTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:20:50 -0400") + val serverTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:20:50 -0400") assertEquals(clientTime, serverTime) assertFalse(clientTime.isSkewed(serverTime, NOT_SKEWED_RESPONSE_CODE_DESCRIPTION)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSkewedByResponseCode() { // clocks are exactly the same, but service returned skew error - val clientTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400") - val serverTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400") + val clientTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:20:50 -0400") + val serverTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:20:50 -0400") assertTrue(clientTime.isSkewed(serverTime, SKEWED_RESPONSE_CODE_DESCRIPTION)) assertEquals(0.days, clientTime.until(serverTime)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSkewedByTime() { - val clientTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400") - val serverTime = Instant.fromRfc5322("Wed, 7 Oct 2023 16:20:50 -0400") + val clientTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:20:50 -0400") + val serverTime = Instant.fromRfc5322("Sat, 7 Oct 2023 16:20:50 -0400") assertTrue(clientTime.isSkewed(serverTime, POSSIBLE_SKEWED_RESPONSE_CODE_DESCRIPTION)) assertEquals(1.days, clientTime.until(serverTime)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNegativeSkewedByTime() { - val clientTime = Instant.fromRfc5322("Wed, 7 Oct 2023 16:20:50 -0400") - val serverTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:20:50 -0400") + val clientTime = Instant.fromRfc5322("Sat, 7 Oct 2023 16:20:50 -0400") + val serverTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:20:50 -0400") assertTrue(clientTime.isSkewed(serverTime, POSSIBLE_SKEWED_RESPONSE_CODE_DESCRIPTION)) assertEquals(-1.days, clientTime.until(serverTime)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSkewThreshold() { val minute = 20 var clientTime = - Instant.fromRfc5322("Wed, 6 Oct 2023 16:${minute - CLOCK_SKEW_THRESHOLD.inWholeMinutes}:50 -0400") - val serverTime = Instant.fromRfc5322("Wed, 6 Oct 2023 16:$minute:50 -0400") + Instant.fromRfc5322("Fri, 6 Oct 2023 16:${minute - CLOCK_SKEW_THRESHOLD.inWholeMinutes}:50 -0400") + val serverTime = Instant.fromRfc5322("Fri, 6 Oct 2023 16:$minute:50 -0400") assertTrue(clientTime.isSkewed(serverTime, POSSIBLE_SKEWED_RESPONSE_CODE_DESCRIPTION)) assertEquals(CLOCK_SKEW_THRESHOLD, clientTime.until(serverTime)) @@ -131,18 +125,16 @@ class ClockSkewInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testClockSkewApplied() = runTest { testRoundTrip( - serverTimeString = "Wed, 14 Sep 2023 16:20:50 -0400", // Big skew + serverTimeString = "Thu, 14 Sep 2023 16:20:50 -0400", // Big skew clientTimeString = "20231006T131604Z", httpStatusCode = HttpStatusCode.Forbidden, expectException = false, ) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testClockSkewNotApplied_NoSkew() = runTest { testRoundTrip( @@ -153,7 +145,6 @@ class ClockSkewInterceptorTest { ) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testClockSkewNotApplied_BadDate() = runTest { testRoundTrip( diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt index 531a253127..88e88561e7 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/RequestConversionTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.engine.crt -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.content.ByteStream import aws.smithy.kotlin.runtime.crt.ReadChannelBodyStream import aws.smithy.kotlin.runtime.http.* @@ -54,7 +53,6 @@ class RequestConversionTest { assertFalse(crtRequest.body is ReadChannelBodyStream) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSdkToCrtRequestStreamingBody() { val stream = byteStreamFromContents("foobar") @@ -73,7 +71,6 @@ class RequestConversionTest { crtBody.cancel() } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEngineAddsContentLengthHeader() { val stream = byteStreamFromContents("foobar") diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt index e5fc0259c9..7382adcca4 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SdkStreamResponseHandlerTest.kt @@ -125,7 +125,6 @@ class SdkStreamResponseHandlerTest { assertTrue(respChan.isClosedForWrite) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testRespBody() = runTest { val handler = SdkStreamResponseHandler(mockConn, coroutineContext) @@ -154,7 +153,7 @@ class SdkStreamResponseHandlerTest { assertEquals(data, respChan.readToBuffer().readUtf8()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation + @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation. @Test fun testStreamError() = runTest { val handler = SdkStreamResponseHandler(mockConn, coroutineContext) diff --git a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt index f456817161..88366c41f0 100644 --- a/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt +++ b/runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/SendChunkedBodyTest.kt @@ -6,7 +6,6 @@ package aws.smithy.kotlin.runtime.http.engine.crt import aws.sdk.kotlin.crt.http.HttpStream -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.toHttpBody import aws.smithy.kotlin.runtime.io.SdkByteReadChannel import aws.smithy.kotlin.runtime.io.readToByteArray @@ -28,7 +27,6 @@ class SendChunkedBodyTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSourceContent() = runTest { val stream = MockHttpStream(200) @@ -46,7 +44,6 @@ class SendChunkedBodyTest { assertEquals(1, stream.numChunksWritten) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testChannelContentMultipleChunks() = runTest { val stream = MockHttpStream(200) @@ -68,7 +65,6 @@ class SendChunkedBodyTest { assertTrue(stream.numChunksWritten > 1) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testChannelContent() = runTest { val stream = MockHttpStream(200) @@ -87,7 +83,6 @@ class SendChunkedBodyTest { assertEquals(1, stream.numChunksWritten) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSourceContentMultipleChunks() = runTest { val stream = MockHttpStream(200) diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpCallContextTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpCallContextTest.kt index e6183f8ece..cb41cff0d4 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpCallContextTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpCallContextTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.http.engine -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.Headers import aws.smithy.kotlin.runtime.http.HttpBody import aws.smithy.kotlin.runtime.http.HttpCall @@ -25,7 +24,6 @@ import kotlin.test.assertTrue import kotlin.coroutines.coroutineContext as currentCoroutineContext class HttpCallContextTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @OptIn(ExperimentalCoroutinesApi::class) @Test fun testStructuredConcurrency() = runTest { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpClientEngineTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpClientEngineTest.kt index 0fbaa6cb04..4468534cb8 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpClientEngineTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpClientEngineTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.engine -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.HttpCall import aws.smithy.kotlin.runtime.http.complete @@ -61,7 +60,6 @@ class HttpClientEngineTest { private val HttpCall.job: Job get() = coroutineContext.job - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCallComplete() = runTest { val call = client.call(HttpRequestBuilder()) @@ -71,7 +69,6 @@ class HttpClientEngineTest { assertTrue(call.job.isCompleted) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testUserContextCancelsRequestJob() = runTest { val job = launch { @@ -88,7 +85,6 @@ class HttpClientEngineTest { assertTrue(callJob.isCancelled) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testInFlightRequestJobsAreIndependent() = runTest { val job1 = launch { @@ -113,7 +109,6 @@ class HttpClientEngineTest { job2.cancel() } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testEngineJobNotCancelledByRequestJobs() = runTest { launch { @@ -131,7 +126,6 @@ class HttpClientEngineTest { assertTrue(engine.coroutineContext.job.isActive) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testShutdownOnlyAfterInFlightDone() = runTest { val waiter = Channel(1) @@ -166,7 +160,6 @@ class HttpClientEngineTest { assertTrue(engine.shutdownCalled) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testRequestAfterClose() = runTest { engine.close() diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/CachingChecksumInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/CachingChecksumInterceptorTest.kt index c464e99994..cee1db7766 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/CachingChecksumInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/CachingChecksumInterceptorTest.kt @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.client.ProtocolRequestInterceptorContext import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.http.HttpBody @@ -25,7 +24,6 @@ private val CHECKSUM_TEST_HEADER = "x-amz-kotlin-sdk-test-checksum-header" class CachingChecksumInterceptorTest { private val client = SdkHttpClient(TestEngine()) - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testChecksumIsCalculatedAndApplied() = runTest { val req = HttpRequestBuilder().apply { @@ -42,7 +40,6 @@ class CachingChecksumInterceptorTest { assertEquals(expectedChecksumValue, call.request.headers[CHECKSUM_TEST_HEADER]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCachedChecksumIsUsed() = runTest { val req = HttpRequestBuilder().apply { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsRequestInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsRequestInterceptorTest.kt index f95349752e..37e5054865 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsRequestInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsRequestInterceptorTest.kt @@ -6,7 +6,6 @@ package aws.smithy.kotlin.runtime.http.interceptors import aws.smithy.kotlin.runtime.ClientException -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.client.config.RequestHttpChecksumConfig import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.hashing.toHashFunction @@ -33,7 +32,6 @@ class FlexibleChecksumsRequestInterceptorTest { "sha256" to "1dXchshIKqXiaKCqueqR7AOz1qLpiqayo7gbnaxzaQo=", ) - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSetsChecksumHeader() = runTest { checksums.forEach { (checksumAlgorithmName, expectedChecksumValue) -> @@ -57,7 +55,6 @@ class FlexibleChecksumsRequestInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itAllowsOnlyOneChecksumHeader() = runTest { val req = HttpRequestBuilder().apply { @@ -86,7 +83,6 @@ class FlexibleChecksumsRequestInterceptorTest { assertEquals(1, call.request.headers.getNumChecksumHeaders()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itThrowsOnUnsupportedChecksumAlgorithm() = runTest { val req = HttpRequestBuilder().apply { @@ -109,7 +105,6 @@ class FlexibleChecksumsRequestInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itRemovesChecksumHeadersForAwsChunked() = runTest { val data = ByteArray(65536 * 32) { 'a'.code.toByte() } @@ -140,7 +135,6 @@ class FlexibleChecksumsRequestInterceptorTest { assertEquals(0, call.request.headers.getNumChecksumHeaders()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCompletingSource() = runTest { val hashFunctionName = "crc32" @@ -162,7 +156,6 @@ class FlexibleChecksumsRequestInterceptorTest { assertEquals(expectedHash.digest().encodeBase64String(), completableDeferred.await()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCompletingByteReadChannel() = runTest { val hashFunctionName = "sha256" @@ -186,7 +179,6 @@ class FlexibleChecksumsRequestInterceptorTest { assertEquals(expectedHash.digest().encodeBase64String(), completableDeferred.await()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itUsesPrecalculatedChecksum() = runTest { val req = HttpRequestBuilder().apply { @@ -213,7 +205,6 @@ class FlexibleChecksumsRequestInterceptorTest { assertEquals(precalculatedChecksumValue, call.request.headers["x-amz-checksum-sha256"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testDefaultChecksumConfiguration() = runTest { setOf( diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptorTest.kt index 48501c89ef..e465499ad1 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/FlexibleChecksumsResponseInterceptorTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.interceptors -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.client.config.ResponseHttpChecksumConfig import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.http.* @@ -68,7 +67,6 @@ class FlexibleChecksumsResponseInterceptorTest { return SdkHttpClient(mockEngine) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testResponseChecksumValid() = runTest { checksums.forEach { (checksumAlgorithmName, expectedChecksum) -> @@ -96,7 +94,6 @@ class FlexibleChecksumsResponseInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testResponseServiceChecksumInvalid() = runTest { checksums.forEach { (checksumAlgorithmName, _) -> @@ -126,7 +123,6 @@ class FlexibleChecksumsResponseInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testMultipleChecksumsReturned() = runTest { val req = HttpRequestBuilder() @@ -152,7 +148,6 @@ class FlexibleChecksumsResponseInterceptorTest { assertEquals("x-amz-checksum-crc32c", op.context[ChecksumHeaderValidated]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testSkipsValidationOfMultipartChecksum() = runTest { val req = HttpRequestBuilder() @@ -174,7 +169,6 @@ class FlexibleChecksumsResponseInterceptorTest { op.roundTrip(client, TestInput("input")) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testSkipsValidationWhenDisabled() = runTest { val req = HttpRequestBuilder() @@ -201,7 +195,6 @@ class FlexibleChecksumsResponseInterceptorTest { assertNull(op.context.getOrNull(ChecksumHeaderValidated)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testResponseValidationConfiguration() = runTest { setOf( diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/HttpChecksumRequiredInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/HttpChecksumRequiredInterceptorTest.kt index 8634c0735a..df2cf49f0e 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/HttpChecksumRequiredInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/HttpChecksumRequiredInterceptorTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.interceptors -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.hashing.Crc32 import aws.smithy.kotlin.runtime.http.HttpBody @@ -25,7 +24,6 @@ import kotlin.test.assertNull class HttpChecksumRequiredInterceptorTest { private val client = SdkHttpClient(TestEngine()) - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSetsContentMd5Header() = runTest { val req = HttpRequestBuilder().apply { @@ -44,7 +42,6 @@ class HttpChecksumRequiredInterceptorTest { assertEquals(expected, call.request.headers["Content-MD5"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSetsContentCrc32Header() = runTest { val testBody = "bar".encodeToByteArray() @@ -68,7 +65,6 @@ class HttpChecksumRequiredInterceptorTest { assertEquals(expected, call.request.headers["x-amz-checksum-crc32"]) } - @IgnoreNative @Test fun itSetsHeaderForNonBytesContent() = runTest { val req = HttpRequestBuilder().apply { @@ -89,7 +85,6 @@ class HttpChecksumRequiredInterceptorTest { assertEquals(expected, call.request.headers["Content-MD5"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itDoesNotSetContentMd5Header() = runTest { val req = HttpRequestBuilder().apply { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTest.kt index 725989fe98..11163c4a61 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/RequestCompressionInterceptorTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.interceptors -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.compression.CompressionAlgorithm import aws.smithy.kotlin.runtime.compression.Gzip @@ -59,7 +58,6 @@ class RequestCompressionInterceptorTest { return op.context.attributes[HttpOperationContext.HttpCallList].first() } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCompressionThresholdTooHigh() = runTest { val payload = "bar" @@ -79,7 +77,6 @@ class RequestCompressionInterceptorTest { assertEquals(bytes, sentBytes) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCompression() = runTest { val payload = "bar" @@ -100,7 +97,6 @@ class RequestCompressionInterceptorTest { assertContentEquals(bytes, decompressedBytes) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSdkSource() = runTest { val payload = "bar" @@ -121,7 +117,6 @@ class RequestCompressionInterceptorTest { assertContentEquals(bytes, decompressedBytes) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSdkByteReadChannel() = runTest { val payload = "bar" @@ -142,7 +137,6 @@ class RequestCompressionInterceptorTest { assertContentEquals(bytes, decompressedBytes) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testHeaderAlreadySet() = runTest { val payload = "bar" @@ -164,7 +158,6 @@ class RequestCompressionInterceptorTest { assertContentEquals(bytes, decompressedBytes) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNoSupportedAlgorithms() = runTest { val payload = "bar" @@ -184,7 +177,6 @@ class RequestCompressionInterceptorTest { assertEquals(bytes, sentBytes) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInvalidCompressionThreshold() = runTest { val payload = "bar" diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/ResponseLengthValidationInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/ResponseLengthValidationInterceptorTest.kt index 4fa184459d..e9730f726c 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/ResponseLengthValidationInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/interceptors/ResponseLengthValidationInterceptorTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.http.interceptors -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.HttpCall import aws.smithy.kotlin.runtime.http.operation.* @@ -78,7 +77,6 @@ class ResponseLengthValidationInterceptorTest { private fun allBodies() = nonEmptyBodies() + HttpBody.Empty - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testCorrectLengthReturned() = runTest { nonEmptyBodies().forEach { body -> @@ -88,7 +86,6 @@ class ResponseLengthValidationInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNotEnoughBytesReturned() = runTest { nonEmptyBodies().forEach { body -> @@ -100,7 +97,6 @@ class ResponseLengthValidationInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testTooManyBytesReturned() = runTest { allBodies().forEach { body -> @@ -112,7 +108,6 @@ class ResponseLengthValidationInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNoContentLengthSkipsValidation() = runTest { allBodies().forEach { body -> @@ -122,7 +117,6 @@ class ResponseLengthValidationInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEmptyBodyCorrectLengthReturned() = runTest { val client = client(HttpBody.Empty, 0) // expect correct content length diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/DefaultValidateResponseTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/DefaultValidateResponseTest.kt index d8667ae65f..71d1d67ce2 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/DefaultValidateResponseTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/DefaultValidateResponseTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.http.middleware -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.Headers import aws.smithy.kotlin.runtime.http.HttpBody import aws.smithy.kotlin.runtime.http.HttpCall @@ -22,7 +21,6 @@ import kotlin.test.assertEquals import kotlin.test.assertFailsWith class DefaultValidateResponseTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itThrowsExceptionOnNon200Response() = runTest { val mockEngine = TestEngine { _, request -> @@ -46,7 +44,6 @@ class DefaultValidateResponseTest { return@runTest } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itPassesSuccessResponses() = runTest { val mockEngine = TestEngine { _, request -> diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/MutateHeadersTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/MutateHeadersTest.kt index 7d2632749d..f97a982714 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/MutateHeadersTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/MutateHeadersTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.middleware -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.http.SdkHttpClient import aws.smithy.kotlin.runtime.http.operation.HttpOperationContext @@ -21,7 +20,6 @@ import kotlin.test.assertEquals class MutateHeadersTest { private val client = SdkHttpClient(TestEngine()) - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itOverridesHeaders() = runTest { val req = HttpRequestBuilder().apply { @@ -52,7 +50,6 @@ class MutateHeadersTest { assertEquals("qux", call.request.headers["baz"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itAppendsHeaders() = runTest { val req = HttpRequestBuilder().apply { @@ -83,7 +80,6 @@ class MutateHeadersTest { assertEquals("qux", call.request.headers["baz"]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSetsMissing() = runTest { val req = HttpRequestBuilder().apply { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/RetryMiddlewareTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/RetryMiddlewareTest.kt index b2bb1bc816..d80c48ab75 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/RetryMiddlewareTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/middleware/RetryMiddlewareTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.middleware -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.collections.get import aws.smithy.kotlin.runtime.http.SdkHttpClient import aws.smithy.kotlin.runtime.http.operation.HttpOperationContext @@ -35,7 +34,6 @@ class RetryMiddlewareTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testRetryMiddleware() = runTest { val req = HttpRequestBuilder() diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorOrderTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorOrderTest.kt index 0a64190951..297b9db295 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorOrderTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorOrderTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.operation -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder @@ -136,7 +135,6 @@ class HttpInterceptorOrderTest { hooksFired.shouldContainInOrder(expected) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testInterceptorOrderSuccess() = runTest { // sanity test all hooks fire in order @@ -153,109 +151,91 @@ class HttpInterceptorOrderTest { assertEquals(expected, hooksFired) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadBeforeExecutionErrors() = runTest { simpleFailOrderTest("readBeforeExecution") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeSerializationErrors() = runTest { simpleFailOrderTest("modifyBeforeSerialization") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadBeforeSerializationErrors() = runTest { simpleFailOrderTest("readBeforeSerialization") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadAfterSerializationErrors() = runTest { simpleFailOrderTest("readAfterSerialization") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeRetryLoopErrors() = runTest { simpleFailOrderTest("modifyBeforeRetryLoop") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadBeforeAttemptErrors() = runTest { simpleFailOrderTest("readBeforeAttempt") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeSigningErrors() = runTest { simpleFailOrderTest("modifyBeforeSigning") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadBeforeSigningErrors() = runTest { simpleFailOrderTest("readBeforeSigning") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadAfterSigningErrors() = runTest { simpleFailOrderTest("readAfterSigning") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeTransmitErrors() = runTest { simpleFailOrderTest("modifyBeforeTransmit") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testReadBeforeTransmitErrors() = runTest { simpleFailOrderTest("readBeforeTransmit") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadAfterTransmitErrors() = runTest { simpleFailOrderTest("readAfterTransmit") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadBeforeDeserializationErrors() = runTest { simpleFailOrderTest("readBeforeDeserialization") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadAfterDeserializationErrors() = runTest { simpleFailOrderTest("readAfterDeserialization") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadAfterAttemptErrors() = runTest { simpleFailOrderTest("readAfterAttempt") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testModifyBeforeAttemptCompletionErrors() = runTest { simpleFailOrderTest("modifyBeforeAttemptCompletion") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testModifyBeforeCompletionErrors() = runTest { simpleFailOrderTest("modifyBeforeCompletion") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadAfterExecutionErrors() = runTest { simpleFailOrderTest("readAfterExecution") diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTest.kt index b2830268da..ffa4a4d894 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTest.kt @@ -152,7 +152,6 @@ class HttpInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testInterceptorModifications() = runTest { val serialized = HttpRequestBuilder().apply { @@ -175,7 +174,6 @@ class HttpInterceptorTest { assertEquals("final", output.value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testInterceptorModificationsWithRetries() = runTest { val serialized = HttpRequestBuilder().apply { @@ -214,7 +212,6 @@ class HttpInterceptorTest { assertEquals("ignore-failure", output.value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testMapFailureOnAttempt() = runTest { val interceptor = object : HttpInterceptor { @@ -227,7 +224,6 @@ class HttpInterceptorTest { testMapFailure(interceptor) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testMapFailureOnCompletion() = runTest { val interceptor = object : HttpInterceptor { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTypeValidationTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTypeValidationTest.kt index e7847ff8fa..7d2cd3d88f 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTypeValidationTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/HttpInterceptorTypeValidationTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.operation -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.client.* import aws.smithy.kotlin.runtime.http.interceptors.HttpInterceptor import aws.smithy.kotlin.runtime.http.request.HttpRequest @@ -17,7 +16,6 @@ import kotlin.IllegalStateException import kotlin.test.* class HttpInterceptorTypeValidationTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeSerializationTypeFailure() = runTest { val i1 = object : HttpInterceptor { @@ -46,7 +44,6 @@ class HttpInterceptorTypeValidationTest { ex.message.shouldContain("modifyBeforeSerialization invalid type conversion: found class aws.smithy.kotlin.runtime.http.operation.TestOutput; expected class aws.smithy.kotlin.runtime.http.operation.TestInput") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeAttemptCompletionTypeFailure() = runTest { val i1 = object : HttpInterceptor { @@ -74,7 +71,6 @@ class HttpInterceptorTypeValidationTest { ex.message.shouldContain("modifyBeforeAttemptCompletion invalid type conversion: found class kotlin.String; expected class aws.smithy.kotlin.runtime.http.operation.TestOutput") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testModifyBeforeCompletionTypeFailure() = runTest { val i1 = object : HttpInterceptor { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkHttpOperationTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkHttpOperationTest.kt index 59bbc66974..22e36d1cf1 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkHttpOperationTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkHttpOperationTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.operation -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.SdkHttpClient import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder import aws.smithy.kotlin.runtime.httptest.TestEngine @@ -19,7 +18,6 @@ import kotlin.test.assertFailsWith import kotlin.test.assertNotNull class SdkHttpOperationTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testTelemetryInstrumentation() = runTest { val op = newTestOperation(HttpRequestBuilder(), Unit) @@ -33,7 +31,6 @@ class SdkHttpOperationTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testMissingRequiredProperties() = runTest { val ex = assertFailsWith { diff --git a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecutionTest.kt b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecutionTest.kt index 33c394f8a5..11657db007 100644 --- a/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecutionTest.kt +++ b/runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/operation/SdkOperationExecutionTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.operation -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.auth.AuthSchemeId import aws.smithy.kotlin.runtime.http.Headers import aws.smithy.kotlin.runtime.http.HttpBody @@ -28,7 +27,6 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue class SdkOperationExecutionTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testOperationMiddlewareOrder() = runTest { // sanity test middleware flows the way we expect diff --git a/runtime/protocol/http-test/common/test/aws/smithy/kotlin/runtime/httptest/TestConnectionTest.kt b/runtime/protocol/http-test/common/test/aws/smithy/kotlin/runtime/httptest/TestConnectionTest.kt index c1cfa8ec28..b8f0a41f15 100644 --- a/runtime/protocol/http-test/common/test/aws/smithy/kotlin/runtime/httptest/TestConnectionTest.kt +++ b/runtime/protocol/http-test/common/test/aws/smithy/kotlin/runtime/httptest/TestConnectionTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.httptest -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder import aws.smithy.kotlin.runtime.net.Host @@ -16,7 +15,6 @@ import kotlin.test.assertEquals import kotlin.test.assertFails class TestConnectionTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testAssertRequestsSuccess() = runTest { val engine = buildTestConnection { @@ -44,7 +42,6 @@ class TestConnectionTest { engine.assertRequests() } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testAssertRequestsUrlDifferent() = runTest { val engine = buildTestConnection { @@ -72,7 +69,6 @@ class TestConnectionTest { }.message.shouldContain("URL mismatch") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testAssertRequestsMissingHeader() = runTest { val engine = buildTestConnection { @@ -100,7 +96,6 @@ class TestConnectionTest { }.message.shouldContain("header `x-baz` missing value `qux`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun testAssertRequestsBodyDifferent() = runTest { val engine = buildTestConnection { @@ -129,7 +124,6 @@ class TestConnectionTest { }.message.shouldContain("body mismatch") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testAssertRequestsAny() = runTest { val engine = buildTestConnection { @@ -164,7 +158,6 @@ class TestConnectionTest { engine.assertRequests() } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testFromJson() = runTest { // language=JSON diff --git a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HeadersTest.kt b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HeadersTest.kt index 04cea1b3e6..7bd34fe5ae 100644 --- a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HeadersTest.kt +++ b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HeadersTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.http -import aws.smithy.kotlin.runtime.IgnoreNative import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -29,7 +28,6 @@ class HeadersTest { assertEquals("Headers [key=[value]]", "$actual2") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSubsequentModificationsDontAffectOriginal() { val builder = HeadersBuilder() diff --git a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpBodyTest.kt b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpBodyTest.kt index a76f8ddc9e..844d054166 100644 --- a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpBodyTest.kt +++ b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpBodyTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.content.ByteStream import aws.smithy.kotlin.runtime.io.SdkBuffer import aws.smithy.kotlin.runtime.io.SdkByteChannel @@ -50,7 +49,6 @@ class HttpBodyTest { assertTrue(body.isOneShot) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testStreamingReadAllClosedForRead() = runTest { val expected = "foobar" @@ -63,7 +61,6 @@ class HttpBodyTest { assertEquals(expected, body.readAll()!!.decodeToString()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testStreamingReadAllClosedForWrite() = runTest { val expected = "foobar" diff --git a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpRequestBuilderTest.kt b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpRequestBuilderTest.kt index 9954de1d6e..79675b689a 100644 --- a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpRequestBuilderTest.kt +++ b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/HttpRequestBuilderTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.http -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.content.ByteStream import aws.smithy.kotlin.runtime.http.content.ByteArrayContent import aws.smithy.kotlin.runtime.http.request.HttpRequest @@ -42,7 +41,6 @@ class HttpRequestBuilderTest { assertEquals(HttpBody.Empty, request.body) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testDumpRequest() = runTest { val content = "Mom!...Dad!...Bingo!...Bluey!" @@ -81,7 +79,6 @@ class HttpRequestBuilderTest { assertEquals(content, actualReplacedContent) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testRequestToBuilder() = runTest { val req = HttpRequest( diff --git a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/response/HttpResponseTest.kt b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/response/HttpResponseTest.kt index 32c420fef3..2f07d3cd5b 100644 --- a/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/response/HttpResponseTest.kt +++ b/runtime/protocol/http/common/test/aws/smithy/kotlin/runtime/http/response/HttpResponseTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.http.response -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.content.ByteStream import aws.smithy.kotlin.runtime.http.Headers import aws.smithy.kotlin.runtime.http.HttpBody @@ -37,7 +36,6 @@ class HttpResponseTest { assertEquals(HttpStatusCode.BadRequest, resp.statusCode()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testDumpResponse() = runTest { val content = "Mom!...Dad!...Bingo!...Bluey!" diff --git a/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/RpcV2CborSmithyProtocolResponseHeaderInterceptorTest.kt b/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/RpcV2CborSmithyProtocolResponseHeaderInterceptorTest.kt index 02a330f5f3..1a795be3c8 100644 --- a/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/RpcV2CborSmithyProtocolResponseHeaderInterceptorTest.kt +++ b/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/RpcV2CborSmithyProtocolResponseHeaderInterceptorTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.awsprotocol.rpcv2.cbor -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.ServiceException import aws.smithy.kotlin.runtime.http.* import aws.smithy.kotlin.runtime.http.operation.* @@ -56,7 +55,6 @@ internal fun getMockClient(response: ByteArray, responseHeaders: Headers = Heade internal val RESPONSE = "abc".repeat(1024).encodeToByteArray() class RpcV2CborSmithyProtocolResponseHeaderInterceptorTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testThrowsOnMissingHeader() = runTest { val req = HttpRequestBuilder() @@ -71,7 +69,6 @@ class RpcV2CborSmithyProtocolResponseHeaderInterceptorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSucceedsOnPresentHeader() = runTest { val req = HttpRequestBuilder() diff --git a/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/Rpcv2CborErrorDeserializerTest.kt b/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/Rpcv2CborErrorDeserializerTest.kt index 6357e782f0..b478925733 100644 --- a/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/Rpcv2CborErrorDeserializerTest.kt +++ b/runtime/protocol/smithy-rpcv2-protocols/common/test/aws/smithy/kotlin/runtime/awsprotocol/rpcv2/cbor/Rpcv2CborErrorDeserializerTest.kt @@ -2,7 +2,6 @@ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.awsprotocol.rpcv2.cbor.RpcV2CborErrorDeserializer import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor import aws.smithy.kotlin.runtime.serde.SdkObjectDescriptor @@ -15,7 +14,6 @@ import kotlin.test.Test import kotlin.test.assertEquals class RpcV2CborErrorDeserializerTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testDeserializeErrorType() = runTest { val tests = listOf( diff --git a/runtime/runtime-core/api/runtime-core.api b/runtime/runtime-core/api/runtime-core.api index 6ccc7cb1e2..071534886c 100644 --- a/runtime/runtime-core/api/runtime-core.api +++ b/runtime/runtime-core/api/runtime-core.api @@ -309,6 +309,7 @@ public class aws/smithy/kotlin/runtime/collections/ValuesMapImpl : aws/smithy/ko public fun getAll (Ljava/lang/String;)Ljava/util/List; public fun getCaseInsensitiveName ()Z protected final fun getValues ()Ljava/util/Map; + public fun hashCode ()I public fun isEmpty ()Z public fun names ()Ljava/util/Set; } diff --git a/runtime/runtime-core/build.gradle.kts b/runtime/runtime-core/build.gradle.kts index 7a4bdd17fa..cd9e4e8b3f 100644 --- a/runtime/runtime-core/build.gradle.kts +++ b/runtime/runtime-core/build.gradle.kts @@ -22,13 +22,13 @@ kotlin { implementation(libs.okio) // Coroutines' locking features are used in retry token bucket implementations api(libs.kotlinx.coroutines.core) + implementation(libs.kotlinx.datetime) } } nativeMain { dependencies { api(libs.crt.kotlin) - implementation(libs.kotlinx.datetime) } } diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMap.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMap.kt index 096e1b6d3d..e888ad72bc 100644 --- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMap.kt +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMap.kt @@ -6,16 +6,6 @@ package aws.smithy.kotlin.runtime.collections import aws.smithy.kotlin.runtime.InternalApi -private class CaseInsensitiveString(val s: String) { - val hash: Int = s.lowercase().hashCode() - override fun hashCode(): Int = hash - override fun equals(other: Any?): Boolean = other is CaseInsensitiveString && other.s.equals(s, ignoreCase = true) - override fun toString(): String = s -} - -private fun String.toInsensitive(): CaseInsensitiveString = - CaseInsensitiveString(this) - /** * Map of case-insensitive [String] to [Value] */ @@ -30,17 +20,17 @@ internal class CaseInsensitiveMap : MutableMap { override fun containsValue(value: Value): Boolean = impl.containsValue(value) - override fun get(key: String): Value? = impl.get(key.toInsensitive()) + override fun get(key: String): Value? = impl[key.toInsensitive()] override fun isEmpty(): Boolean = impl.isEmpty() override val entries: MutableSet> get() = impl.entries.map { - Entry(it.key.s, it.value) + Entry(it.key.normalized, it.value) }.toMutableSet() override val keys: MutableSet - get() = impl.keys.map { it.s }.toMutableSet() + get() = CaseInsensitiveMutableStringSet(impl.keys) override val values: MutableCollection get() = impl.values @@ -57,6 +47,12 @@ internal class CaseInsensitiveMap : MutableMap { override fun remove(key: String): Value? = impl.remove(key.toInsensitive()) + override fun hashCode() = impl.hashCode() + + override fun equals(other: Any?) = other is CaseInsensitiveMap<*> && impl == other.impl + + override fun toString() = impl.toString() + private class Entry( override val key: Key, override var value: Value, @@ -67,7 +63,7 @@ internal class CaseInsensitiveMap : MutableMap { return value } - override fun hashCode(): Int = 17 * 31 + key!!.hashCode() + value!!.hashCode() + override fun hashCode(): Int = key.hashCode() xor value.hashCode() // Match JVM & K/N stdlib implementations override fun equals(other: Any?): Boolean { if (other == null || other !is Map.Entry<*, *>) return false diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMutableStringSet.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMutableStringSet.kt new file mode 100644 index 0000000000..63924013c9 --- /dev/null +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMutableStringSet.kt @@ -0,0 +1,40 @@ +package aws.smithy.kotlin.runtime.collections + +internal class CaseInsensitiveMutableStringSet( + initialValues: Iterable = setOf(), +) : MutableSet { + private val delegate = initialValues.toMutableSet() + + override fun add(element: String) = delegate.add(element.toInsensitive()) + override fun clear() = delegate.clear() + override fun contains(element: String) = delegate.contains(element.toInsensitive()) + override fun containsAll(elements: Collection) = elements.all { it in this } + override fun equals(other: Any?) = other is CaseInsensitiveMutableStringSet && delegate == other.delegate + override fun hashCode() = delegate.hashCode() + override fun isEmpty() = delegate.isEmpty() + override fun remove(element: String) = delegate.remove(element.toInsensitive()) + override val size: Int get() = delegate.size + override fun toString() = delegate.toString() + + override fun addAll(elements: Collection) = + elements.fold(false) { modified, item -> add(item) || modified } + + override fun iterator() = object : MutableIterator { + val delegate = this@CaseInsensitiveMutableStringSet.delegate.iterator() + override fun hasNext() = delegate.hasNext() + override fun next() = delegate.next().normalized + override fun remove() = delegate.remove() + } + + override fun removeAll(elements: Collection) = + elements.fold(false) { modified, item -> remove(item) || modified } + + override fun retainAll(elements: Collection): Boolean { + val insensitiveElements = elements.map { it.toInsensitive() }.toSet() + val toRemove = delegate.filterNot { it in insensitiveElements } + return toRemove.fold(false) { modified, item -> delegate.remove(item) || modified } + } +} + +internal fun CaseInsensitiveMutableStringSet(initialValues: Iterable) = + CaseInsensitiveMutableStringSet(initialValues.map { it.toInsensitive() }) diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveString.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveString.kt new file mode 100644 index 0000000000..e182ca813d --- /dev/null +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/CaseInsensitiveString.kt @@ -0,0 +1,11 @@ +package aws.smithy.kotlin.runtime.collections + +internal class CaseInsensitiveString(val original: String) { + val normalized = original.lowercase() + override fun hashCode() = normalized.hashCode() + override fun equals(other: Any?) = other is CaseInsensitiveString && normalized == other.normalized + override fun toString() = original +} + +internal fun String.toInsensitive(): CaseInsensitiveString = + CaseInsensitiveString(this) diff --git a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/ValuesMap.kt b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/ValuesMap.kt index 763fa21ece..efa7a70af3 100644 --- a/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/ValuesMap.kt +++ b/runtime/runtime-core/common/src/aws/smithy/kotlin/runtime/collections/ValuesMap.kt @@ -89,15 +89,13 @@ public open class ValuesMapImpl( override fun isEmpty(): Boolean = values.isEmpty() - override fun equals(other: Any?): Boolean = - other is ValuesMap<*> && - caseInsensitiveName == other.caseInsensitiveName && - names().let { names -> - if (names.size != other.names().size) { - return false - } - names.all { getAll(it) == other.getAll(it) } - } + override fun equals(other: Any?): Boolean = when (other) { + is ValuesMapImpl<*> -> caseInsensitiveName == other.caseInsensitiveName && values == other.values + is ValuesMap<*> -> caseInsensitiveName == other.caseInsensitiveName && entries() == other.entries() + else -> false + } + + override fun hashCode(): Int = values.hashCode() private fun Map>.deepCopyValues(): Map> = mapValues { (_, v) -> v.toList() } } diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMapTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMapTest.kt index dcf919d52d..96fd83612b 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMapTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMapTest.kt @@ -6,6 +6,8 @@ package aws.smithy.kotlin.runtime.collections import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue class CaseInsensitiveMapTest { @Test @@ -18,4 +20,84 @@ class CaseInsensitiveMapTest { assertEquals("json", map["content-type"]) assertEquals("json", map["CONTENT-TYPE"]) } + + @Test + fun testContains() { + val map = CaseInsensitiveMap() + map["A"] = "apple" + map["B"] = "banana" + map["C"] = "cherry" + + assertTrue("C" in map) + assertTrue("c" in map) + assertFalse("D" in map) + } + + @Test + fun testKeysContains() { + val map = CaseInsensitiveMap() + map["A"] = "apple" + map["B"] = "banana" + map["C"] = "cherry" + val keys = map.keys + + assertTrue("C" in keys) + assertTrue("c" in keys) + assertFalse("D" in keys) + } + + @Test + fun testEquality() { + val left = CaseInsensitiveMap() + left["A"] = "apple" + left["B"] = "banana" + left["C"] = "cherry" + + val right = CaseInsensitiveMap() + right["c"] = "cherry" + right["b"] = "banana" + right["a"] = "apple" + + assertEquals(left, right) + } + + @Test + fun testEntriesEquality() { + val left = CaseInsensitiveMap() + left["A"] = "apple" + left["B"] = "banana" + left["C"] = "cherry" + + val right = CaseInsensitiveMap() + right["c"] = "cherry" + right["b"] = "banana" + right["a"] = "apple" + + assertEquals(left.entries, right.entries) + } + + @Test + fun testEntriesEqualityWithNormalMap() { + val left = CaseInsensitiveMap() + left["A"] = "apple" + left["B"] = "banana" + left["C"] = "cherry" + + val right = mutableMapOf( + "c" to "cherry", + "b" to "banana", + "a" to "apple", + ) + + assertEquals(left.entries, right.entries) + } + + @Test + fun testToString() { + val map = CaseInsensitiveMap() + map["A"] = "apple" + map["B"] = "banana" + map["C"] = "cherry" + assertEquals("{A=apple, B=banana, C=cherry}", map.toString()) + } } diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMutableStringSetTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMutableStringSetTest.kt new file mode 100644 index 0000000000..258ef4c7f3 --- /dev/null +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveMutableStringSetTest.kt @@ -0,0 +1,125 @@ +package aws.smithy.kotlin.runtime.collections + +import kotlin.test.* + +private val input = setOf("APPLE", "banana", "cHeRrY") +private val variations = (input + input.map { it.lowercase() } + input.map { it.uppercase() }) +private val disjoint = setOf("durIAN", "ELdeRBerRY", "FiG") +private val subset = input - "APPLE" +private val intersecting = subset + disjoint + +class CaseInsensitiveMutableStringSetTest { + private fun assertSize(size: Int, set: CaseInsensitiveMutableStringSet) { + assertEquals(size, set.size) + val emptyAsserter: (Boolean) -> Unit = if (size == 0) ::assertTrue else ::assertFalse + emptyAsserter(set.isEmpty()) + } + + @Test + fun testInitialization() { + val set = CaseInsensitiveMutableStringSet(input) + assertSize(3, set) + } + + @Test + fun testAdd() { + val set = CaseInsensitiveMutableStringSet(input) + set += "durIAN" + assertSize(4, set) + } + + @Test + fun testAddAll() { + val set = CaseInsensitiveMutableStringSet(input) + assertFalse(set.addAll(set)) + + val intersecting = input + "durian" + assertTrue(set.addAll(intersecting)) + assertSize(4, set) + } + + @Test + fun testClear() { + val set = CaseInsensitiveMutableStringSet(input) + set.clear() + assertSize(0, set) + } + + @Test + fun testContains() { + val set = CaseInsensitiveMutableStringSet(input) + variations.forEach { assertTrue("Set should contain element $it") { it in set } } + + assertFalse("durian" in set) + } + + @Test + fun testContainsAll() { + val set = CaseInsensitiveMutableStringSet(input) + assertTrue(set.containsAll(variations)) + + val intersecting = input + "durian" + assertFalse(set.containsAll(intersecting)) + } + + @Test + fun testEquality() { + val left = CaseInsensitiveMutableStringSet(input) + val right = CaseInsensitiveMutableStringSet(input) + assertEquals(left, right) + + left -= "apple" + assertNotEquals(left, right) + + right -= "ApPlE" + assertEquals(left, right) + } + + @Test + fun testIterator() { + val set = CaseInsensitiveMutableStringSet(input) + val iterator = set.iterator() + + assertTrue(iterator.hasNext()) + assertEquals("apple", iterator.next()) + + assertTrue(iterator.hasNext()) + assertEquals("banana", iterator.next()) + iterator.remove() + assertSize(2, set) + + assertTrue(iterator.hasNext()) + assertEquals("cherry", iterator.next()) + + assertFalse(iterator.hasNext()) + assertTrue(set.containsAll(input - "banana")) + } + + @Test + fun testRemove() { + val set = CaseInsensitiveMutableStringSet(input) + set -= "BANANA" + assertSize(2, set) + } + + @Test + fun testRemoveAll() { + val set = CaseInsensitiveMutableStringSet(input) + assertFalse(set.removeAll(disjoint)) + + assertTrue(set.removeAll(intersecting)) + assertSize(1, set) + assertTrue("apple" in set) + } + + @Test + fun testRetainAll() { + val set = CaseInsensitiveMutableStringSet(input) + assertFalse(set.retainAll(set)) + assertSize(3, set) + + assertTrue(set.retainAll(intersecting)) + assertSize(2, set) + assertTrue(set.containsAll(subset)) + } +} diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveStringTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveStringTest.kt new file mode 100644 index 0000000000..f3a0c7b600 --- /dev/null +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/CaseInsensitiveStringTest.kt @@ -0,0 +1,27 @@ +package aws.smithy.kotlin.runtime.collections + +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlin.test.assertNotEquals + +class CaseInsensitiveStringTest { + @Test + fun testEquality() { + val left = "Banana".toInsensitive() + val right = "baNAna".toInsensitive() + assertEquals(left, right) + assertNotEquals("Banana", left) + assertNotEquals("baNAna", right) + + val nonMatching = "apple".toInsensitive() + assertNotEquals(nonMatching, left) + assertNotEquals(nonMatching, right) + } + + @Test + fun testProperties() { + val s = "BANANA".toInsensitive() + assertEquals("BANANA", s.original) + assertEquals("banana", s.normalized) + } +} diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/ReadThroughCacheTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/ReadThroughCacheTest.kt index 0769c3049b..4d85ece15f 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/ReadThroughCacheTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/collections/ReadThroughCacheTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.collections -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.time.ManualClock import aws.smithy.kotlin.runtime.util.ExpiringValue import kotlinx.coroutines.test.runTest @@ -14,7 +13,6 @@ import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds class ReadThroughCacheTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testReadThrough() = runTest { val clock = ManualClock() @@ -38,7 +36,6 @@ class ReadThroughCacheTest { assertEquals(3, cache.get("b") { uncachedValue() }) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testSweep() = runTest { val clock = ManualClock() diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigDecimalTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigDecimalTest.kt index d5d1fbbcca..dcb828146c 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigDecimalTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigDecimalTest.kt @@ -4,13 +4,11 @@ */ package aws.smithy.kotlin.runtime.content -import aws.smithy.kotlin.runtime.IgnoreNative import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFails class BigDecimalTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBigDecimal() { val reallyPreciseNumberString = "0.340282366920938463463374607431768211456" // 128 bits of magnitude @@ -18,13 +16,11 @@ class BigDecimalTest { assertEquals(reallyPreciseNumberString, reallyPreciseNumber.toPlainString()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBadBigDecimal() { assertFails { BigDecimal("1234567890.1234567890foo") } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEquals() { val value = "0.340282366920938463463374607431768211456" diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigIntegerTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigIntegerTest.kt index 8991a60ca8..be78e6c3d8 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigIntegerTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/BigIntegerTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.content -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.text.encoding.decodeHexBytes import kotlin.test.Test import kotlin.test.assertContentEquals @@ -12,7 +11,6 @@ import kotlin.test.assertEquals import kotlin.test.assertFails class BigIntegerTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBigInteger() { val reallyBigNumberString = "340282366920938463463374607431768211456" // 128-bit number @@ -20,20 +18,17 @@ class BigIntegerTest { assertEquals(reallyBigNumberString, reallyBigNumber.toString()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBadBigInteger() { assertFails { BigInteger("1234567890foo1234567890") } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testEquals() { val value = "340282366920938463463374607431768211456" assertEquals(BigInteger(value), BigInteger(value)) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testPlusOperator() { // Map of an expected value to a pair of two values that should sum to get that expected value @@ -52,7 +47,6 @@ class BigIntegerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testMinusOperator() { // Map of an expected value to a pair of two values that should subtract to get that expected value @@ -71,7 +65,6 @@ class BigIntegerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testByteOperations() { // Map of hexadecimal encoding of a big integer to the expected string representation of that big integer diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/ByteStreamFlowTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/ByteStreamFlowTest.kt index 1ddbc8e195..d4568a882c 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/ByteStreamFlowTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/content/ByteStreamFlowTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.content -import aws.smithy.kotlin.runtime.IgnoreNative import io.kotest.matchers.string.shouldContain import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel @@ -19,7 +18,6 @@ class ByteStreamChannelSourceFlowTest : ByteStreamFlowTest(ByteStreamFactory.SDK abstract class ByteStreamFlowTest( private val factory: ByteStreamFactory, ) { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testToFlowWithSizeHint() = runTest { val data = "a korf is a tiger".repeat(1024).encodeToByteArray() @@ -59,7 +57,6 @@ abstract class ByteStreamFlowTest( testByteArray(3278), ) - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testFlowToByteStreamReadAll() = runTest { val flow = data.asFlow() @@ -140,7 +137,6 @@ abstract class ByteStreamFlowTest( ch.closedCause?.message.shouldContain("scope cancelled") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testChannelCancellation() = runTest { // cancelling the channel should cancel the scope (via write failing) diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/InstantTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/InstantTest.kt index 9659754e4c..c50bbd6d85 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/InstantTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/InstantTest.kt @@ -56,6 +56,10 @@ class InstantTest { // leap second - dropped to: 2020-12-31T23:59:59 FromTest("2020-12-31T23:59:60Z", 1609459199, 0), + + // condensed, date only + FromTest("20250205", 1738713600, 0), + FromTest("20231127", 1701043200, 0), ) @Test diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ManualClockTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ManualClockTest.kt index d9430b9284..0a4f50d4a7 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ManualClockTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ManualClockTest.kt @@ -5,14 +5,12 @@ package aws.smithy.kotlin.runtime.time -import aws.smithy.kotlin.runtime.IgnoreNative import kotlin.test.Test import kotlin.test.assertEquals import kotlin.time.Duration.Companion.milliseconds import kotlin.time.Duration.Companion.seconds class ManualClockTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testAdvance() { val epoch = 1634413920L diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseEpochTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseEpochTest.kt index 736ae2a60a..8aba9c6b36 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseEpochTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/time/ParseEpochTest.kt @@ -4,12 +4,10 @@ */ package aws.smithy.kotlin.runtime.time -import aws.smithy.kotlin.runtime.IgnoreNative import kotlin.test.Test import kotlin.test.assertEquals class ParseEpochTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itParsesEpochTimestamps() { val tests = listOf( diff --git a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/util/CachedValueTest.kt b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/util/CachedValueTest.kt index 6a4f7fa07e..5a9897bb55 100644 --- a/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/util/CachedValueTest.kt +++ b/runtime/runtime-core/common/test/aws/smithy/kotlin/runtime/util/CachedValueTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.util -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.time.Instant import aws.smithy.kotlin.runtime.time.ManualClock import kotlinx.coroutines.* @@ -16,7 +15,6 @@ import kotlin.test.* import kotlin.time.Duration.Companion.seconds class CachedValueTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNull() = runTest { val epoch = Instant.fromEpochSeconds(0) @@ -27,7 +25,6 @@ class CachedValueTest { assertNull(value.get()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testExpiration() = runTest { val epoch = Instant.fromEpochSeconds(0) @@ -44,7 +41,6 @@ class CachedValueTest { assertNull(value.get()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testExpirationBuffer() = runTest { val epoch = Instant.fromEpochSeconds(0) @@ -61,7 +57,6 @@ class CachedValueTest { assertNull(value.get()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testGetOrLoad() = runTest { val epoch = Instant.fromEpochSeconds(0) @@ -98,7 +93,6 @@ class CachedValueTest { assertEquals(2, count) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testClose() = runTest { val epoch = Instant.fromEpochSeconds(0) @@ -113,7 +107,6 @@ class CachedValueTest { assertFailsWith { value.get() } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun throwsAfterCloseDuringGetOrLoad() = runTest { val epoch = Instant.fromEpochSeconds(0) diff --git a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt index e1a17cd8c0..3f0f1459fa 100644 --- a/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt +++ b/runtime/runtime-core/jvm/src/aws/smithy/kotlin/runtime/time/InstantJVM.kt @@ -25,6 +25,7 @@ import kotlin.time.Duration import kotlin.time.toKotlinDuration import java.time.Duration as jtDuration import java.time.Instant as jtInstant +import kotlinx.datetime.Instant as KtInstant // FIXME Consider making this multiplatform (`common`) using kotlinx.datetime public actual class Instant(internal val value: jtInstant) : Comparable { @@ -136,12 +137,12 @@ public actual class Instant(internal val value: jtInstant) : Comparable /** * Create an [Instant] with the minimum possible value */ - public actual val MIN_VALUE: Instant = Instant(jtInstant.MIN) + public actual val MIN_VALUE: Instant = fromEpochMilliseconds(KtInstant.DISTANT_PAST.toEpochMilliseconds()) /** * Create an [Instant] with the maximum possible value */ - public actual val MAX_VALUE: Instant = Instant(jtInstant.MAX) + public actual val MAX_VALUE: Instant = fromEpochMilliseconds(KtInstant.DISTANT_FUTURE.toEpochMilliseconds()) } } diff --git a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/DateTimeFormats.kt b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/DateTimeFormats.kt index 6ca75c5f87..550a95cfe1 100644 --- a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/DateTimeFormats.kt +++ b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/DateTimeFormats.kt @@ -8,8 +8,10 @@ package aws.smithy.kotlin.runtime.time import kotlinx.datetime.LocalDate import kotlinx.datetime.UtcOffset import kotlinx.datetime.format.DateTimeComponents +import kotlinx.datetime.format.DateTimeFormat import kotlinx.datetime.format.DayOfWeekNames import kotlinx.datetime.format.MonthNames +import kotlinx.datetime.format.Padding import kotlinx.datetime.format.alternativeParsing import kotlinx.datetime.format.char import kotlinx.datetime.format.optional @@ -106,7 +108,12 @@ internal object DateTimeFormats { dayOfWeek(DayOfWeekNames.ENGLISH_ABBREVIATED) chars(", ") - dayOfMonth() + alternativeParsing({ + dayOfMonth(padding = Padding.NONE) + }) { + dayOfMonth() + } + char(' ') monthName(MonthNames.ENGLISH_ABBREVIATED) char(' ') @@ -125,3 +132,14 @@ internal object DateTimeFormats { } } } + +/** + * ISO8601 condensed, date only. Corresponds to [TimestampFormat.ISO_8601_CONDENSED_DATE]. + * Used only for _parsing_ ISO8601 condensed strings. Instant.parse() will fail if using [DateTimeFormats.ISO_8601_CONDENSED_DATE] + * because that is a [DateTimeFormat] which requires a time component to be present. + */ +internal val ISO_8601_CONDENSED_DATE_LOCALDATE = LocalDate.Format { + year() + monthNumber() + dayOfMonth() +} diff --git a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt index 899419245a..01edcaf1af 100644 --- a/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt +++ b/runtime/runtime-core/native/src/aws/smithy/kotlin/runtime/time/InstantNative.kt @@ -6,6 +6,9 @@ package aws.smithy.kotlin.runtime.time import kotlinx.datetime.Clock +import kotlinx.datetime.LocalDate +import kotlinx.datetime.TimeZone +import kotlinx.datetime.atStartOfDayIn import kotlinx.datetime.format import kotlin.time.Duration import kotlinx.datetime.Instant as KtInstant @@ -63,25 +66,40 @@ public actual class Instant(internal val delegate: KtInstant) : Comparable + try { + return Instant(parseFn()) + } catch (e: IllegalArgumentException) { + parseException.addSuppressed(e) } } - return Instant(parsed.toInstantUsingOffset()) + throw parseException } /** * Parse an RFC5322/RFC-822 formatted string into an [Instant] */ - public actual fun fromRfc5322(ts: String): Instant = Instant(KtInstant.parse(ts, DateTimeFormats.RFC_5322)) + public actual fun fromRfc5322(ts: String): Instant = try { + Instant(KtInstant.parse(ts, DateTimeFormats.RFC_5322)) + } catch (e: IllegalArgumentException) { + throw ParseException(ts, "Failed to parse $ts into an RFC-5322 timestamp", 0) + } /** * Create an [Instant] from its parts */ - public actual fun fromEpochSeconds(seconds: Long, ns: Int): Instant = Instant(KtInstant.fromEpochSeconds(seconds, ns)) + public actual fun fromEpochSeconds(seconds: Long, ns: Int): Instant = try { + Instant(KtInstant.fromEpochSeconds(seconds, ns)) + } catch (e: IllegalArgumentException) { + throw ParseException("${seconds}s, ${ns}ns", "Failed to parse (${seconds}s, ${ns}ns) into an epoch seconds timestamp", 0) + } /** * Parse a string formatted as epoch-seconds into an [Instant] diff --git a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerErrorTest.kt b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerErrorTest.kt index 1ace81d9ef..70d11b6792 100644 --- a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerErrorTest.kt +++ b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerErrorTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.serde.cbor -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.io.SdkBuffer import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor import aws.smithy.kotlin.runtime.serde.SerialKind @@ -15,7 +14,6 @@ import kotlin.test.Test import kotlin.test.assertFails class CborDeserializerErrorTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - major7 - float64 - incomplete float64 at end of buf`() { val payload = "0xfb00000000000000".toByteArray() @@ -28,7 +26,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - uint - 2 - arg len 2 greater than remaining buf len`() { val payload = "0x1900".toByteArray() @@ -41,7 +38,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - uint - 4 - arg len 4 greater than remaining buf len`() { val payload = "0x1a000000".toByteArray() @@ -54,7 +50,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - negint - 2 - arg len 2 greater than remaining buf len`() { val payload = "0x3900".toByteArray() @@ -67,7 +62,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - slice - 2 - arg len 2 greater than remaining buf len`() { val payload = "0x5900".toByteArray() @@ -80,7 +74,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - slice - 8 - arg len 8 greater than remaining buf len`() { val payload = "0x5b00000000000000".toByteArray() @@ -93,7 +86,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - tag - 2 - arg len 2 greater than remaining buf len`() { val payload = "0xd900".toByteArray() @@ -105,7 +97,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - tag - 4 - arg len 4 greater than remaining buf len`() { val payload = "0xda000000".toByteArray() @@ -117,7 +108,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - uint - unexpected minor value 31`() { val payload = "0x1f".toByteArray() @@ -130,7 +120,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - list - 1 - arg len 1 greater than remaining buf len`() { val payload = "0x98".toByteArray() @@ -145,7 +134,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - list - 4 - arg len 4 greater than remaining buf len`() { val payload = "0x9a000000".toByteArray() @@ -160,7 +148,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - list - 8 - arg len 8 greater than remaining buf len`() { val payload = "0x9b00000000000000".toByteArray() @@ -175,7 +162,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - map - 1 - arg len 1 greater than remaining buf len`() { val payload = "0xb8".toByteArray() @@ -191,7 +177,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - map - 4 - arg len 4 greater than remaining buf len`() { val payload = "0xba000000".toByteArray() @@ -207,7 +192,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - major7 - float32 - incomplete float32 at end of buf`() { val payload = "0xfa000000".toByteArray() @@ -220,7 +204,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - string - 2 - arg len 2 greater than remaining buf len`() { val payload = "0x7900".toByteArray() @@ -233,7 +216,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - list - 2 - arg len 2 greater than remaining buf len`() { val payload = "0x9900".toByteArray() @@ -248,7 +230,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - negint - unexpected minor value 31`() { val payload = "0x3f".toByteArray() @@ -261,7 +242,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - string - 8 - arg len 8 greater than remaining buf len`() { val payload = "0x7b00000000000000".toByteArray() @@ -274,7 +254,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - major7 - unexpected minor value 31`() { val payload = "0xff".toByteArray() @@ -287,7 +266,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - string - 1 - arg len 1 greater than remaining buf len`() { val payload = "0x78".toByteArray() @@ -300,7 +278,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - tag - unexpected minor value 31`() { val payload = "0xdf".toByteArray() @@ -312,7 +289,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - slice - 1 - arg len 1 greater than remaining buf len`() { val payload = "0x58".toByteArray() @@ -325,7 +301,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - slice - 4 - arg len 4 greater than remaining buf len`() { val payload = "0x5a000000".toByteArray() @@ -338,7 +313,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - map - 2 - arg len 2 greater than remaining buf len`() { val payload = "0xb900".toByteArray() @@ -354,7 +328,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - map - 8 - arg len 8 greater than remaining buf len`() { val payload = "0xbb00000000000000".toByteArray() @@ -370,7 +343,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - tag - 8 - arg len 8 greater than remaining buf len`() { val payload = "0xdb00000000000000".toByteArray() @@ -382,7 +354,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - uint - 1 - arg len 1 greater than remaining buf len`() { val payload = "0x18".toByteArray() @@ -395,7 +366,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - major7 - float16 - incomplete float16 at end of buf`() { val payload = "0xf900".toByteArray() @@ -408,7 +378,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - uint - 8 - arg len 8 greater than remaining buf len`() { val payload = "0x1b00000000000000".toByteArray() @@ -421,7 +390,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - negint - 1 - arg len 1 greater than remaining buf len`() { val payload = "0x38".toByteArray() @@ -434,7 +402,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - negint - 4 - arg len 4 greater than remaining buf len`() { val payload = "0x3a000000".toByteArray() @@ -447,7 +414,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - negint - 8 - arg len 8 greater than remaining buf len`() { val payload = "0x3b00000000000000".toByteArray() @@ -460,7 +426,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - string - 4 - arg len 4 greater than remaining buf len`() { val payload = "0x7a000000".toByteArray() @@ -473,7 +438,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidArgument - tag - 1 - arg len 1 greater than remaining buf len`() { val payload = "0xd8".toByteArray() @@ -485,7 +449,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidList - indefinite list - invalid item - arg len 1 greater than remaining buf len`() { val payload = "0x9f18".toByteArray() @@ -500,7 +463,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidList - list - eof after head - unexpected end of payload`() { val payload = "0x81".toByteArray() @@ -515,7 +477,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidList - list - invalid item - arg len 1 greater than remaining buf len`() { val payload = "0x8118".toByteArray() @@ -530,7 +491,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidList - indefinite list - no break - expected break marker`() { val payload = "0x9f".toByteArray() @@ -545,7 +505,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - map - non-string key - unexpected major type 0 for map key`() { val payload = "0xa100".toByteArray() @@ -561,7 +520,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - map - invalid key - slice len 1 greater than remaining buf len`() { val payload = "0xa17801".toByteArray() @@ -577,7 +535,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - map - invalid value - arg len 1 greater than remaining buf len`() { val payload = "0xa163666f6f18".toByteArray() @@ -593,7 +550,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - indefinite map - no break - expected break marker`() { val payload = "0xbf".toByteArray() @@ -609,7 +565,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - indefinite map - non-string key - unexpected major type 0 for map key`() { val payload = "0xbf00".toByteArray() @@ -625,7 +580,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - indefinite map - invalid key - slice len 1 greater than remaining buf len`() { val payload = "0xbf7801".toByteArray() @@ -641,7 +595,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - indefinite map - invalid value - arg len 1 greater than remaining buf len`() { val payload = "0xbf63666f6f18".toByteArray() @@ -657,7 +610,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidMap - map - eof after head - unexpected end of payload`() { val payload = "0xa1".toByteArray() @@ -673,7 +625,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - slice - invalid nested definite - decode subslice slice len 1 greater than remaining buf len`() { val payload = "0x5f5801".toByteArray() @@ -686,7 +637,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - string - no break - expected break marker`() { val payload = "0x7f".toByteArray() @@ -699,7 +649,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - string - invalid nested major - unexpected major type 2 in indefinite slice`() { val payload = "0x7f40".toByteArray() @@ -712,7 +661,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - string - nested indefinite - nested indefinite slice`() { val payload = "0x7f7f".toByteArray() @@ -725,7 +673,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - string - invalid nested definite - decode subslice - slice len 1 greater than remaining buf len`() { val payload = "0x7f7801".toByteArray() @@ -738,7 +685,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - slice - invalid nested major - unexpected major type 3 in indefinite slice`() { val payload = "0x5f60".toByteArray() @@ -751,7 +697,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - slice - no break - expected break marker`() { val payload = "0x5f".toByteArray() @@ -764,7 +709,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - slice - nested indefinite - nested indefinite slice`() { val payload = "0x5f5f".toByteArray() @@ -777,7 +721,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - string - 1 - not enough bytes - slice len 1 greater than remaining buf len`() { val payload = "0x7801".toByteArray() @@ -790,7 +733,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidSlice - slice - 1 - not enough bytes - slice len 1 greater than remaining buf len`() { val payload = "0x5801".toByteArray() @@ -803,7 +745,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidTag - invalid value - arg len 1 greater than remaining buf len`() { val payload = "0xc118".toByteArray() @@ -815,7 +756,6 @@ class CborDeserializerErrorTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `TestDecode_InvalidTag - eof - unexpected end of payload`() { val payload = "0xc1".toByteArray() diff --git a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerSuccessTest.kt b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerSuccessTest.kt index 03f52f0936..a9d4b0a7d1 100644 --- a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerSuccessTest.kt +++ b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerSuccessTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.serde.cbor -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.io.SdkBuffer import aws.smithy.kotlin.runtime.serde.SdkFieldDescriptor import aws.smithy.kotlin.runtime.serde.SerialKind @@ -25,7 +24,6 @@ internal fun String.toByteArray(): ByteArray = this .toByteArray() class CborDeserializerSuccessTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - undefined`() { val payload = "0xf7".toByteArray() @@ -37,7 +35,6 @@ class CborDeserializerSuccessTest { assertEquals(null, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float64 - 1dot625`() { val payload = "0xfb3ffa000000000000".toByteArray() @@ -49,7 +46,6 @@ class CborDeserializerSuccessTest { assertEquals(1.625, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 0 - max`() { val payload = "0x17".toByteArray() @@ -61,7 +57,6 @@ class CborDeserializerSuccessTest { assertEquals(23, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 8 - min`() { val payload = "0x1b0000000000000000".toByteArray() @@ -73,7 +68,6 @@ class CborDeserializerSuccessTest { assertEquals(0uL, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 8 - max`() { val payload = "0x1bffffffffffffffff".toByteArray() @@ -82,7 +76,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, aws.smithy.kotlin.runtime.serde.cbor.encoding.UInt.decode(buffer).value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 8 - min`() { val payload = "0x3b0000000000000000".toByteArray() @@ -94,7 +87,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - true`() { val payload = "0xf5".toByteArray() @@ -106,7 +98,6 @@ class CborDeserializerSuccessTest { assertEquals(true, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 4 - min`() { val payload = "0x1a00000000".toByteArray() @@ -118,7 +109,6 @@ class CborDeserializerSuccessTest { assertEquals(0, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 4 - max`() { val payload = "0x1affffffff".toByteArray() @@ -128,7 +118,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MAX_VALUE, aws.smithy.kotlin.runtime.serde.cbor.encoding.UInt.decode(buffer).value.toUInt()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 1 - min`() { val payload = "0x3800".toByteArray() @@ -140,7 +129,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float16 - subnormal`() { val payload = "0xf90050".toByteArray() @@ -152,7 +140,6 @@ class CborDeserializerSuccessTest { assertEquals(4.7683716E-6f, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float16 - NaN - LSB`() { val payload = "0xf97c01".toByteArray() @@ -164,7 +151,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 1 - min`() { val payload = "0x1800".toByteArray() @@ -176,7 +162,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MIN_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 0 - min`() { val payload = "0x20".toByteArray() @@ -188,7 +173,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float16 - -Inf`() { val payload = "0xf9fc00".toByteArray() @@ -200,7 +184,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NEGATIVE_INFINITY, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 8 - max`() { val payload = "0x3bfffffffffffffffe".toByteArray() @@ -209,7 +192,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 0 - min`() { val payload = "0x00".toByteArray() @@ -221,7 +203,6 @@ class CborDeserializerSuccessTest { assertEquals(0u, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 1 - max`() { val payload = "0x18ff".toByteArray() @@ -230,7 +211,6 @@ class CborDeserializerSuccessTest { assertEquals(255u, aws.smithy.kotlin.runtime.serde.cbor.encoding.UInt.decode(buffer).value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 2 - min`() { val payload = "0x190000".toByteArray() @@ -242,7 +222,6 @@ class CborDeserializerSuccessTest { assertEquals(0u, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 1 - max`() { val payload = "0x38ff".toByteArray() @@ -254,7 +233,6 @@ class CborDeserializerSuccessTest { assertEquals(-256, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 2 - min`() { val payload = "0x390000".toByteArray() @@ -266,7 +244,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float64 - +Inf`() { val payload = "0xfb7ff0000000000000".toByteArray() @@ -278,7 +255,6 @@ class CborDeserializerSuccessTest { assertEquals(Double.fromBits(9218868437227405312), result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 4 - min`() { val payload = "0x3a00000000".toByteArray() @@ -290,7 +266,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 4 - max`() { val payload = "0x3affffffff".toByteArray() @@ -303,7 +278,6 @@ class CborDeserializerSuccessTest { assertEquals(res, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float16 - NaN - MSB`() { val payload = "0xf97e00".toByteArray() @@ -315,7 +289,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float32 - +Inf`() { val payload = "0xfa7f800000".toByteArray() @@ -327,7 +300,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.POSITIVE_INFINITY, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - uint - 2 - max`() { val payload = "0x19ffff".toByteArray() @@ -336,7 +308,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MAX_VALUE, aws.smithy.kotlin.runtime.serde.cbor.encoding.UInt.decode(buffer).value.toUShort()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 2 - max`() { val payload = "0x39ffff".toByteArray() @@ -345,7 +316,6 @@ class CborDeserializerSuccessTest { assertEquals(65536u, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - false`() { val payload = "0xf4".toByteArray() @@ -357,7 +327,6 @@ class CborDeserializerSuccessTest { assertEquals(false, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - null`() { val payload = "0xf6".toByteArray() @@ -369,7 +338,6 @@ class CborDeserializerSuccessTest { assertEquals(null, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - negint - 0 - max`() { val payload = "0x37".toByteArray() @@ -381,7 +349,6 @@ class CborDeserializerSuccessTest { assertEquals(-24, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float16 - +Inf`() { val payload = "0xf97c00".toByteArray() @@ -393,7 +360,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.POSITIVE_INFINITY, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `atomic - float32 - 1dot625`() { val payload = "0xfa3fd00000".toByteArray() @@ -405,7 +371,6 @@ class CborDeserializerSuccessTest { assertEquals(1.625f, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `definite slice - len = 0`() { val payload = "0x40".toByteArray() @@ -417,7 +382,6 @@ class CborDeserializerSuccessTest { assertEquals(0, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `definite slice - len greater than 0`() { val payload = "0x43666f6f".toByteArray() @@ -434,7 +398,6 @@ class CborDeserializerSuccessTest { assertEquals(3, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `definite string - len = 0`() { val payload = "0x60".toByteArray() @@ -446,7 +409,6 @@ class CborDeserializerSuccessTest { assertEquals("", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `definite string - len greater than 0`() { val payload = "0x63666f6f".toByteArray() @@ -458,7 +420,6 @@ class CborDeserializerSuccessTest { assertEquals("foo", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite slice - len greater than 0`() { val payload = "0x5f43666f6f40ff".toByteArray() @@ -475,7 +436,6 @@ class CborDeserializerSuccessTest { assertEquals(3, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite slice - len greater than 0 - len greater than 0`() { val payload = "0x5f43666f6f43666f6fff".toByteArray() @@ -490,7 +450,6 @@ class CborDeserializerSuccessTest { assertEquals(expected.size, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite slice - len = 0`() { val payload = "0x5fff".toByteArray() @@ -502,7 +461,6 @@ class CborDeserializerSuccessTest { assertEquals(0, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite slice - len = 0 explicit`() { val payload = "0x5f40ff".toByteArray() @@ -514,7 +472,6 @@ class CborDeserializerSuccessTest { assertEquals(0, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite slice - len = 0 - len greater than 0`() { val payload = "0x5f4043666f6fff".toByteArray() @@ -529,7 +486,6 @@ class CborDeserializerSuccessTest { assertEquals(expected.size, result.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite string - len = 0`() { val payload = "0x7fff".toByteArray() @@ -541,7 +497,6 @@ class CborDeserializerSuccessTest { assertEquals("", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite string - len = 0 - explicit`() { val payload = "0x7f60ff".toByteArray() @@ -553,7 +508,6 @@ class CborDeserializerSuccessTest { assertEquals("", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite string - len = 0 - len greater than 0`() { val payload = "0x7f6063666f6fff".toByteArray() @@ -565,7 +519,6 @@ class CborDeserializerSuccessTest { assertEquals("foo", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite string - len greater than 0 - len = 0`() { val payload = "0x7f63666f6f60ff".toByteArray() @@ -577,7 +530,6 @@ class CborDeserializerSuccessTest { assertEquals("foo", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite string - len greater than 0 - len greater than 0`() { val payload = "0x7f63666f6f63666f6fff".toByteArray() @@ -589,7 +541,6 @@ class CborDeserializerSuccessTest { assertEquals("foofoo", result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of one uint - 1 - max`() { val payload = "0x8118ff".toByteArray() @@ -607,7 +558,6 @@ class CborDeserializerSuccessTest { assertEquals(255u, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of one uint - 8 - min`() { val payload = "0x811b0000000000000000".toByteArray() @@ -625,7 +575,6 @@ class CborDeserializerSuccessTest { assertEquals(0, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 1 - min`() { val payload = "0x9f1800ff".toByteArray() @@ -643,7 +592,6 @@ class CborDeserializerSuccessTest { assertEquals(0u, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 2 - max`() { val payload = "0x9f19ffffff".toByteArray() @@ -661,7 +609,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MAX_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 2 - min`() { val payload = "0x9f390000ff".toByteArray() @@ -679,7 +626,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 4 - max`() { val payload = "0x811affffffff".toByteArray() @@ -697,7 +643,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MAX_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 8 - min`() { val payload = "0x9f1b0000000000000000ff".toByteArray() @@ -715,7 +660,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MIN_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 2 - max`() { val payload = "0x9f39ffffff".toByteArray() @@ -733,7 +677,6 @@ class CborDeserializerSuccessTest { assertEquals(-65536, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of float16 - NaN - LSB`() { val payload = "0x9ff97c01ff".toByteArray() @@ -751,7 +694,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 1 - max`() { val payload = "0x8138ff".toByteArray() @@ -769,7 +711,6 @@ class CborDeserializerSuccessTest { assertEquals(-256, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 2 - min`() { val payload = "0x81390000".toByteArray() @@ -787,7 +728,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of null`() { val payload = "0x81f6".toByteArray() @@ -801,7 +741,6 @@ class CborDeserializerSuccessTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of float16 -Inf`() { val payload = "0x81f9fc00".toByteArray() @@ -819,7 +758,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NEGATIVE_INFINITY, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 4 - min`() { val payload = "0x9f1a00000000ff".toByteArray() @@ -837,7 +775,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MIN_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 1 - min`() { val payload = "0x811800".toByteArray() @@ -855,7 +792,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MIN_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 0 - max`() { val payload = "0x9f17ff".toByteArray() @@ -873,7 +809,6 @@ class CborDeserializerSuccessTest { assertEquals(23u, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 0 - min`() { val payload = "0x9f20ff".toByteArray() @@ -891,7 +826,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 1 - max`() { val payload = "0x9f38ffff".toByteArray() @@ -909,7 +843,6 @@ class CborDeserializerSuccessTest { assertEquals(-256, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of null`() { val payload = "0x9ff6ff".toByteArray() @@ -923,7 +856,6 @@ class CborDeserializerSuccessTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 1 - max`() { val payload = "0x9f18ffff".toByteArray() @@ -941,7 +873,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MAX_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 4 - max`() { val payload = "0x9f1affffffffff".toByteArray() @@ -959,7 +890,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MAX_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of _ uint - 8 - max`() { val payload = "0x9f1bffffffffffffffffff".toByteArray() @@ -982,7 +912,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of boolean true`() { val payload = "0x9ff5ff".toByteArray() @@ -1000,7 +929,6 @@ class CborDeserializerSuccessTest { assertEquals(true, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of undefined`() { val payload = "0x9ff7ff".toByteArray() @@ -1018,7 +946,6 @@ class CborDeserializerSuccessTest { assertEquals(0, actual.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 0 - max`() { val payload = "0x8117".toByteArray() @@ -1036,7 +963,6 @@ class CborDeserializerSuccessTest { assertEquals(23u, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 8 - max`() { val payload = "0x811bffffffffffffffff".toByteArray() @@ -1057,7 +983,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 0 - min`() { val payload = "0x8120".toByteArray() @@ -1075,7 +1000,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 0 - max`() { val payload = "0x8137".toByteArray() @@ -1093,7 +1017,6 @@ class CborDeserializerSuccessTest { assertEquals(-24, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 4 - min`() { val payload = "0x813a00000000".toByteArray() @@ -1111,7 +1034,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of boolean true`() { val payload = "0x81f5".toByteArray() @@ -1129,7 +1051,6 @@ class CborDeserializerSuccessTest { assertEquals(true, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of float32`() { val payload = "0x81fa7f800000".toByteArray() @@ -1147,7 +1068,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.fromBits(2139095040), actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of float64`() { val payload = "0x81fb7ff0000000000000".toByteArray() @@ -1165,7 +1085,6 @@ class CborDeserializerSuccessTest { assertEquals(Double.fromBits(9218868437227405312), actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 2 - min`() { val payload = "0x9f190000ff".toByteArray() @@ -1183,7 +1102,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MIN_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of float16 - NaN - MSB`() { val payload = "0x9ff97e00ff".toByteArray() @@ -1201,7 +1119,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 0 - max`() { val payload = "0x9f37ff".toByteArray() @@ -1219,7 +1136,6 @@ class CborDeserializerSuccessTest { assertEquals(-24, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 1 - min`() { val payload = "0x9f3800ff".toByteArray() @@ -1237,7 +1153,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 8 - min`() { val payload = "0x9f3b0000000000000000ff".toByteArray() @@ -1255,7 +1170,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 8 - max`() { val payload = "0x9f3bfffffffffffffffeff".toByteArray() @@ -1277,7 +1191,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of boolean false`() { val payload = "0x81f4".toByteArray() @@ -1295,7 +1208,6 @@ class CborDeserializerSuccessTest { assertEquals(false, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of uint - 0 - min`() { val payload = "0x9f00ff".toByteArray() @@ -1313,7 +1225,6 @@ class CborDeserializerSuccessTest { assertEquals(0, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 4 - min`() { val payload = "0x9f3a00000000ff".toByteArray() @@ -1331,7 +1242,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of negint - 4 - max`() { val payload = "0x9f3affffffffff".toByteArray() @@ -1349,7 +1259,6 @@ class CborDeserializerSuccessTest { assertEquals(-4294967296, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of float16 - +Inf`() { val payload = "0x9ff97c00ff".toByteArray() @@ -1367,7 +1276,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.POSITIVE_INFINITY, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 0 - min`() { val payload = "0x8100".toByteArray() @@ -1385,7 +1293,6 @@ class CborDeserializerSuccessTest { assertEquals(0u, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 1 - min`() { val payload = "0x813800".toByteArray() @@ -1403,7 +1310,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of float16 - -Inf`() { val payload = "0x9ff9fc00ff".toByteArray() @@ -1421,7 +1327,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NEGATIVE_INFINITY, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of float32`() { val payload = "0x9ffa7f800000ff".toByteArray() @@ -1439,7 +1344,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.fromBits(2139095040), actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 2 - min`() { val payload = "0x81190000".toByteArray() @@ -1457,7 +1361,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MIN_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 4 - min`() { val payload = "0x811a00000000".toByteArray() @@ -1475,7 +1378,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MIN_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of float16 - +Inf`() { val payload = "0x81f97c00".toByteArray() @@ -1493,7 +1395,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.POSITIVE_INFINITY, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of float64`() { val payload = "0x9ffb7ff0000000000000ff".toByteArray() @@ -1511,7 +1412,6 @@ class CborDeserializerSuccessTest { assertEquals(Double.fromBits(9218868437227405312), actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of float16 - NaN - MSB`() { val payload = "0x81f97e00".toByteArray() @@ -1529,7 +1429,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of float16 - NaN - LSB`() { val payload = "0x81f97c01".toByteArray() @@ -1547,7 +1446,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite list of boolean false`() { val payload = "0x9ff4ff".toByteArray() @@ -1565,7 +1463,6 @@ class CborDeserializerSuccessTest { assertEquals(false, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 8 - min`() { val payload = "0x813b0000000000000000".toByteArray() @@ -1583,7 +1480,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 8 - max`() { val payload = "0x813bfffffffffffffffe".toByteArray() @@ -1605,7 +1501,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of undefined`() { val payload = "0x81f7".toByteArray() @@ -1619,7 +1514,6 @@ class CborDeserializerSuccessTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of uint - 2 - max`() { val payload = "0x8119ffff".toByteArray() @@ -1637,7 +1531,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MAX_VALUE, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 2 - max`() { val payload = "0x8139ffff".toByteArray() @@ -1655,7 +1548,6 @@ class CborDeserializerSuccessTest { assertEquals(-65536, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `list of negint - 4 - max`() { val payload = "0x813affffffff".toByteArray() @@ -1673,7 +1565,6 @@ class CborDeserializerSuccessTest { assertEquals(-4294967296, actual[0]) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - _ uint - 8 - max`() { val payload = "0xbf63666f6f1bffffffffffffffffff".toByteArray() @@ -1697,7 +1588,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of null`() { val payload = "0xa163666f6ff6".toByteArray() @@ -1716,7 +1606,6 @@ class CborDeserializerSuccessTest { assertEquals(null, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - _ negint - 4 - max`() { val payload = "0xbf63666f6f3affffffffff".toByteArray() @@ -1735,7 +1624,6 @@ class CborDeserializerSuccessTest { assertEquals(-4294967296, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - _ float16 - -Inf`() { val payload = "0xbf63666f6ff9fc00ff".toByteArray() @@ -1754,7 +1642,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NEGATIVE_INFINITY, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 2 - max`() { val payload = "0xa163666f6f19ffff".toByteArray() @@ -1773,7 +1660,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MAX_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - negint - 1 - min`() { val payload = "0xa163666f6f3800".toByteArray() @@ -1792,7 +1678,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of undefined`() { val payload = "0xbf63666f6ff7ff".toByteArray() @@ -1811,7 +1696,6 @@ class CborDeserializerSuccessTest { assertEquals(null, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 0 - max`() { val payload = "0xa163666f6f17".toByteArray() @@ -1830,7 +1714,6 @@ class CborDeserializerSuccessTest { assertEquals(23, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 0 - max`() { val payload = "0xbf63666f6f17ff".toByteArray() @@ -1849,7 +1732,6 @@ class CborDeserializerSuccessTest { assertEquals(23, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 1 - min`() { val payload = "0xbf63666f6f1800ff".toByteArray() @@ -1868,7 +1750,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 8 - min`() { val payload = "0xbf63666f6f1b0000000000000000ff".toByteArray() @@ -1887,7 +1768,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 8 - max`() { val payload = "0xbf63666f6f3bfffffffffffffffeff".toByteArray() @@ -1911,7 +1791,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 2 - min`() { val payload = "0xa163666f6f190000".toByteArray() @@ -1930,7 +1809,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of float16 - NaN - MSB`() { val payload = "0xbf63666f6ff97e00ff".toByteArray() @@ -1949,7 +1827,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - negint - 0 - min`() { val payload = "0xa163666f6f20".toByteArray() @@ -1968,7 +1845,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - float16 - -Inf`() { val payload = "0xa163666f6ff9fc00".toByteArray() @@ -1987,7 +1863,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NEGATIVE_INFINITY, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 1 - max`() { val payload = "0xbf63666f6f38ffff".toByteArray() @@ -2006,7 +1881,6 @@ class CborDeserializerSuccessTest { assertEquals(-256, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 8 - min`() { val payload = "0xbf63666f6f3b0000000000000000ff".toByteArray() @@ -2025,7 +1899,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 1 - min`() { val payload = "0xa163666f6f1800".toByteArray() @@ -2044,7 +1917,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 2 - min`() { val payload = "0xbf63666f6f190000ff".toByteArray() @@ -2063,7 +1935,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 2 - max`() { val payload = "0xbf63666f6f19ffffff".toByteArray() @@ -2082,7 +1953,6 @@ class CborDeserializerSuccessTest { assertEquals(UShort.MAX_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 0 - max`() { val payload = "0xbf63666f6f37ff".toByteArray() @@ -2101,7 +1971,6 @@ class CborDeserializerSuccessTest { assertEquals(-24, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 2 - max`() { val payload = "0xbf63666f6f39ffffff".toByteArray() @@ -2120,7 +1989,6 @@ class CborDeserializerSuccessTest { assertEquals(-65536, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of boolean true`() { val payload = "0xa163666f6ff5".toByteArray() @@ -2139,7 +2007,6 @@ class CborDeserializerSuccessTest { assertEquals(true, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of boolean true`() { val payload = "0xbf63666f6ff5ff".toByteArray() @@ -2158,7 +2025,6 @@ class CborDeserializerSuccessTest { assertEquals(true, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of boolean false`() { val payload = "0xbf63666f6ff4ff".toByteArray() @@ -2177,7 +2043,6 @@ class CborDeserializerSuccessTest { assertEquals(false, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 8 - max`() { val payload = "0xa163666f6f1bffffffffffffffff".toByteArray() @@ -2201,7 +2066,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - float16 - NaN - LSB`() { val payload = "0xa163666f6ff97c01".toByteArray() @@ -2220,7 +2084,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 0 - min`() { val payload = "0xbf63666f6f00ff".toByteArray() @@ -2239,7 +2102,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 4 - min`() { val payload = "0xbf63666f6f3a00000000ff".toByteArray() @@ -2258,7 +2120,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of float32`() { val payload = "0xbf63666f6ffa7f800000ff".toByteArray() @@ -2277,7 +2138,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.fromBits(2139095040), actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of uint - 0 - min`() { val payload = "0xa163666f6f00".toByteArray() @@ -2296,7 +2156,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - negint - 1 - max`() { val payload = "0xa163666f6f38ff".toByteArray() @@ -2315,7 +2174,6 @@ class CborDeserializerSuccessTest { assertEquals(-256, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - float64`() { val payload = "0xa163666f6ffb7ff0000000000000".toByteArray() @@ -2334,7 +2192,6 @@ class CborDeserializerSuccessTest { assertEquals(Double.fromBits(9218868437227405312), actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of float16 - NaN - LSB`() { val payload = "0xbf63666f6ff97c01ff".toByteArray() @@ -2353,7 +2210,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 8 - min`() { val payload = "0xa163666f6f1b0000000000000000".toByteArray() @@ -2372,7 +2228,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - negint - 8 - max`() { val payload = "0xa163666f6f3bfffffffffffffffe".toByteArray() @@ -2396,7 +2251,6 @@ class CborDeserializerSuccessTest { assertEquals(ULong.MAX_VALUE, result) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of undefined`() { val payload = "0xa163666f6ff7".toByteArray() @@ -2415,7 +2269,6 @@ class CborDeserializerSuccessTest { assertEquals(null, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of float16 - NaN - MSB`() { val payload = "0xa163666f6ff97e00".toByteArray() @@ -2434,7 +2287,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.NaN, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of negint - 8 - min`() { val payload = "0xa163666f6f3b0000000000000000".toByteArray() @@ -2453,7 +2305,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 4 - max`() { val payload = "0xbf63666f6f1affffffffff".toByteArray() @@ -2472,7 +2323,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MAX_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 1 - min`() { val payload = "0xbf63666f6f3800ff".toByteArray() @@ -2491,7 +2341,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of float16 - +Inf`() { val payload = "0xbf63666f6ff97c00ff".toByteArray() @@ -2510,7 +2359,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.POSITIVE_INFINITY, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - negint - 2 - min`() { val payload = "0xa163666f6f390000".toByteArray() @@ -2529,7 +2377,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of false`() { val payload = "0xa163666f6ff4".toByteArray() @@ -2548,7 +2395,6 @@ class CborDeserializerSuccessTest { assertEquals(false, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of float32`() { val payload = "0xa163666f6ffa7f800000".toByteArray() @@ -2567,7 +2413,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.fromBits(2139095040), actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 1 - max`() { val payload = "0xbf63666f6f18ffff".toByteArray() @@ -2586,7 +2431,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MAX_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of negint - 0 - max`() { val payload = "0xa163666f6f37".toByteArray() @@ -2605,7 +2449,6 @@ class CborDeserializerSuccessTest { assertEquals(-24, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of negint - 4 - max`() { val payload = "0xa163666f6f3affffffff".toByteArray() @@ -2624,7 +2467,6 @@ class CborDeserializerSuccessTest { assertEquals(-4294967296, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of float16 - +Inf`() { val payload = "0xa163666f6ff97c00".toByteArray() @@ -2643,7 +2485,6 @@ class CborDeserializerSuccessTest { assertEquals(Float.POSITIVE_INFINITY, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of float64`() { val payload = "0xbf63666f6ffb7ff0000000000000ff".toByteArray() @@ -2662,7 +2503,6 @@ class CborDeserializerSuccessTest { assertEquals(Double.fromBits(9218868437227405312), actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of uint - 1 - max`() { val payload = "0xa163666f6f18ff".toByteArray() @@ -2681,7 +2521,6 @@ class CborDeserializerSuccessTest { assertEquals(UByte.MAX_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map - uint - 4 - max`() { val payload = "0xa163666f6f1affffffff".toByteArray() @@ -2700,7 +2539,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MAX_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of negint - 2 - max`() { val payload = "0xa163666f6f39ffff".toByteArray() @@ -2719,7 +2557,6 @@ class CborDeserializerSuccessTest { assertEquals(-65536, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of uint - 4 - min`() { val payload = "0xbf63666f6f1a00000000ff".toByteArray() @@ -2738,7 +2575,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 0 - min`() { val payload = "0xbf63666f6f20ff".toByteArray() @@ -2757,7 +2593,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of null`() { val payload = "0xbf63666f6ff6ff".toByteArray() @@ -2776,7 +2611,6 @@ class CborDeserializerSuccessTest { assertEquals(null, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of uint - 4 - min`() { val payload = "0xa163666f6f1a00000000".toByteArray() @@ -2795,7 +2629,6 @@ class CborDeserializerSuccessTest { assertEquals(UInt.MIN_VALUE, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `map of negint - 4 - min`() { val payload = "0xa163666f6f3a00000000".toByteArray() @@ -2814,7 +2647,6 @@ class CborDeserializerSuccessTest { assertEquals(-1, actual.entries.first().value) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun `indefinite map of negint - 2 - min`() { val payload = "0xbf63666f6f390000ff".toByteArray() diff --git a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerTest.kt b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerTest.kt index 93a5b10806..a94891c5cb 100644 --- a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerTest.kt +++ b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborDeserializerTest.kt @@ -4,14 +4,12 @@ */ package aws.smithy.kotlin.runtime.serde.cbor -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.io.SdkBuffer import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFails class CborDeserializerTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNumberDeserializationThrowsOnOutOfRange() { val serializer = CborSerializer() diff --git a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborSerializerTest.kt b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborSerializerTest.kt index b8c45af823..63da8441e5 100644 --- a/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborSerializerTest.kt +++ b/runtime/serde/serde-cbor/common/test/aws/smithy/kotlin/runtime/serde/cbor/CborSerializerTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.serde.cbor -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.content.BigDecimal import aws.smithy.kotlin.runtime.content.BigInteger import aws.smithy.kotlin.runtime.io.SdkBuffer @@ -18,7 +17,6 @@ import kotlin.time.Duration.Companion.seconds @OptIn(ExperimentalStdlibApi::class) class CborSerializerTest { - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBoolean() { val tests = listOf(true, false, true, false, false) @@ -37,7 +35,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testByte() { val tests = listOf(Byte.MIN_VALUE, -34, 0, 39, Byte.MAX_VALUE) @@ -55,7 +52,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testChar() { val tests = listOf( @@ -80,7 +76,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInt() { val tests = listOf(Int.MIN_VALUE, -34, 0, 39, 402, Int.MAX_VALUE) @@ -98,7 +93,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testLong() { val tests = listOf(Long.MIN_VALUE, -34, 0, 39, 402, Long.MAX_VALUE) @@ -116,7 +110,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testFloat() { val tests = listOf( @@ -148,7 +141,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testDouble() { val tests = listOf( @@ -176,7 +168,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBigInteger() { val tests = listOf( @@ -208,7 +199,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testBigDecimal() { val tests = listOf( @@ -248,7 +238,6 @@ class CborSerializerTest { assertEquals("c48221196ab3", serializer.toByteArray().toHexString()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testString() { val tests = listOf( @@ -275,7 +264,6 @@ class CborSerializerTest { assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testInstant() { val tests = listOf( @@ -302,16 +290,13 @@ class CborSerializerTest { val buffer = SdkBuffer().apply { write(serializer.toByteArray()) } val deserializer = CborPrimitiveDeserializer(buffer) - tests.dropLast(1).forEach { + tests.forEach { assertEquals(it.epochMilliseconds, deserializer.deserializeInstant(TimestampFormat.EPOCH_SECONDS).epochMilliseconds) } - // FIXME Serializing -> deserializing Instant.MAX_VALUE results in a one millisecond offset... - assertEquals(Instant.MAX_VALUE.epochMilliseconds, deserializer.deserializeInstant(TimestampFormat.EPOCH_SECONDS).epochMilliseconds - 1) assertEquals(0, buffer.size) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testNull() { val serializer = CborSerializer() @@ -323,7 +308,6 @@ class CborSerializerTest { assertNull(deserializer.deserializeNull()) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testDocument() { val serializer = CborSerializer() @@ -332,7 +316,6 @@ class CborSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testList() { val serializer = CborSerializer() @@ -369,7 +352,6 @@ class CborSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun testMap() { val serializer = CborSerializer() diff --git a/runtime/serde/serde-form-url/common/test/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializerTest.kt b/runtime/serde/serde-form-url/common/test/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializerTest.kt index 9874dbafa4..ea5662dba7 100644 --- a/runtime/serde/serde-form-url/common/test/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializerTest.kt +++ b/runtime/serde/serde-form-url/common/test/aws/smithy/kotlin/runtime/serde/formurl/FormUrlSerializerTest.kt @@ -5,7 +5,6 @@ package aws.smithy.kotlin.runtime.serde.formurl -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.serde.* import aws.smithy.kotlin.runtime.time.Instant import aws.smithy.kotlin.runtime.time.TimestampFormat @@ -100,7 +99,6 @@ class FormUrlSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesStructs() { val struct = PrimitiveStructTest() @@ -125,7 +123,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesEmptyStrings() { // see `string` from https://awslabs.github.io/smithy/1.0/spec/aws/aws-query-protocol.html#x-www-form-urlencoded-shape-serialization @@ -188,7 +185,6 @@ class FormUrlSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesLists() { val input = ListInput( @@ -210,7 +206,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesFlattenedLists() { // xmlFlattened() lists @@ -235,7 +230,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesListsWithRenamedMember() { // xmlName() trait on list member @@ -257,7 +251,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesClassWithNestedClassField() { val a = A( @@ -317,7 +310,6 @@ class FormUrlSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesMaps() { val input = MapInput( @@ -351,7 +343,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itSerializesMapOfLists() { val input = MapInput( @@ -400,7 +391,6 @@ class FormUrlSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesMapOfMapOfPrimitive() { val expected = """ @@ -422,7 +412,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesFlattenedMaps() { val input = MapInput( @@ -491,7 +480,6 @@ class FormUrlSerializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesNestedMaps() { val input = NestedStructureInput( @@ -511,7 +499,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesNestedLists() { val input = NestedStructureInput( @@ -529,7 +516,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesRenamedMaps() { // map with xmlName key/value overrides @@ -567,7 +553,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesQueryLiterals() { // test SdkObjectDescriptor with query literals trait @@ -599,7 +584,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itEncodesWhitespace() { val input = MapInput( @@ -624,7 +608,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesEmptyList() { val input = ListInput( @@ -642,7 +625,6 @@ class FormUrlSerializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itSerializesEmptyListInMap() { val input = MapInput( diff --git a/runtime/serde/serde-json/common/test/aws/smithy/kotlin/runtime/serde/json/JsonDeserializerTest.kt b/runtime/serde/serde-json/common/test/aws/smithy/kotlin/runtime/serde/json/JsonDeserializerTest.kt index fd12b97a95..bd96e92173 100644 --- a/runtime/serde/serde-json/common/test/aws/smithy/kotlin/runtime/serde/json/JsonDeserializerTest.kt +++ b/runtime/serde/serde-json/common/test/aws/smithy/kotlin/runtime/serde/json/JsonDeserializerTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.serde.json -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.content.Document import aws.smithy.kotlin.runtime.content.buildDocument import aws.smithy.kotlin.runtime.serde.* @@ -100,7 +99,6 @@ class JsonDeserializerTest { assertEquals(expected, actual) } - @IgnoreNative // FIXME Re-enable after Kotlin/Native Implementation @Test fun itHandlesBigInteger() { val tests = listOf( @@ -118,7 +116,6 @@ class JsonDeserializerTest { } } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itHandlesBigDecimal() { val tests = listOf( diff --git a/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpRequestTestBuilderTest.kt b/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpRequestTestBuilderTest.kt index 6798ed3d0b..140fea8d25 100644 --- a/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpRequestTestBuilderTest.kt +++ b/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpRequestTestBuilderTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.smithy.test -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.HttpBody import aws.smithy.kotlin.runtime.http.HttpMethod import aws.smithy.kotlin.runtime.http.request.HttpRequest @@ -20,7 +19,6 @@ class HttpRequestTestBuilderTest { private val execContext = ExecutionContext() - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsHttpMethod() { val ex = assertFails { @@ -39,7 +37,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("expected method: `POST`; got: `GET`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsUri() { val ex = assertFails { @@ -60,7 +57,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("expected path: `/foo`; got: `/bar`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsQueryParameters() { val ex = assertFails { @@ -89,7 +85,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("Query parameter `Hi` does not contain expected value `Hello%20there`. Actual values: [Hello]") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsForbiddenQueryParameters() { val ex = assertFails { @@ -120,7 +115,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("forbidden query parameter found: `foobar`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsRequiredQueryParameters() { val ex = assertFails { @@ -152,7 +146,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("required query parameter not found: `requiredQuery`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsHeaders() { val ex = assertFails { @@ -193,7 +186,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("expected header `k2` has no actual values") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsListsOfHeaders() { val ex = assertFails { @@ -222,7 +214,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("expected header name value pair not equal: `k2:v3, v4, v5`; found: `k2:v3, v4") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsForbiddenHeaders() { val ex = assertFails { @@ -266,7 +257,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("forbidden header found: `forbiddenHeader`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsRequiredHeaders() { val ex = assertFails { @@ -311,7 +301,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("expected required header not found: `requiredHeader`") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itFailsWhenBodyAssertFunctionIsMissing() { val ex = assertFails { @@ -331,7 +320,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("body assertion function is required if an expected body is defined") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itCallsBodyAssertFunction() { val ex = assertFails { @@ -352,7 +340,6 @@ class HttpRequestTestBuilderTest { ex.message.shouldContain("actual bytes read does not match expected") } - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itAssertsHostWhenSet() { val ex = assertFails { diff --git a/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpResponseTestBuilderTest.kt b/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpResponseTestBuilderTest.kt index 8571acdb17..5a66bd33be 100644 --- a/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpResponseTestBuilderTest.kt +++ b/runtime/smithy-test/common/test/aws/smithy/kotlin/runtime/smithy/test/HttpResponseTestBuilderTest.kt @@ -4,7 +4,6 @@ */ package aws.smithy.kotlin.runtime.smithy.test -import aws.smithy.kotlin.runtime.IgnoreNative import aws.smithy.kotlin.runtime.http.HttpStatusCode import aws.smithy.kotlin.runtime.http.readAll import aws.smithy.kotlin.runtime.http.request.HttpRequestBuilder @@ -15,7 +14,6 @@ import kotlin.test.Test class HttpResponseTestBuilderTest { private data class Foo(val bar: Int, val baz: String) - @IgnoreNative // FIXME Re-enable after Kotlin/Native implementation @Test fun itBuildsResponses() { httpResponseTest {