Last change
on this file since 9de8d61 was
9de8d61,
checked in by Sebastian Huber <sebastian.huber@…>, on 07/17/20 at 11:36:49
|
libtest: <rtems/test.h> to <rtems/test-info.h>
Rename this header file to later move <t.h> to <rtems/test.h>. The main
feature provided by <rtems/test-info.h> is the output of standard test
information which is consumed by the RTEMS Tester.
Update #3199.
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2018 Chris Johns <chrisj@rtems.org>. All rights reserved. |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.org/license/LICENSE. |
---|
7 | */ |
---|
8 | |
---|
9 | #include "dl06-o2.h" |
---|
10 | |
---|
11 | #include <dlfcn.h> |
---|
12 | #include <math.h> |
---|
13 | |
---|
14 | #include <rtems/test-info.h> |
---|
15 | |
---|
16 | #define printf(...) rtems_printf(&rtems_test_printer, __VA_ARGS__); |
---|
17 | |
---|
18 | typedef void (*func1_t)(unsigned short s[7]); |
---|
19 | |
---|
20 | static void* find_sym(const char* name) |
---|
21 | { |
---|
22 | void* sym = dlsym(RTLD_DEFAULT, name); |
---|
23 | if (sym == NULL) |
---|
24 | printf("dlsym failed: not found: %s\n", name); |
---|
25 | return sym; |
---|
26 | } |
---|
27 | |
---|
28 | /* |
---|
29 | * Yes a decl in the source. This is a modules main and I could not find which |
---|
30 | * header main is defined in. |
---|
31 | */ |
---|
32 | int rtems_main (int argc, const char* argv[]); |
---|
33 | |
---|
34 | int rtems_main (int argc, const char* argv[]) |
---|
35 | { |
---|
36 | func1_t f1; |
---|
37 | double d; |
---|
38 | unsigned short s[7] = { 12, 34, 56, 78, 90, 13, 57 }; |
---|
39 | |
---|
40 | printf("Loaded module: argc:%d [%s]\n", argc, __FILE__); |
---|
41 | |
---|
42 | f1 = find_sym ("dl_o2_func1"); |
---|
43 | if (f1 == NULL) |
---|
44 | return 0; |
---|
45 | |
---|
46 | f1 (s); |
---|
47 | |
---|
48 | d = dl_o2_func2 (7.1, 33.0); |
---|
49 | (void) d; |
---|
50 | |
---|
51 | d = dl_o2_func3 (0.778899); |
---|
52 | (void) d; |
---|
53 | |
---|
54 | |
---|
55 | return argc; |
---|
56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.