Skip to content

Commit fc15085

Browse files
committed
レビュー指摘の反映: 共有可変フィールドの可視性保証とテスト断言の補強
- 別スレッドから更新される接続先アドレスの書き込み可視性を保証 - 練習モードの店舗選択テストに失敗フラグの検証を追加 https://claude.ai/code/session_01TbRomX8cQTi7d8w5hEBMQd
1 parent 879ebc5 commit fc15085

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

app/src/main/kotlin/info/nukoneko/cuc/android/kidspos/api/ServerSelectionInterceptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package info.nukoneko.cuc.android.kidspos.api
33
import okhttp3.Interceptor
44
import okhttp3.Response
55

6-
class ServerSelectionInterceptor(var serverAddress: String) : Interceptor {
6+
class ServerSelectionInterceptor(@Volatile var serverAddress: String) : Interceptor {
77
override fun intercept(chain: Interceptor.Chain): Response {
88
var request = chain.request()
99
if (serverAddress.isNotEmpty()) {

app/src/testProd/kotlin/info/nukoneko/cuc/android/kidspos/ui/main/MainViewModelTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ class MainViewModelTest {
274274
val selection = viewModel.uiState.value.storeSelection
275275
assertNotNull(selection)
276276
assertEquals(false, selection?.loading)
277+
assertEquals(false, selection?.failed)
277278
assertEquals(2, selection?.stores?.size)
278279
assertTrue(apiService.createSaleCalls.isEmpty())
279280
}

0 commit comments

Comments
 (0)