Branch data Line data Source code
1 : : #include "test_libmem_all.h"
2 : : #include "sha512.h"
3 : :
4 : : /**
5 : : * @brief Random-size bounded-buffer import for unsigned long long int descriptors
6 : : *
7 : : * @return Return describing success or failure
8 : : */
9 : 1 : static Return test_libmem_0005_1(void)
10 : : {
11 : 1 : INITTEST;
12 : :
13 : : #define TYPE unsigned long long int
14 : : #include "test_libmem_0005.tpl"
15 : : #undef TYPE
16 : :
17 : 1 : RETURN_STATUS;
18 : : }
19 : :
20 : : /**
21 : : * @brief Random-size bounded-buffer import for char descriptors
22 : : *
23 : : * @return Return describing success or failure
24 : : */
25 : 1 : static Return test_libmem_0005_2(void)
26 : : {
27 : 1 : INITTEST;
28 : :
29 : : #define TYPE char
30 : : #include "test_libmem_0005.tpl"
31 : : #undef TYPE
32 : :
33 : 1 : RETURN_STATUS;
34 : : }
35 : :
36 : : /**
37 : : * @brief Random-size bounded-buffer import for int descriptors
38 : : *
39 : : * @return Return describing success or failure
40 : : */
41 : 1 : static Return test_libmem_0005_3(void)
42 : : {
43 : 1 : INITTEST;
44 : :
45 : : #define TYPE int
46 : : #include "test_libmem_0005.tpl"
47 : : #undef TYPE
48 : :
49 : 1 : RETURN_STATUS;
50 : : }
51 : :
52 : : /**
53 : : * @brief Random-size bounded-buffer import for unsigned char descriptors
54 : : *
55 : : * @return Return describing success or failure
56 : : */
57 : 1 : static Return test_libmem_0005_4(void)
58 : : {
59 : 1 : INITTEST;
60 : :
61 : : #define TYPE unsigned char
62 : : #include "test_libmem_0005.tpl"
63 : : #undef TYPE
64 : :
65 : 1 : RETURN_STATUS;
66 : : }
67 : :
68 : : /**
69 : : * @brief Run random-size bounded-buffer import coverage across repeated element types
70 : : *
71 : : * The suite verifies unsigned long long int, char, int, and unsigned char
72 : : * descriptors with the same SHA-512-backed import template. Each subtest uses
73 : : * a fixed-capacity stack source buffer, selects random payload byte ranges,
74 : : * imports each range through m_copy_buffer(...), hashes the resulting
75 : : * descriptor view, and compares it with the original source digest
76 : : *
77 : : * @return Return describing success or failure
78 : : */
79 : 1 : Return test_libmem_0005(void)
80 : : {
81 : 1 : INITTEST;
82 : :
83 : 1 : SLOWTEST;
84 : :
85 : 1 : TEST(test_libmem_0005_1,"Random-size unsigned long long int bounded-buffer import");
86 : 1 : TEST(test_libmem_0005_2,"Random-size char bounded-buffer import");
87 : 1 : TEST(test_libmem_0005_3,"Random-size int bounded-buffer import");
88 : 1 : TEST(test_libmem_0005_4,"Random-size unsigned char bounded-buffer import");
89 : :
90 : 1 : RETURN_STATUS;
91 : : }
|