aboutsummaryrefslogtreecommitdiff
path: root/src/compat/glibcxx_sanity.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-09-25 08:23:32 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-09-25 08:23:32 +0200
commitcf42c36e9963f9cf13704d8d74a9546f0db33d40 (patch)
tree858c8076671647abe299b1ef0125b7476006f726 /src/compat/glibcxx_sanity.cpp
parentea69592a2f261dba37d551c0ac77e93ce00b37c3 (diff)
Apply clang-format on crypto/* and compat/*
Diffstat (limited to 'src/compat/glibcxx_sanity.cpp')
-rw-r--r--src/compat/glibcxx_sanity.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/compat/glibcxx_sanity.cpp b/src/compat/glibcxx_sanity.cpp
index cd8da4fd67..9b1fefd448 100644
--- a/src/compat/glibcxx_sanity.cpp
+++ b/src/compat/glibcxx_sanity.cpp
@@ -6,15 +6,15 @@
#include <locale>
#include <stdexcept>
-namespace{
-
+namespace
+{
// trigger: use ctype<char>::widen to trigger ctype<char>::_M_widen_init().
// test: convert a char from narrow to wide and back. Verify that the result
// matches the original.
bool sanity_test_widen(char testchar)
{
- const std::ctype<char>& test(std::use_facet< std::ctype<char> >(std::locale()));
- return test.narrow(test.widen(testchar),'b') == testchar;
+ const std::ctype<char>& test(std::use_facet<std::ctype<char> >(std::locale()));
+ return test.narrow(test.widen(testchar), 'b') == testchar;
}
// trigger: use list::push_back and list::pop_back to trigger _M_hook and
@@ -25,14 +25,13 @@ bool sanity_test_list(unsigned int size)
{
std::list<unsigned int> test;
for (unsigned int i = 0; i != size; ++i)
- test.push_back(i+1);
+ test.push_back(i + 1);
if (test.size() != size)
return false;
- while (!test.empty())
- {
- if(test.back() != test.size())
+ while (!test.empty()) {
+ if (test.back() != test.size())
return false;
test.pop_back();
}
@@ -47,15 +46,12 @@ bool sanity_test_list(unsigned int size)
bool sanity_test_range_fmt()
{
std::string test;
- try
- {
+ try {
test.at(1);
- }
- catch (const std::out_of_range&)
- {
+ } catch (const std::out_of_range&) {
return true;
+ } catch (...) {
}
- catch (...){}
return false;
}