aboutsummaryrefslogtreecommitdiffstats
path: root/test/liblangutil
diff options
context:
space:
mode:
authorChristian Parpart <christian@ethereum.org>2018-12-12 21:43:34 +0800
committerChristian Parpart <christian@ethereum.org>2018-12-19 18:21:45 +0800
commitd10bae245ed441314c3bd6ecc74b2a1f3d060d12 (patch)
tree1c93d817c44d86d5d3c8ee5c79d04196de289132 /test/liblangutil
parent678a95f6e3bbd9f1c4914151c0178847348de970 (diff)
downloaddexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.gz
dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.tar.zst
dexon-solidity-d10bae245ed441314c3bd6ecc74b2a1f3d060d12.zip
liblangutil: SourceLocation to default initialize data members (w/o the use of ctor)
See: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c45-dont-define-a-default-constructor-that-only-initializes-data-members-use-in-class-member-initializers-instead
Diffstat (limited to 'test/liblangutil')
-rw-r--r--test/liblangutil/SourceLocation.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/liblangutil/SourceLocation.cpp b/test/liblangutil/SourceLocation.cpp
index ef4103da..5bdce88e 100644
--- a/test/liblangutil/SourceLocation.cpp
+++ b/test/liblangutil/SourceLocation.cpp
@@ -37,12 +37,12 @@ BOOST_AUTO_TEST_CASE(test_fail)
auto const sourceA = std::make_shared<CharStream>("", "sourceA");
auto const sourceB = std::make_shared<CharStream>("", "sourceB");
- BOOST_CHECK(SourceLocation() == SourceLocation());
- BOOST_CHECK(SourceLocation(0, 3, sourceA) != SourceLocation(0, 3, sourceB));
- BOOST_CHECK(SourceLocation(0, 3, source) == SourceLocation(0, 3, source));
- BOOST_CHECK(SourceLocation(3, 7, source).contains(SourceLocation(4, 6, source)));
- BOOST_CHECK(!SourceLocation(3, 7, sourceA).contains(SourceLocation(4, 6, sourceB)));
- BOOST_CHECK(SourceLocation(3, 7, sourceA) < SourceLocation(4, 6, sourceB));
+ BOOST_CHECK(SourceLocation{} == SourceLocation{});
+ BOOST_CHECK((SourceLocation{0, 3, sourceA} != SourceLocation{0, 3, sourceB}));
+ BOOST_CHECK((SourceLocation{0, 3, source} == SourceLocation{0, 3, source}));
+ BOOST_CHECK((SourceLocation{3, 7, source}.contains(SourceLocation{4, 6, source})));
+ BOOST_CHECK((!SourceLocation{3, 7, sourceA}.contains(SourceLocation{4, 6, sourceB})));
+ BOOST_CHECK((SourceLocation{3, 7, sourceA} < SourceLocation{4, 6, sourceB}));
}
BOOST_AUTO_TEST_SUITE_END()