Replace () with (void) in function prototypes
[platform/core/system/dlog.git] / src / tests / fd_info_neg.c
1 /*
2  * Copyright (c) 2019-2020, Samsung Electronics Co., Ltd. All rights reserved.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #include "fd_info_wrap.c"
18
19 int main(void)
20 {
21         struct fd_ops fops = {
22                 .destroy = test_destroy,
23                 .extract_entry = test_extract,
24                 .should_filter = true,
25         };
26
27         malloc_ret = NULL;
28         assert(NULL == fdi_create(&fops, 27));
29         fdi_free(NULL); // shouldn't explode
30
31         malloc_ret = &G_fdi;
32         G_fdi = (struct fd_info) {
33                 .fd = 52,
34                 .priv_data = (void *) 0x16180339,
35                 .id = 78,
36                 .ops = (struct fd_ops *) 0x31415926,
37         };
38         assert(&G_fdi == fdi_create(&fops, 78));
39
40         struct sort_vector sv;
41         dlogutil_entry_s *flushee = NULL;
42
43         fail_extract = true;
44         assert(-ENOMEM == fdi_push_log(&G_fdi, &sv, false, &flushee, (struct log_filter *) 404));
45
46         use_real_malloc = true;
47         use_real_free = true;
48         use_real_close = true;
49 }