MCPcopy Create free account
hub / github.com/F-Stack/f-stack / check_function_ptrs

Function check_function_ptrs

dpdk/app/test/test_power.c:27–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#include <rte_power.h>
26
27static int
28check_function_ptrs(void)
29{
30 enum power_management_env env = rte_power_get_env();
31
32 const bool not_null_expected = !(env == PM_ENV_NOT_SET);
33
34 const char *inject_not_string1 = not_null_expected ? " not" : "";
35 const char *inject_not_string2 = not_null_expected ? "" : " not";
36
37 if ((rte_power_freqs == NULL) == not_null_expected) {
38 printf("rte_power_freqs should%s be NULL, environment has%s been "
39 "initialised\n", inject_not_string1,
40 inject_not_string2);
41 return -1;
42 }
43 if ((rte_power_get_freq == NULL) == not_null_expected) {
44 printf("rte_power_get_freq should%s be NULL, environment has%s been "
45 "initialised\n", inject_not_string1,
46 inject_not_string2);
47 return -1;
48 }
49 if ((rte_power_set_freq == NULL) == not_null_expected) {
50 printf("rte_power_set_freq should%s be NULL, environment has%s been "
51 "initialised\n", inject_not_string1,
52 inject_not_string2);
53 return -1;
54 }
55 if ((rte_power_freq_up == NULL) == not_null_expected) {
56 printf("rte_power_freq_up should%s be NULL, environment has%s been "
57 "initialised\n", inject_not_string1,
58 inject_not_string2);
59 return -1;
60 }
61 if ((rte_power_freq_down == NULL) == not_null_expected) {
62 printf("rte_power_freq_down should%s be NULL, environment has%s been "
63 "initialised\n", inject_not_string1,
64 inject_not_string2);
65 return -1;
66 }
67 if ((rte_power_freq_max == NULL) == not_null_expected) {
68 printf("rte_power_freq_max should%s be NULL, environment has%s been "
69 "initialised\n", inject_not_string1,
70 inject_not_string2);
71 return -1;
72 }
73 if ((rte_power_freq_min == NULL) == not_null_expected) {
74 printf("rte_power_freq_min should%s be NULL, environment has%s been "
75 "initialised\n", inject_not_string1,
76 inject_not_string2);
77 return -1;
78 }
79 if ((rte_power_turbo_status == NULL) == not_null_expected) {
80 printf("rte_power_turbo_status should%s be NULL, environment has%s been "
81 "initialised\n", inject_not_string1,
82 inject_not_string2);
83 return -1;
84 }

Callers 1

test_powerFunction · 0.85

Calls 2

rte_power_get_envFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected