2 * Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file test_cases_async.cpp
19 * @author Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
21 * @brief Tests for libcynara-client-async
24 #include <cynara_test_commons.h>
25 #include <cynara_test_client_async_client.h>
27 #include <dpl/test/test_runner.h>
29 #include <cynara-client-async.h>
33 using namespace CynaraTestClientAsync;
35 void tca01_initialize_func()
40 void tca02_empty_cache_miss_func()
42 std::string testNo("02");
45 client.checkCache({testNo}, CYNARA_API_CACHE_MISS);
46 client.checkCache({testNo}, CYNARA_API_CACHE_MISS);
49 void tca03_create_max_requests_func()
51 std::string testNo("03");
53 RequestEntity callbackData = {RequestFunction(), 0, CYNARA_CALL_CAUSE_FINISH};
57 for (auto i = 0; i <= UINT16_MAX; ++i) {
58 client.createRequest({testNo, i}, id, callbackData, CYNARA_API_SUCCESS);
59 client.assertStatus(READWRITE);
62 client.createRequest({testNo}, id, callbackData, CYNARA_API_MAX_PENDING_REQUESTS);
63 client.assertStatus(READWRITE);
66 RUNNER_TEST_GROUP_INIT(cynara_async_tests)
68 RUN_CYNARA_TEST(tca01_initialize)
69 RUN_CYNARA_TEST(tca02_empty_cache_miss)
70 RUN_CYNARA_TEST(tca03_create_max_requests)