Skip to content

Commit 01ce54f

Browse files
committed
ktlint
1 parent 3cc2925 commit 01ce54f

File tree

3 files changed

+75
-53
lines changed

3 files changed

+75
-53
lines changed

aws-runtime/aws-config/mingw/src/aws/sdk/kotlin/runtime/auth/credentials/executeCommandMingw.kt

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,20 @@ internal actual suspend fun executeCommand(
4444
}
4545

4646
var hOut: HANDLE? = CreateFileW(
47-
/* lpFileName = */ outPath,
48-
/* dwDesiredAccess = */ GENERIC_WRITE.toUInt(),
49-
/* dwShareMode = */ (FILE_SHARE_READ or FILE_SHARE_WRITE).toUInt(),
50-
/* lpSecurityAttributes = */ sa.ptr,
51-
/* dwCreationDisposition = */ CREATE_ALWAYS.toUInt(),
52-
/* dwFlagsAndAttributes = */ FILE_ATTRIBUTE_NORMAL.toUInt(),
53-
/* hTemplateFile = */ null,
47+
/* lpFileName = */
48+
outPath,
49+
/* dwDesiredAccess = */
50+
GENERIC_WRITE.toUInt(),
51+
/* dwShareMode = */
52+
(FILE_SHARE_READ or FILE_SHARE_WRITE).toUInt(),
53+
/* lpSecurityAttributes = */
54+
sa.ptr,
55+
/* dwCreationDisposition = */
56+
CREATE_ALWAYS.toUInt(),
57+
/* dwFlagsAndAttributes = */
58+
FILE_ATTRIBUTE_NORMAL.toUInt(),
59+
/* hTemplateFile = */
60+
null,
5461
)
5562
if (hOut == INVALID_HANDLE_VALUE) error("CreateFileW failed for temp output (GetLastError=${GetLastError()})")
5663

