Lines Matching refs:rd
48 mbedtls_mps_reader rd;
54 mbedtls_mps_reader_init( &rd, NULL, 0 );
56 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
57 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
60 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) == 0 );
62 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
64 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, &paused ) == 0 );
66 mbedtls_mps_reader_free( &rd );
91 mbedtls_mps_reader rd;
99 mbedtls_mps_reader_init( &rd, NULL, 0 );
101 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
102 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
105 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) == 0 );
107 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
109 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
110 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB, sizeof( bufB ) ) == 0 );
112 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) == 0 );
114 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
116 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
117 mbedtls_mps_reader_free( &rd );
146 mbedtls_mps_reader rd;
152 mbedtls_mps_reader_init( &rd, NULL, 0 );
154 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
155 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
157 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
159 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 70, &tmp, NULL ) == 0 );
161 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 30, &tmp, &tmp_len ) == 0 );
163 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
165 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
166 mbedtls_mps_reader_free( &rd );
181 mbedtls_mps_reader rd;
189 mbedtls_mps_reader_init( &rd, NULL, 0 );
191 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
192 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
194 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
196 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 70, &tmp, NULL ) == 0 );
198 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 30, &tmp, &tmp_len ) == 0 );
200 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
202 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
203 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB, sizeof( bufB ) ) == 0 );
205 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) == 0 );
207 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
209 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
210 mbedtls_mps_reader_free( &rd );
226 mbedtls_mps_reader rd;
231 mbedtls_mps_reader_init( &rd, NULL, 0 );
232 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
234 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
236 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
237 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) ==
240 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
242 mbedtls_mps_reader_free( &rd );
264 mbedtls_mps_reader rd;
271 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
272 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
274 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
276 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
277 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
279 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) ==
282 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
285 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, &tmp_len ) == 0 );
288 mbedtls_mps_reader_free( &rd );
305 mbedtls_mps_reader rd;
311 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
312 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
314 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
317 TEST_ASSERT( mbedtls_mps_reader_get( &rd, (mbedtls_mps_size_t) -1, &tmp, NULL ) ==
320 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
323 mbedtls_mps_reader_free( &rd );
351 mbedtls_mps_reader rd;
358 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
359 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
363 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 80, &tmp, NULL ) == 0 );
365 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
366 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
372 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
377 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) ==
381 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, &paused ) == 0 );
383 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB, sizeof( bufB ) ) == 0 );
389 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
392 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
396 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
402 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
404 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
410 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
412 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
413 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
419 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
421 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
424 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
428 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
430 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
431 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
434 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
442 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 90, &tmp, NULL ) == 0 );
444 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
447 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
448 mbedtls_mps_reader_free( &rd );
472 mbedtls_mps_reader rd;
480 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
481 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
485 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 80, &tmp, NULL ) == 0 );
487 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
489 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 70, &tmp, NULL ) ==
493 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
497 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB, 10 ) ==
499 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB + 10, 10 ) ==
501 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB + 20, 80 ) == 0 );
507 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB + num_feed, 1 ) ==
510 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB + 49, 1 ) == 0 );
516 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB + num_feed, 1 ) ==
519 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB + 49, 51 ) == 0 );
528 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 70, &tmp, NULL ) == 0 );
531 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 1000, &tmp, &fetch_len ) == 0 );
550 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
553 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
554 mbedtls_mps_reader_free( &rd );
568 mbedtls_mps_reader rd;
573 mbedtls_mps_reader_init( &rd, NULL, 0 );
574 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
581 TEST_ASSERT( mbedtls_mps_reader_get( &rd, sizeof( buf ), &tmp, NULL )
588 TEST_ASSERT( mbedtls_mps_reader_get( &rd, sizeof( buf ) / 2,
596 TEST_ASSERT( mbedtls_mps_reader_get( &rd, sizeof( buf ) / 2,
599 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
600 TEST_ASSERT( mbedtls_mps_reader_get( &rd, sizeof( buf ) / 2,
613 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
615 mbedtls_mps_reader_free( &rd );
627 mbedtls_mps_reader rd;
633 mbedtls_mps_reader_init( &rd, NULL, 0 );
634 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
636 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
638 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
639 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
642 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
645 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
647 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
649 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
650 mbedtls_mps_reader_free( &rd );
672 mbedtls_mps_reader rd;
681 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
682 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
686 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 80, &tmp, NULL ) == 0 );
688 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
689 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
691 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) ==
695 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
696 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB, sizeof( bufB ) ) == 0 );
705 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, &tmp_len ) == 0 );
707 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
710 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
711 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) ==
715 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
716 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufC, sizeof( bufC ) ) == 0 );;
719 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
727 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
729 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
732 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
733 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 51, &tmp, NULL ) ==
737 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
744 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
746 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
749 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) ==
753 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
754 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufC, sizeof( bufC ) ) == 0 );;
757 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 50, &tmp, NULL ) == 0 );
766 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
768 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) == 0 );
771 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 21, &tmp, NULL ) ==
775 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) ==
784 mbedtls_mps_reader_free( &rd );
830 mbedtls_mps_reader rd;
844 mbedtls_mps_reader_init( &rd, acc, acc_size );
860 ret = mbedtls_mps_reader_reclaim( &rd, NULL );
882 ret = mbedtls_mps_reader_feed( &rd, tmp, tmp_size );
923 ret = mbedtls_mps_reader_get( &rd, get_size, &chunk_get,
929 ret = mbedtls_mps_reader_get( &rd, get_size, &chunk_get, NULL );
945 ret = mbedtls_mps_reader_commit( &rd );
963 mbedtls_mps_reader_free( &rd );
990 mbedtls_mps_reader rd;
998 mbedtls_mps_reader_init( &rd, acc, sizeof( acc ) );
999 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufA, sizeof( bufA ) ) == 0 );
1001 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 80, &tmp, NULL ) == 0 );
1002 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1003 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) == 0 );
1004 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 20, &tmp, NULL ) ==
1007 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
1008 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, bufB, sizeof( bufB ) ) == 0 );
1014 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 30, &tmp, NULL ) == 0 );
1022 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 30, &tmp, NULL ) == 0 );
1025 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1031 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 31, &tmp, NULL ) ==
1037 TEST_ASSERT( mbedtls_mps_reader_get( &rd, (mbedtls_mps_size_t) -1, &tmp, NULL ) ==
1044 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1046 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 10, &tmp, NULL ) ==
1053 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1055 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1064 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1066 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1067 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1076 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1078 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1081 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1088 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1090 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 15, &tmp, NULL ) == 0 );
1091 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1094 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1106 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 90, &tmp, NULL ) == 0 );
1108 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1111 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
1115 mbedtls_mps_reader_free( &rd );
1126 mbedtls_mps_reader rd;
1131 mbedtls_mps_reader_init( &rd, NULL, 0 );
1133 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, NULL, sizeof( buf ) ) ==
1137 TEST_ASSERT( mbedtls_mps_reader_feed( &rd, buf, sizeof( buf ) ) == 0 );
1140 TEST_ASSERT( mbedtls_mps_reader_get( &rd, 100, &tmp, NULL ) == 0 );
1142 TEST_ASSERT( mbedtls_mps_reader_commit( &rd ) == 0 );
1145 TEST_ASSERT( mbedtls_mps_reader_reclaim( &rd, NULL ) == 0 );
1146 mbedtls_mps_reader_free( &rd );