1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "scp_unity.h"
9 #include "unity.h"
10 
11 #ifdef TEST_ON_TARGET
12 #    include <fwk_id.h>
13 #    include <fwk_module.h>
14 #else
15 #    include <Mockfwk_id.h>
16 #    include <Mockfwk_module.h>
17 
18 #    include <internal/Mockfwk_core_internal.h>
19 #endif
20 
21 #include <fwk_element.h>
22 #include <fwk_macros.h>
23 
24 #include UNIT_TEST_SRC
25 
setUp(void)26 void setUp(void)
27 {
28 }
29 
tearDown(void)30 void tearDown(void)
31 {
32 }
33 
utest_dvfs_count_opps(void)34 void utest_dvfs_count_opps(void)
35 {
36     size_t expected_opps_elements = 1;
37     size_t opps_count;
38 
39     struct mod_dvfs_opp opps[2] = {
40         {
41             .level = 1,
42             .voltage = 2,
43             .frequency = 3,
44             .power = 4,
45         },
46         { 0 },
47     };
48 
49     opps_count = count_opps(&opps[0]);
50 
51     TEST_ASSERT_EQUAL(expected_opps_elements, opps_count);
52 }
53 
utest_dvfs_get_domain_ctx(void)54 void utest_dvfs_get_domain_ctx(void)
55 {
56     fwk_id_t dvfs_id = { 0 };
57     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
58     struct mod_dvfs_domain_ctx *return_ctx;
59 
60     dvfs_ctx.dvfs_domain_element_count = 1;
61 
62     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
63 
64     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
65 
66     return_ctx = get_domain_ctx(dvfs_id);
67 
68     TEST_ASSERT_EQUAL(&dvfs_domain_ctx[0], return_ctx);
69 }
70 
utest_dvfs_get_domain_ctx_invalid_domain_id(void)71 void utest_dvfs_get_domain_ctx_invalid_domain_id(void)
72 {
73     fwk_id_t dvfs_id;
74     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
75     struct mod_dvfs_domain_ctx *return_ctx;
76 
77     dvfs_ctx.dvfs_domain_element_count = 1;
78 
79     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
80 
81     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 2);
82 
83     return_ctx = get_domain_ctx(dvfs_id);
84 
85     TEST_ASSERT_EQUAL(NULL, return_ctx);
86 }
87 
utest_dvfs_get_opp_for_level_with_existing_level(void)88 void utest_dvfs_get_opp_for_level_with_existing_level(void)
89 {
90     struct mod_dvfs_domain_config config;
91     struct mod_dvfs_opp opps;
92     struct mod_dvfs_domain_ctx dvfs_domain_ctx = {
93         .opp_count = 1,
94     };
95     const struct mod_dvfs_opp *return_opp;
96 
97     uint32_t level = 50;
98 
99     opps.level = 50;
100     config.opps = &opps;
101     dvfs_domain_ctx.config = &config;
102 
103     return_opp = get_opp_for_level(&dvfs_domain_ctx, level);
104     TEST_ASSERT_EQUAL(&opps, return_opp);
105 }
106 
utest_dvfs_get_opp_for_level_with_non_existing_level(void)107 void utest_dvfs_get_opp_for_level_with_non_existing_level(void)
108 {
109     struct mod_dvfs_domain_config config;
110     struct mod_dvfs_opp opps;
111     struct mod_dvfs_domain_ctx dvfs_domain_ctx = {
112         .opp_count = 1,
113     };
114 
115     const struct mod_dvfs_opp *return_opp;
116 
117     uint32_t level = 30;
118 
119     opps.level = 50;
120     config.opps = &opps;
121     dvfs_domain_ctx.config = &config;
122 
123     return_opp = get_opp_for_level(&dvfs_domain_ctx, level);
124 
125     TEST_ASSERT_EQUAL(NULL, return_opp);
126 }
127 
utest_dvfs_get_opp_for_voltage_with_existing_voltage(void)128 void utest_dvfs_get_opp_for_voltage_with_existing_voltage(void)
129 {
130     struct mod_dvfs_domain_config config;
131     struct mod_dvfs_opp opps;
132     struct mod_dvfs_domain_ctx dvfs_domain_ctx = {
133         .opp_count = 1,
134     };
135 
136     const struct mod_dvfs_opp *return_opp;
137 
138     uint32_t voltage = 50;
139 
140     opps.voltage = 50;
141     config.opps = &opps;
142     dvfs_domain_ctx.config = &config;
143 
144     return_opp = get_opp_for_voltage(&dvfs_domain_ctx, voltage);
145 
146     TEST_ASSERT_EQUAL(&opps, return_opp);
147 }
148 
utest_dvfs_get_opp_for_voltage_with_none_existing_voltage(void)149 void utest_dvfs_get_opp_for_voltage_with_none_existing_voltage(void)
150 {
151     struct mod_dvfs_domain_config config;
152     struct mod_dvfs_opp opps;
153     struct mod_dvfs_domain_ctx dvfs_domain_ctx = {
154         .opp_count = 1,
155     };
156 
157     const struct mod_dvfs_opp *return_opp;
158 
159     uint32_t voltage = 30;
160 
161     opps.voltage = 50;
162     config.opps = &opps;
163     dvfs_domain_ctx.config = &config;
164 
165     return_opp = get_opp_for_voltage(&dvfs_domain_ctx, voltage);
166 
167     TEST_ASSERT_EQUAL(NULL, return_opp);
168 }
169 
utest_dvfs_cleanup_request(void)170 void utest_dvfs_cleanup_request(void)
171 {
172     /* Initiate ctx with random values in random chosen fields */
173     struct mod_dvfs_domain_ctx ctx = {
174             .pending_request = {
175                 .new_opp.level = 20,
176             },
177             .request = {
178                 .new_opp.voltage = 30,
179             },
180             .state = DVFS_DOMAIN_GET_OPP,
181         };
182 
183     dvfs_cleanup_request(&ctx);
184 
185     TEST_ASSERT_EQUAL(0, ctx.pending_request.new_opp.level);
186     TEST_ASSERT_EQUAL(0, ctx.request.new_opp.voltage);
187     TEST_ASSERT_EQUAL(DVFS_DOMAIN_STATE_IDLE, ctx.state);
188 }
189 
utest_dvfs_get_sustained_opp_invalid_domain_id(void)190 void utest_dvfs_get_sustained_opp_invalid_domain_id(void)
191 {
192     fwk_id_t dvfs_id;
193     struct mod_dvfs_opp sustained_opp;
194     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
195     struct mod_dvfs_domain_config config;
196     int return_sustained_opp_status;
197 
198     /* configured to call get_domain_id and return sustained_idx */
199     dvfs_ctx.dvfs_domain_element_count = 1;
200 
201     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
202 
203     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 2);
204 
205     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
206     dvfs_domain_ctx[0].opp_count = 0;
207 
208     dvfs_domain_ctx[0].config = &config;
209 
210     return_sustained_opp_status =
211         dvfs_get_sustained_opp(dvfs_id, &sustained_opp);
212 
213     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_sustained_opp_status);
214 }
215 
utest_dvfs_get_sustained_opp_sustained_idx_greater_opp_count(void)216 void utest_dvfs_get_sustained_opp_sustained_idx_greater_opp_count(void)
217 {
218     fwk_id_t dvfs_id;
219     struct mod_dvfs_opp sustained_opp;
220     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
221     struct mod_dvfs_domain_config config;
222     int return_sustained_opp_status;
223 
224     /* configured to call get_domain_id and return sustained_idx */
225     dvfs_ctx.dvfs_domain_element_count = 1;
226 
227     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
228 
229     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
230 
231     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
232     dvfs_domain_ctx[0].opp_count = 0;
233     config.sustained_idx = 1;
234 
235     dvfs_domain_ctx[0].config = &config;
236 
237     return_sustained_opp_status =
238         dvfs_get_sustained_opp(dvfs_id, &sustained_opp);
239 
240     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_sustained_opp_status);
241 }
242 
utest_dvfs_get_sustained_opp_valid_domain_and_sustained_idx(void)243 void utest_dvfs_get_sustained_opp_valid_domain_and_sustained_idx(void)
244 {
245     fwk_id_t dvfs_id;
246     struct mod_dvfs_opp sustained_opp;
247     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
248     struct mod_dvfs_domain_config config;
249     struct mod_dvfs_opp opps[2];
250     int return_sustained_opp_status;
251 
252     /* configured to call get_domain_id and return sustained_idx */
253     dvfs_ctx.dvfs_domain_element_count = 1;
254 
255     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
256 
257     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
258 
259     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
260     dvfs_domain_ctx[0].opp_count = 1;
261     config.sustained_idx = 0;
262     config.opps = &opps[0];
263 
264     opps[0].level = 11;
265     opps[0].voltage = 22;
266     opps[0].frequency = 33;
267     opps[0].power = 44;
268 
269     dvfs_domain_ctx[0].config = &config;
270 
271     return_sustained_opp_status =
272         dvfs_get_sustained_opp(dvfs_id, &sustained_opp);
273 
274     TEST_ASSERT_EQUAL(FWK_SUCCESS, return_sustained_opp_status);
275 
276     TEST_ASSERT_EQUAL(sustained_opp.level, 11);
277     TEST_ASSERT_EQUAL(sustained_opp.voltage, 22);
278     TEST_ASSERT_EQUAL(sustained_opp.frequency, 33);
279     TEST_ASSERT_EQUAL(sustained_opp.power, 44);
280 }
281 
utest_dvfs_get_nth_opp_null_opp_pointer(void)282 void utest_dvfs_get_nth_opp_null_opp_pointer(void)
283 {
284     fwk_id_t dvfs_id;
285     /* The index has no effect */
286     size_t index = 9;
287     int return_nth_opp;
288 
289     return_nth_opp = dvfs_get_nth_opp(dvfs_id, index, NULL);
290 
291     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_nth_opp);
292 }
293 
utest_dvfs_get_nth_opp_invalid_dvfs_id(void)294 void utest_dvfs_get_nth_opp_invalid_dvfs_id(void)
295 {
296     fwk_id_t dvfs_id;
297     struct mod_dvfs_opp sustained_opp;
298     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
299     struct mod_dvfs_domain_config config;
300     int return_nth_opp;
301 
302     /* The index has no effect */
303     size_t index = 4;
304 
305     /* configured to call get_domain_id and return sustained_idx */
306     dvfs_ctx.dvfs_domain_element_count = 1;
307 
308     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
309 
310     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 2);
311 
312     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
313     dvfs_domain_ctx[0].opp_count = 0;
314     config.sustained_idx = 1;
315 
316     dvfs_domain_ctx[0].config = &config;
317 
318     return_nth_opp = dvfs_get_nth_opp(dvfs_id, index, &sustained_opp);
319 
320     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_nth_opp);
321 }
322 
utest_dvfs_get_nth_opp_index_greater_than_opp_count(void)323 void utest_dvfs_get_nth_opp_index_greater_than_opp_count(void)
324 {
325     fwk_id_t dvfs_id;
326     struct mod_dvfs_opp sustained_opp;
327     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
328     struct mod_dvfs_domain_config config;
329     struct mod_dvfs_opp opps[2];
330     int return_nth_opp;
331 
332     size_t index = 1;
333 
334     /* configured to call get_domain_id and return sustained_idx */
335     dvfs_ctx.dvfs_domain_element_count = 1;
336 
337     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
338 
339     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
340 
341     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
342     dvfs_domain_ctx[0].opp_count = 1;
343     config.sustained_idx = 0;
344     config.opps = &opps[0];
345 
346     dvfs_domain_ctx[0].config = &config;
347 
348     return_nth_opp = dvfs_get_nth_opp(dvfs_id, index, &sustained_opp);
349 
350     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_nth_opp);
351 }
352 
utest_dvfs_get_nth_opp(void)353 void utest_dvfs_get_nth_opp(void)
354 {
355     fwk_id_t dvfs_id;
356     struct mod_dvfs_opp sustained_opp;
357     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
358     struct mod_dvfs_domain_config config;
359     struct mod_dvfs_opp opps[2];
360     int return_nth_opp;
361 
362     size_t index = 0;
363 
364     /* configured to call get_domain_id and return sustained_idx */
365     dvfs_ctx.dvfs_domain_element_count = 1;
366 
367     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
368 
369     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
370 
371     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
372     dvfs_domain_ctx[0].opp_count = 1;
373     config.sustained_idx = 0;
374     config.opps = &opps[0];
375 
376     opps[0].level = 11;
377     opps[0].voltage = 22;
378     opps[0].frequency = 33;
379     opps[0].power = 44;
380 
381     dvfs_domain_ctx[0].config = &config;
382 
383     return_nth_opp = dvfs_get_nth_opp(dvfs_id, index, &sustained_opp);
384 
385     TEST_ASSERT_EQUAL(FWK_SUCCESS, return_nth_opp);
386 
387     TEST_ASSERT_EQUAL(sustained_opp.level, 11);
388     TEST_ASSERT_EQUAL(sustained_opp.voltage, 22);
389     TEST_ASSERT_EQUAL(sustained_opp.frequency, 33);
390     TEST_ASSERT_EQUAL(sustained_opp.power, 44);
391 }
392 
utest_dvfs_get_level_id_invalid_dvfs_id(void)393 void utest_dvfs_get_level_id_invalid_dvfs_id(void)
394 {
395     fwk_id_t dvfs_id;
396     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
397     int return_level_id;
398 
399     uint32_t level = 1;
400     size_t level_id = 2;
401 
402     dvfs_ctx.dvfs_domain_element_count = 1;
403 
404     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
405 
406     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 2);
407 
408     return_level_id = dvfs_get_level_id(dvfs_id, level, &level_id);
409 
410     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_level_id);
411 }
412 
utest_dvfs_get_level_id_opp_level_matches_level(void)413 void utest_dvfs_get_level_id_opp_level_matches_level(void)
414 {
415     fwk_id_t dvfs_id;
416     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
417     struct mod_dvfs_domain_config config;
418     struct mod_dvfs_opp opps[2];
419     int return_level_id;
420 
421     uint32_t level = 1;
422     size_t level_id = 2;
423 
424     /* configured to call get_domain_id and return sustained_idx */
425     dvfs_ctx.dvfs_domain_element_count = 1;
426 
427     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
428 
429     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
430 
431     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
432     dvfs_domain_ctx[0].opp_count = 1;
433 
434     /* set the opp.level equal to the passed level to enforce the code
435      * to return FWK_SUCCESS
436      */
437     opps[0].level = level;
438     config.opps = &opps[0];
439 
440     dvfs_domain_ctx[0].config = &config;
441 
442     return_level_id = dvfs_get_level_id(dvfs_id, level, &level_id);
443 
444     TEST_ASSERT_EQUAL(FWK_SUCCESS, return_level_id);
445     TEST_ASSERT_EQUAL(0, level_id);
446 }
447 
utest_dvfs_get_level_id_level_not_found(void)448 void utest_dvfs_get_level_id_level_not_found(void)
449 {
450     fwk_id_t dvfs_id;
451     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
452     struct mod_dvfs_domain_config config;
453     struct mod_dvfs_opp opps[2];
454     int return_level_id;
455 
456     uint32_t level = 1;
457     size_t level_id = 2;
458 
459     /* configured to call get_domain_id and return sustained_idx */
460     dvfs_ctx.dvfs_domain_element_count = 1;
461 
462     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
463 
464     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
465 
466     /* set opp_count less than sustained_idx to return FWK_E_PARAM */
467     dvfs_domain_ctx[0].opp_count = 1;
468 
469     /* set the opp.level equal to the passed level to enforce the code
470      * to return FWK_SUCCESS
471      */
472     opps[0].level = 3;
473     config.opps = &opps[0];
474 
475     dvfs_domain_ctx[0].config = &config;
476 
477     return_level_id = dvfs_get_level_id(dvfs_id, level, &level_id);
478     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_level_id);
479 }
480 
utest_dvfs_get_opp_count_null_opp_count(void)481 void utest_dvfs_get_opp_count_null_opp_count(void)
482 {
483     fwk_id_t dvfs_id;
484     int return_opp_count;
485 
486     return_opp_count = dvfs_get_opp_count(dvfs_id, NULL);
487 
488     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_opp_count);
489 }
490 
utest_dvfs_get_opp_count_invalid_dvfs_id(void)491 void utest_dvfs_get_opp_count_invalid_dvfs_id(void)
492 {
493     fwk_id_t dvfs_id;
494     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
495     int return_opp_count;
496 
497     dvfs_ctx.dvfs_domain_element_count = 1;
498 
499     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
500     size_t opp_count;
501 
502     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 2);
503 
504     return_opp_count = dvfs_get_opp_count(dvfs_id, &opp_count);
505 
506     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_opp_count);
507 }
508 
utest_dvfs_get_opp_count(void)509 void utest_dvfs_get_opp_count(void)
510 {
511     fwk_id_t dvfs_id;
512     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
513     size_t opp_count = 1;
514     int return_opp_count;
515 
516     dvfs_ctx.dvfs_domain_element_count = 1;
517 
518     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
519 
520     dvfs_domain_ctx[0].opp_count = 3;
521 
522     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
523 
524     return_opp_count = dvfs_get_opp_count(dvfs_id, &opp_count);
525 
526     TEST_ASSERT_EQUAL(FWK_SUCCESS, return_opp_count);
527     TEST_ASSERT_EQUAL(3, opp_count);
528 }
529 
utest_dvfs_get_latency_null_latency(void)530 void utest_dvfs_get_latency_null_latency(void)
531 {
532     fwk_id_t dvfs_id;
533     int return_latency;
534 
535     return_latency = dvfs_get_latency(dvfs_id, NULL);
536 
537     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_latency);
538 }
539 
utest_dvfs_get_latency_invalid_dvfs_id(void)540 void utest_dvfs_get_latency_invalid_dvfs_id(void)
541 {
542     fwk_id_t dvfs_id;
543     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
544     int return_latency;
545 
546     dvfs_ctx.dvfs_domain_element_count = 1;
547 
548     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
549     uint16_t latency;
550 
551     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 2);
552 
553     return_latency = dvfs_get_latency(dvfs_id, &latency);
554 
555     TEST_ASSERT_EQUAL(FWK_E_PARAM, return_latency);
556 }
557 
utest_dvfs_get_latency(void)558 void utest_dvfs_get_latency(void)
559 {
560     fwk_id_t dvfs_id;
561     struct mod_dvfs_domain_ctx dvfs_domain_ctx[1];
562     struct mod_dvfs_domain_config config;
563     int return_latency;
564     uint16_t latency = 6;
565 
566     dvfs_ctx.dvfs_domain_element_count = 1;
567 
568     dvfs_ctx.domain_ctx = &dvfs_domain_ctx;
569 
570     config.latency = 3;
571     dvfs_domain_ctx[0].config = &config;
572 
573     fwk_id_get_element_idx_ExpectAndReturn(dvfs_id, 0);
574 
575     return_latency = dvfs_get_latency(dvfs_id, &latency);
576 
577     TEST_ASSERT_EQUAL(FWK_SUCCESS, return_latency);
578     TEST_ASSERT_EQUAL(3, latency);
579 }
580 
dvfs_test_main(void)581 int dvfs_test_main(void)
582 {
583     UNITY_BEGIN();
584 
585     RUN_TEST(utest_dvfs_count_opps);
586 
587     RUN_TEST(utest_dvfs_get_domain_ctx);
588     RUN_TEST(utest_dvfs_get_domain_ctx_invalid_domain_id);
589 
590     RUN_TEST(utest_dvfs_get_opp_for_level_with_existing_level);
591     RUN_TEST(utest_dvfs_get_opp_for_level_with_non_existing_level);
592 
593     RUN_TEST(utest_dvfs_get_opp_for_voltage_with_existing_voltage);
594     RUN_TEST(utest_dvfs_get_opp_for_voltage_with_none_existing_voltage);
595 
596     RUN_TEST(utest_dvfs_cleanup_request);
597 
598     RUN_TEST(utest_dvfs_get_sustained_opp_invalid_domain_id);
599     RUN_TEST(utest_dvfs_get_sustained_opp_valid_domain_and_sustained_idx);
600     RUN_TEST(utest_dvfs_get_sustained_opp_sustained_idx_greater_opp_count);
601 
602     RUN_TEST(utest_dvfs_get_nth_opp_null_opp_pointer);
603     RUN_TEST(utest_dvfs_get_nth_opp);
604     RUN_TEST(utest_dvfs_get_nth_opp_invalid_dvfs_id);
605     RUN_TEST(utest_dvfs_get_nth_opp_index_greater_than_opp_count);
606 
607     RUN_TEST(utest_dvfs_get_level_id_invalid_dvfs_id);
608     RUN_TEST(utest_dvfs_get_level_id_opp_level_matches_level);
609     RUN_TEST(utest_dvfs_get_level_id_level_not_found);
610 
611     RUN_TEST(utest_dvfs_get_opp_count_null_opp_count);
612     RUN_TEST(utest_dvfs_get_opp_count_invalid_dvfs_id);
613     RUN_TEST(utest_dvfs_get_opp_count);
614 
615     RUN_TEST(utest_dvfs_get_latency_null_latency);
616     RUN_TEST(utest_dvfs_get_latency_invalid_dvfs_id);
617     RUN_TEST(utest_dvfs_get_latency);
618 
619     return UNITY_END();
620 }
621 
622 #if !defined(TEST_ON_TARGET)
main(void)623 int main(void)
624 {
625     return dvfs_test_main();
626 }
627 #endif
628