@@ -80,16 +87,26 @@ internal actual suspend fun executeCommand(
8087
val pi = alloc<PROCESS_INFORMATION>()
8188

8289
val created = CreateProcessW(
83-
/* lpApplicationName = */ cmdExe,
84-
/* lpCommandLine = */ cmdLineBuf,
85-
/* lpProcessAttributes = */ null,
86-
/* lpThreadAttributes = */ null,
87-
/* bInheritHandles = */ TRUE,
88-
/* dwCreationFlags = */ CREATE_NO_WINDOW.toUInt(),
89-
/* lpEnvironment = */ null,
90-
/* lpCurrentDirectory = */ null,
91-
/* lpStartupInfo = */ si.ptr,
92-
/* lpProcessInformation = */ pi.ptr,
90+
/* lpApplicationName = */
91+
cmdExe,
92+
/* lpCommandLine = */
93+
cmdLineBuf,
94+
/* lpProcessAttributes = */
95+
null,
96+
/* lpThreadAttributes = */
97+
null,
98+
/* bInheritHandles = */
99+
TRUE,
100+
/* dwCreationFlags = */
101+
CREATE_NO_WINDOW.toUInt(),
102+
/* lpEnvironment = */
103+
null,
104+
/* lpCurrentDirectory = */
105+
null,
106+
/* lpStartupInfo = */
107+
si.ptr,
108+
/* lpProcessInformation = */
109+
pi.ptr,
93110
)
94111
if (created == 0) error("CreateProcessW failed (GetLastError=${GetLastError()})")
95112

@@ -124,13 +141,20 @@ internal actual suspend fun executeCommand(
124141

125142
// 7) read back bounded
126143
val hIn: HANDLE? = CreateFileW(
127-
/* lpFileName = */ outPath,
128-
/* dwDesiredAccess = */ GENERIC_READ.toUInt(),
129-
/* dwShareMode = */ (FILE_SHARE_READ or FILE_SHARE_WRITE).toUInt(),
130-
/* lpSecurityAttributes = */ null,
131-
/* dwCreationDisposition = */ OPEN_EXISTING.toUInt(),
132-
/* dwFlagsAndAttributes = */ FILE_ATTRIBUTE_NORMAL.toUInt(),
133-
/* hTemplateFile = */ null,
144+
/* lpFileName = */
145+
outPath,
146+
/* dwDesiredAccess = */
147+
GENERIC_READ.toUInt(),
148+
/* dwShareMode = */
149+
(FILE_SHARE_READ or FILE_SHARE_WRITE).toUInt(),
150+
/* lpSecurityAttributes = */
151+
null,
152+
/* dwCreationDisposition = */
153+
OPEN_EXISTING.toUInt(),
154+
/* dwFlagsAndAttributes = */
155+
FILE_ATTRIBUTE_NORMAL.toUInt(),
156+
/* hTemplateFile = */
157+
null,
134158
)
135159
if (hIn == INVALID_HANDLE_VALUE) {
136160
_wunlink(outPath.wideCString(this))

hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import aws.sdk.kotlin.gradle.kmp.NATIVE_ENABLED
76
import com.amazonaws.services.dynamodbv2.local.main.ServerRunner
87
import com.amazonaws.services.dynamodbv2.local.server.DynamoDBProxyServer
98
import com.google.devtools.ksp.gradle.KspTaskJvm
10-
import com.google.devtools.ksp.gradle.KspTaskMetadata
119
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
1210
import java.net.ServerSocket
1311
import java.nio.file.Files

services/polly/common/test/aws/sdk/kotlin/services/polly/PollyTest.kt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,36 @@ import kotlin.test.assertTrue
2222
import kotlin.time.Duration.Companion.seconds
2323

2424
class PollyPresignerTest {
25-
// @Test
26-
// fun itProducesExpectedUrlComponents() = runTest {
27-
// val request = SynthesizeSpeechRequest {
28-
// voiceId = VoiceId.Salli
29-
// outputFormat = OutputFormat.Pcm
30-
// text = "hello world"
31-
// }
25+
@Test
26+
fun itProducesExpectedUrlComponents() = runTest {
27+
val request = SynthesizeSpeechRequest {
28+
voiceId = VoiceId.Salli
29+
outputFormat = OutputFormat.Pcm
30+
text = "hello world"
31+
}
3232

33-
// val pollyClient = PollyClient {
34-
// region = "us-east-2"
35-
// credentialsProvider = StaticCredentialsProvider {
36-
// accessKeyId = "AKID"
37-
// secretAccessKey = "secret"
38-
// }
39-
// httpClient = NoHttpEngine
40-
// }
33+
val pollyClient = PollyClient {
34+
region = "us-east-2"
35+
credentialsProvider = StaticCredentialsProvider {
36+
accessKeyId = "AKID"
37+
secretAccessKey = "secret"
38+
}
39+
httpClient = NoHttpEngine
40+
}
4141

42-
// try {
43-
// val presignedRequest = pollyClient.presignSynthesizeSpeech(request, 10.seconds)
42+
try {
43+
val presignedRequest = pollyClient.presignSynthesizeSpeech(request, 10.seconds)
4444

45-
// assertEquals(HttpMethod.GET, presignedRequest.method)
46-
// assertTrue("Host".equals(presignedRequest.headers.entries().single().key, ignoreCase = true))
47-
// assertEquals("polly.us-east-2.amazonaws.com", presignedRequest.headers["Host"])
48-
// assertEquals("/v1/speech", presignedRequest.url.path.toString())
49-
// val expectedQueryParameters = setOf("OutputFormat", "Text", "VoiceId", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "X-Amz-SignedHeaders", "X-Amz-Expires", "X-Amz-Signature")
50-
// assertEquals(expectedQueryParameters, presignedRequest.url.parameters.encodedParameters.keys)
51-
// } finally {
52-
// pollyClient.close()
53-
// }
54-
// }
45+
assertEquals(HttpMethod.GET, presignedRequest.method)
46+
assertTrue("Host".equals(presignedRequest.headers.entries().single().key, ignoreCase = true))
47+
assertEquals("polly.us-east-2.amazonaws.com", presignedRequest.headers["Host"])
48+
assertEquals("/v1/speech", presignedRequest.url.path.toString())
49+
val expectedQueryParameters = setOf("OutputFormat", "Text", "VoiceId", "X-Amz-Algorithm", "X-Amz-Credential", "X-Amz-Date", "X-Amz-SignedHeaders", "X-Amz-Expires", "X-Amz-Signature")
50+
assertEquals(expectedQueryParameters, presignedRequest.url.parameters.encodedParameters.keys)
51+
} finally {
52+
pollyClient.close()
53+
}
54+
}
5555
}
5656

5757
object NoHttpEngine : HttpClientEngineBase("no-http") {

0 commit comments

Comments
 (0)