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 3 46 6.5


line true false branch
103 0 0 if (!mem) throw std::bad_alloc();
457 3 0 case State::INTERNAL: return _storage.internal->refcnt == 1 ? _capacity_internal() : 0;
458 0 0 case State::EXTERNAL: return _storage.external->refcnt == 1 ? _capacity_external() : 0;
1150 0 3 if (_state == State::LITERAL) return _str; // LITERALs are NT
1156 0 3 if (capacity() <= _length) const_cast(this)->_reserve_save(_length + 1); // we're in COW mode or don't have space
1170 0 0 if (capacity <= MAX_SSO_CHARS) {
1174 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");
1338 0 0 if (capacity < _length) capacity = _length;
1348 0 0 if (_storage.internal->refcnt > 1) _detach_cow(capacity * extra);
1349 0 0 else if (_storage.internal->capacity < capacity) _internal_realloc(capacity * extra); // need to grow storage
1350 0 0 else if (_capacity_internal() < capacity) { // may not to grow storage if str is moved to the beginning
1359 0 0 if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) {
0 0 if (_storage.dtor == &Alloc::deallocate && _str == _storage.internal->start) {
1360 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");
1375 0 0 if (_storage.external->refcnt > 1) _detach_cow(capacity * extra);
1376 0 0 else if (_storage.external->capacity < capacity) _external_realloc(capacity * extra); // need to grow storage, switch to INTERNAL/SSO
1377 0 0 else if (_capacity_external() < capacity) { // may not to grow storage if str is moved to the beginning
1393 0 0 if (MAX_SSO_CHARS < capacity) {
1397 0 0 else if (_capacity_sso() < capacity) {
1505 0 0 static void _release_internal (Buffer* buf, dtor_fn dtor) { if (!--buf->refcnt) _free_internal(buf, dtor); }
1506 0 0 static void _release_external (ExternalShared* ebuf, dtor_fn dtor) { if (!--ebuf->refcnt) _free_external(ebuf, dtor); }