From 4e17eccfc98da3c77390484593731711f7a63690 Mon Sep 17 00:00:00 2001 From: Jake Wharton Date: Wed, 18 Dec 2024 21:08:13 -0500 Subject: [PATCH] Use common FileSystem.SYSTEM property (#1482) This expect/actual pre-dates the commonization of the property. --- .../zipline/profiler/SamplingProfilerTest.kt | 4 +++- .../profiler/ZiplineProfilerTesting.kt | 20 ------------------- .../profiler/ZiplineProfilerTestingJvm.kt | 20 ------------------- .../zipline/profiler/ProfilerClockNative.kt | 20 ------------------- 4 files changed, 3 insertions(+), 61 deletions(-) delete mode 100644 zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTesting.kt delete mode 100644 zipline-profiler/src/jvmTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTestingJvm.kt delete mode 100644 zipline-profiler/src/nativeTest/kotlin/app/cash/zipline/profiler/ProfilerClockNative.kt diff --git a/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/SamplingProfilerTest.kt b/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/SamplingProfilerTest.kt index b31121281b..3cd46d82bd 100644 --- a/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/SamplingProfilerTest.kt +++ b/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/SamplingProfilerTest.kt @@ -19,7 +19,9 @@ import app.cash.zipline.QuickJs import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test +import okio.FileSystem import okio.Path.Companion.toPath +import okio.SYSTEM import okio.use internal class SamplingProfilerTest { @@ -128,7 +130,7 @@ internal class SamplingProfilerTest { /** This test just confirms the sampling profiler completes normally. */ @Test fun happyPath() { - quickJs.startCpuSampling(SYSTEM_FILESYSTEM, "fibonacci.hprof".toPath()).use { + quickJs.startCpuSampling(FileSystem.SYSTEM, "fibonacci.hprof".toPath()).use { for (i in 0 until 100) { quickJs.evaluate("""fib20()""".trimMargin()) } diff --git a/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTesting.kt b/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTesting.kt deleted file mode 100644 index 91f2bb91f9..0000000000 --- a/zipline-profiler/src/commonTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTesting.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2023 Cash App - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package app.cash.zipline.profiler - -import okio.FileSystem - -expect val SYSTEM_FILESYSTEM: FileSystem diff --git a/zipline-profiler/src/jvmTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTestingJvm.kt b/zipline-profiler/src/jvmTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTestingJvm.kt deleted file mode 100644 index 34c0c5d89a..0000000000 --- a/zipline-profiler/src/jvmTest/kotlin/app/cash/zipline/profiler/ZiplineProfilerTestingJvm.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2023 Cash App - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package app.cash.zipline.profiler - -import okio.FileSystem - -actual val SYSTEM_FILESYSTEM = FileSystem.SYSTEM diff --git a/zipline-profiler/src/nativeTest/kotlin/app/cash/zipline/profiler/ProfilerClockNative.kt b/zipline-profiler/src/nativeTest/kotlin/app/cash/zipline/profiler/ProfilerClockNative.kt deleted file mode 100644 index 34c0c5d89a..0000000000 --- a/zipline-profiler/src/nativeTest/kotlin/app/cash/zipline/profiler/ProfilerClockNative.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2023 Cash App - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package app.cash.zipline.profiler - -import okio.FileSystem - -actual val SYSTEM_FILESYSTEM = FileSystem.SYSTEM