Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Aug 19, 2022
1 parent a1f92f2 commit bf81b8a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions test/unit/doc_grammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
//

#include <boost/url.hpp>

#include "test_suite.hpp"

#include <boost/core/ignore_unused.hpp>
#include <iostream>

namespace boost {
Expand Down Expand Up @@ -78,7 +78,7 @@ string_view get_token( string_view s ) noexcept
struct is_visible
{
constexpr bool operator()( char ch ) const noexcept
{
{
return ch >= 33 && ch <= 126;
}
};
Expand Down Expand Up @@ -132,11 +132,13 @@ struct doc_grammar_test
//[code_grammar_1_5
result< unsigned short > rv = parse( "16384", unsigned_rule< unsigned short >{} );
//]
ignore_unused(rv);
}
{
//[code_grammar_1_6
result< string_view > rv = parse( ",", delim_rule(',') );
//]
ignore_unused(rv);
}
}
//--------------------------------------------
Expand All @@ -156,16 +158,19 @@ struct doc_grammar_test
//[code_grammar_2_8
constexpr auto vowels_and_y = vowels + 'y' + 'Y';
//]
ignore_unused(vowels_and_y);
}
{
//[code_grammar_2_11
constexpr auto visible_non_vowels = visible_chars - vowels;
//]
ignore_unused(visible_non_vowels);
}
{
//[code_grammar_2_12
constexpr auto visible_non_vowels_or_y = visible_chars - vowels - 'y';
//]
ignore_unused(visible_non_vowels_or_y);
}
}

Expand All @@ -181,13 +186,15 @@ struct doc_grammar_test
//[code_grammar_3_2
result< std::tuple< string_view, unsigned char, string_view, unsigned char > > rv = parse( "v42.44800", version_rule );
//]
ignore_unused(rv);
}
{
//[code_grammar_3_3
constexpr auto version_rule = tuple_rule( squelch( delim_rule( 'v' ) ), dec_octet_rule, squelch( delim_rule( '.' ) ), dec_octet_rule );

result< std::tuple< unsigned char, unsigned char > > rv = parse( "v42.44800", version_rule );
//]
ignore_unused(rv);
}
{
//[code_grammar_3_4
Expand All @@ -197,6 +204,7 @@ struct doc_grammar_test

result< unsigned short > rv = parse( ":443", port_rule );
//]
ignore_unused(rv);
}
{
//[code_grammar_3_5
Expand Down Expand Up @@ -228,6 +236,7 @@ struct doc_grammar_test
squelch( delim_rule( ':' ) ),
unsigned_rule< unsigned short >{} ) ) );
//]
ignore_unused(endpoint_rule);
}
{
//[code_grammar_3_7
Expand All @@ -240,6 +249,7 @@ struct doc_grammar_test

result< std::tuple< ipv4_address, optional< unsigned short > > > rv = parse( "192.168.0.1:443", endpoint_rule );
//]
ignore_unused(rv);
}
{
//[code_grammar_3_8
Expand Down Expand Up @@ -292,6 +302,7 @@ struct doc_grammar_test
//[code_grammar_5_1
result< pct_encoded_view > rv = parse( s, pct_encoded_rule( pchars ) );
//]
ignore_unused(rv);
}
{
//[code_grammar_5_2
Expand All @@ -310,6 +321,7 @@ struct doc_grammar_test
delim_rule( digit_chars ), // DIGIT
squelch( literal_rule( "\r\n" ) ) ); // CRLF
//]
ignore_unused(request_line_rule);
}
}

Expand Down

0 comments on commit bf81b8a

Please sign in to comment.