${CMAKE_CURRENT_SOURCE_DIR}/base64_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/message_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ctap_message_processor_tests.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/qr_code_shower_tests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/crypto/hkdf_unittest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/crypto/hmac_unittest.cpp
${CMAKE_CURRENT_SOURCE_DIR}/crypto/sha2_unittest.cpp
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd. All rights reserved
+ *
+ * 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
+ */
+
+#include "qr_code_shower.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+TEST(QrCodeShower, callback_is_called)
+{
+ QrCodeShower qrCodeShower;
+ int calledNumTimes = 0;
+ static constexpr auto callback = [](const char *qrContents, void *userData) {
+ EXPECT_THAT(qrContents, testing::StartsWith("FIDO:/"));
+ ++*static_cast<int *>(userData);
+ };
+ qrCodeShower.ShowQrCode({}, {}, {'m', 'c'}, true, callback, &calledNumTimes);
+ EXPECT_EQ(calledNumTimes, 1);
+}