From 6a016c3900ad76d2b4072b125a79a8a99785f515 Mon Sep 17 00:00:00 2001 From: Paul Beusterien Date: Mon, 2 Oct 2023 17:56:26 -0700 Subject: [PATCH] platform build fixes --- FirebaseAuth/Tests/Unit/SwiftAPI.swift | 42 +++++++++++++++----------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/FirebaseAuth/Tests/Unit/SwiftAPI.swift b/FirebaseAuth/Tests/Unit/SwiftAPI.swift index 8bc66c1da2e..05d27490639 100644 --- a/FirebaseAuth/Tests/Unit/SwiftAPI.swift +++ b/FirebaseAuth/Tests/Unit/SwiftAPI.swift @@ -414,26 +414,32 @@ class AuthAPI_hOnlyTests: XCTestCase { } #endif - func FIRTOTPSecret_h() { - let obj = TOTPSecret(secretKey: "key", hashingAlgorithm: "algo", codeLength: 9, - codeIntervalSeconds: 8, enrollmentCompletionDeadline: nil, - sessionInfo: "session") - _ = obj.sharedSecretKey() - _ = obj.generateQRCodeURL(withAccountName: "name", issuer: "issuer") - obj.openInOTPApp(withQRCodeURL: "url") - } + #if os(iOS) + func FIRTOTPSecret_h() { + let obj = TOTPSecret(secretKey: "key", hashingAlgorithm: "algo", codeLength: 9, + codeIntervalSeconds: 8, enrollmentCompletionDeadline: nil, + sessionInfo: "session") + _ = obj.sharedSecretKey() + _ = obj.generateQRCodeURL(withAccountName: "name", issuer: "issuer") + obj.openInOTPApp(withQRCodeURL: "url") + } - func FIRTOTPMultiFactorGenerator_h() { - TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession(mfaCredential: "")) { _, _ in + func FIRTOTPMultiFactorGenerator_h() { + TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession(mfaCredential: "")) { _, _ in + } + let secret = TOTPSecret(secretKey: "key", + hashingAlgorithm: "algo", + codeLength: 9, + codeIntervalSeconds: 8, + enrollmentCompletionDeadline: nil, + sessionInfo: "session") + _ = TOTPMultiFactorGenerator.assertionForEnrollment(with: secret, + oneTimePassword: "code") + _ = TOTPMultiFactorGenerator.assertionForSignIn( + withEnrollmentID: "id", oneTimePassword: "code" + ) } - let secret = TOTPSecret(secretKey: "key", hashingAlgorithm: "algo", codeLength: 9, - codeIntervalSeconds: 8, enrollmentCompletionDeadline: nil, - sessionInfo: "session") - _ = TOTPMultiFactorGenerator.assertionForEnrollment(with: secret, - oneTimePassword: "code") - _ = TOTPMultiFactorGenerator.assertionForSignIn(withEnrollmentID: "id", - oneTimePassword: "code") - } + #endif @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *) func FIRTOTPMultiFactorGenerator_hAsync() async throws {