Branch Coverage

/usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux/XS/libpanda.x/i/panda/basic_string.h
Criterion Covered Total %
branch 6 92 6.5


line true false branch
103 0 0 if (!mem) throw std::bad_alloc();
863 48 0 if (str._length) { // can't call append(const CharT*, size_type) because otherwise if &str == this a fuckup would occur
884 0 0 if (count) {
965 0 24 if (pos >= _length) {
966 0 0 if (pos == _length) return append(s, count);
967 0 0 throw std::out_of_range("basic_string::insert");
969 0 24 if (count == 0) return *this;
1161 0 0 if (capacity <= MAX_SSO_CHARS) {
1165 0 0 if (capacity > MAX_SIZE) throw std::length_error("basic_string::_new_auto");
0 0 if (capacity > MAX_SIZE) throw std::length_error("basic_string::_new_auto");
1189 0 21 if (pos) traits_type::copy(ibuf->start, _str, pos);
1256 0 0 if (oth._state == State::SSO) _str = _sso + (oth._str - oth._sso);
1274 0 0 if (_storage.internal->refcnt > 1) {
1278 0 0 else if (_storage.internal->capacity < capacity) { // could realloc save anything?
1286 0 0 if (_storage.external->refcnt > 1) {
1290 0 0 else if (_storage.external->capacity < capacity) {
1335 0 0 if (capacity < _length) capacity = _length;
1345 0 0 if (_storage.internal->refcnt > 1) _detach_cow(capacity * extra);
1346 0 0 else if (_storage.internal->capacity < capacity) _internal_realloc(capacity * extra); // need to grow storage
1347 0 0 else if (_capacity_internal() < capacity) { // may not to grow storage if str is moved to the beginning
1356 0 0 if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) {
0 0 if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) {
1357 0 0 if (capacity > MAX_SIZE) throw std::length_error("basic_string::_internal_realloc");
0 0 if (capacity > MAX_SIZE) throw std::length_error("basic_string::_internal_realloc");
1372 0 0 if (_storage.external->refcnt > 1) _detach_cow(capacity * extra);
1373 0 0 else if (_storage.external->capacity < capacity) _external_realloc(capacity * extra); // need to grow storage, switch to INTERNAL/SSO
1374 0 0 else if (_capacity_external() < capacity) { // may not to grow storage if str is moved to the beginning
1390 0 0 if (MAX_SSO_CHARS < capacity) {
1394 0 0 else if (_capacity_sso() < capacity) {
1408 0 0 if (_storage.internal->refcnt > 1) {
1412 0 0 else if (newlen > _storage.internal->capacity) {
1421 0 0 if (_storage.external->refcnt > 1) {
1425 0 0 else if (newlen > _storage.external->capacity) {
1437 21 3 if (newlen > MAX_SSO_CHARS) _new_internal_from_sso(newlen, pos, remove_count, insert_count);
1448 0 0 if (pos) traits_type::copy(_str, old_str, pos);
1453 0 0 if (remove_count >= insert_count) {
1461 0 0 if (has_head_space && has_tail_space) { // move what is shorter
0 0 if (has_head_space && has_tail_space) { // move what is shorter
1462 0 0 if (pos > _length - pos - remove_count) { // tail is shorter
1465 0 0 if (pos) traits_type::move(_str - extra_count, _str, pos);
1469 0 0 else if (has_head_space) {
1470 0 0 if (pos) traits_type::move(_str - extra_count, _str, pos);
1473 0 0 else if (has_tail_space) {
1477 0 0 if (pos) traits_type::move(ptr_start, _str, pos);
1501 0 0 static void _release_internal (Buffer* buf, dtor_fn dtor) { if (!--buf->refcnt) _free_internal(buf, dtor); }
1502 0 0 static void _release_external (ExternalShared* ebuf, dtor_fn dtor) { if (!--ebuf->refcnt) _free_external(ebuf, dtor); }