2 * Copyright (c) 2018-2020, 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.
17 #include "libdlog_android_wrapper.c"
22 __dlog_init_android(&CONF);
24 assert(!write_to_log);
25 assert(!destroy_backend);
29 __dlog_init_android(&CONF);
32 assert(destroy_backend);
35 int result = clock_gettime(CLOCK_MONOTONIC, &tp);
39 #define F(B, P, M) assert(write_to_log(B, P, "tag", M, &tp) == DLOG_ERROR_INVALID_PARAMETER)
40 F(LOG_ID_INVALID, DLOG_ERROR , "xx");
41 F(LOG_ID_MAX , DLOG_ERROR , "xx");
42 F(LOG_ID_MAIN , DLOG_UNKNOWN , "xx");
43 F(LOG_ID_MAIN , (log_priority) -7, "xx");
44 F(LOG_ID_MAIN , (log_priority) 23, "xx");
45 F(LOG_ID_MAIN , DLOG_ERROR , NULL);
49 for (int i = 0; i < 4; ++i) {
50 used_msg = LONG_TEXTS[i];
52 writev_called = false;
54 errno_to_set = i + 10;
55 assert(write_to_log(i, i + 3, "tag", LONG_TEXTS[i], &tp) == -(i + 10));
56 assert(writev_called);
60 assert(closed + 1 == LOG_ID_MAX);