Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable drone caching #762

Merged
merged 2 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .drone/drone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ common_install() {
fi
fi

# !!! See: https://github.com/boostorg/url/issues/760
boost_cache_hit=false

# Setup boost
# If no cache: Clone, patch with boost-ci/ci, run common_install, and cache the result
# If cache hit: Copy boost from cache, patch $SELF, and look for new dependencies with depinst
Expand Down
12 changes: 8 additions & 4 deletions src/detail/format_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,14 @@ measure(
dn += measure_one(sign, cs);
++n;
}
while (v > 0)
do
{
int d = v % 10;
v /= 10;
dn += measure_one('0' + static_cast<char>(d), cs);
++n;
}
while (v > 0);

std::size_t w = width;
if (width_idx != std::size_t(-1) ||
Expand Down Expand Up @@ -412,13 +413,14 @@ measure(
dn += measure_one(sign, cs);
++n;
}
while (v != 0)
do
{
int d = v % 10;
v /= 10;
dn += measure_one('0' + static_cast<char>(d), cs);
++n;
}
while (v != 0);

std::size_t w = width;
if (width_idx != std::size_t(-1) ||
Expand Down Expand Up @@ -457,13 +459,14 @@ format(
{
++n;
}
while (v > 0)
do
{
if (v >= 10)
p *= 10;
v /= 10;
++n;
}
while (v > 0);
static constexpr auto m =
std::numeric_limits<long long int>::digits10;
BOOST_ASSERT(n <= m + 1);
Expand Down Expand Up @@ -559,13 +562,14 @@ grammar::lut_chars const& cs) const
{
++n;
}
while (v > 0)
do
{
if (v >= 10)
p *= 10;
v /= 10;
++n;
}
while (v > 0);
static constexpr auto m =
std::numeric_limits<unsigned long long int>::digits10;
BOOST_ASSERT(n <= m + 1);
Expand Down
22 changes: 22 additions & 0 deletions test/unit/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,28 @@ struct format_test
segs_equal( u.encoded_segments(), {"v"});
BOOST_TEST_NOT( u.has_query() );
}
{
url u = format("{}", 0);
BOOST_TEST_CSTR_EQ(u.buffer(), "0");
BOOST_TEST_NOT( u.has_authority() );
BOOST_TEST_NOT( u.has_userinfo() );
BOOST_TEST( u.encoded_host().empty() );
BOOST_TEST_CSTR_EQ( u.encoded_path(), "0" );
BOOST_TEST_NOT( u.is_path_absolute() );
segs_equal( u.encoded_segments(), {"0"});
BOOST_TEST_NOT( u.has_query() );
}
{
url u = format("{}", 0U);
BOOST_TEST_CSTR_EQ(u.buffer(), "0");
BOOST_TEST_NOT( u.has_authority() );
BOOST_TEST_NOT( u.has_userinfo() );
BOOST_TEST( u.encoded_host().empty() );
BOOST_TEST_CSTR_EQ( u.encoded_path(), "0" );
BOOST_TEST_NOT( u.is_path_absolute() );
segs_equal( u.encoded_segments(), {"0"});
BOOST_TEST_NOT( u.has_query() );
}
{
url u = format("/a");
BOOST_TEST_CSTR_EQ(u.buffer(), "/a");
Expand Down