Lines Matching refs:apdu
31 const CommandApdu apdu{1, 2, 3, 4}; in TEST() local
33 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
34 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
38 const CommandApdu apdu{4, 3, 2, 1, 0, 3}; in TEST() local
40 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
41 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
45 const CommandApdu apdu{4, 3, 2, 1, 0, 256}; in TEST() local
47 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
48 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
52 const CommandApdu apdu{5, 6, 7, 8, 0, 258}; in TEST() local
54 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
55 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
59 const CommandApdu apdu{5, 6, 7, 8, 0, 65536}; in TEST() local
61 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
62 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
66 const CommandApdu apdu{8, 7, 6, 5, 5, 0}; in TEST() local
68 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
69 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
73 CommandApdu apdu{8, 7, 6, 5, 3, 0}; in TEST() local
74 auto it = apdu.dataBegin(); in TEST()
78 ASSERT_EQ(apdu.dataEnd(), it); in TEST()
81 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
82 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
86 const CommandApdu apdu{8, 7, 6, 5, 256, 0}; in TEST() local
89 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
90 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
94 CommandApdu apdu{8, 7, 6, 5, 65535, 0}; in TEST() local
95 ASSERT_EQ(size_t{65535}, apdu.dataSize()); in TEST()
96 std::fill(apdu.dataBegin(), apdu.dataEnd(), 7); in TEST()
99 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
100 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
104 const CommandApdu apdu{1, 3, 5, 7, 2, 3}; in TEST() local
106 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
107 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
111 CommandApdu apdu{1, 3, 5, 7, 1, 90}; in TEST() local
112 auto it = apdu.dataBegin(); in TEST()
114 ASSERT_EQ(apdu.dataEnd(), it); in TEST()
117 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
118 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
122 const CommandApdu apdu{1, 3, 5, 7, 2, 256}; in TEST() local
124 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
125 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
129 const CommandApdu apdu{1, 3, 5, 7, 527, 349}; in TEST() local
134 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
135 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
139 const CommandApdu apdu{1, 3, 5, 7, 20, 65536}; in TEST() local
144 ASSERT_EQ(expected.size(), apdu.size()); in TEST()
145 ASSERT_TRUE(std::equal(apdu.begin(), apdu.end(), expected.begin(), expected.end())); in TEST()
152 const ResponseApdu<std::vector<uint8_t>> apdu{empty}; in TEST() local
153 ASSERT_FALSE(apdu.ok()); in TEST()
158 const ResponseApdu<std::vector<uint8_t>> apdu{statusOnly}; in TEST() local
159 ASSERT_TRUE(apdu.ok()); in TEST()
160 ASSERT_EQ(0x90, apdu.sw1()); in TEST()
161 ASSERT_EQ(0x37, apdu.sw2()); in TEST()
162 ASSERT_EQ(0x9037, apdu.status()); in TEST()
163 ASSERT_EQ(size_t{0}, apdu.dataSize()); in TEST()
168 const ResponseApdu<std::vector<uint8_t>> apdu{data}; in TEST() local
169 ASSERT_TRUE(apdu.ok()); in TEST()
170 ASSERT_EQ(0x3abc, apdu.status()); in TEST()
171 ASSERT_EQ(size_t{6}, apdu.dataSize()); in TEST()
174 ASSERT_TRUE(std::equal(apdu.dataBegin(), apdu.dataEnd(), in TEST()
180 const ResponseApdu<std::vector<uint8_t>> apdu{remainingBytes}; in TEST() local
181 ASSERT_EQ(23, apdu.remainingBytes()); in TEST()
182 ASSERT_FALSE(apdu.isWarning()); in TEST()
183 ASSERT_FALSE(apdu.isExecutionError()); in TEST()
184 ASSERT_FALSE(apdu.isCheckingError()); in TEST()
185 ASSERT_FALSE(apdu.isError()); in TEST()
190 const ResponseApdu<std::vector<uint8_t>> apdu{warning}; in TEST() local
191 ASSERT_TRUE(apdu.isWarning()); in TEST()
192 ASSERT_FALSE(apdu.isExecutionError()); in TEST()
193 ASSERT_FALSE(apdu.isCheckingError()); in TEST()
194 ASSERT_FALSE(apdu.isError()); in TEST()
199 const ResponseApdu<std::vector<uint8_t>> apdu{executionError}; in TEST() local
200 ASSERT_FALSE(apdu.isWarning()); in TEST()
201 ASSERT_TRUE(apdu.isExecutionError()); in TEST()
202 ASSERT_FALSE(apdu.isCheckingError()); in TEST()
203 ASSERT_TRUE(apdu.isError()); in TEST()
208 const ResponseApdu<std::vector<uint8_t>> apdu{checkingError}; in TEST() local
209 ASSERT_FALSE(apdu.isWarning()); in TEST()
210 ASSERT_FALSE(apdu.isExecutionError()); in TEST()
211 ASSERT_TRUE(apdu.isCheckingError()); in TEST()
212 ASSERT_TRUE(apdu.isError()); in TEST()