Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73099 - in trunk/libs/locale: src/shared test tools
From: artyomtnk_at_[hidden]
Date: 2011-07-14 07:09:26


Author: artyom
Date: 2011-07-14 07:09:25 EDT (Thu, 14 Jul 2011)
New Revision: 73099
URL: http://svn.boost.org/trac/boost/changeset/73099

Log:
Cleanup of some tabs and missing copyright notices

Text files modified:
   trunk/libs/locale/src/shared/localization_backend.cpp | 7 ++
   trunk/libs/locale/test/generate_catalogs.sh | 8 +++
   trunk/libs/locale/test/test_winapi_convert.cpp | 4
   trunk/libs/locale/test/test_winapi_formatting.cpp | 102 ++++++++++++++++++++--------------------
   trunk/libs/locale/tools/cross-compile-gettext.sh | 8 +++
   5 files changed, 76 insertions(+), 53 deletions(-)

Modified: trunk/libs/locale/src/shared/localization_backend.cpp
==============================================================================
--- trunk/libs/locale/src/shared/localization_backend.cpp (original)
+++ trunk/libs/locale/src/shared/localization_backend.cpp 2011-07-14 07:09:25 EDT (Thu, 14 Jul 2011)
@@ -1,3 +1,10 @@
+//
+// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+//
+// Distributed under the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
 #define BOOST_LOCALE_SOURCE
 #include <boost/locale/localization_backend.hpp>
 #include <boost/shared_ptr.hpp>

Modified: trunk/libs/locale/test/generate_catalogs.sh
==============================================================================
--- trunk/libs/locale/test/generate_catalogs.sh (original)
+++ trunk/libs/locale/test/generate_catalogs.sh 2011-07-14 07:09:25 EDT (Thu, 14 Jul 2011)
@@ -1,4 +1,12 @@
 #!/bin/sh
+
+# Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+#
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+
 msgfmt --endianness=big he/LC_MESSAGES/simple.po -o he/LC_MESSAGES/simple.mo
 msgfmt he/LC_MESSAGES/default.po -o he/LC_MESSAGES/default.mo
 msgfmt he/LC_MESSAGES/fall.po -o he/LC_MESSAGES/fall.mo

Modified: trunk/libs/locale/test/test_winapi_convert.cpp
==============================================================================
--- trunk/libs/locale/test/test_winapi_convert.cpp (original)
+++ trunk/libs/locale/test/test_winapi_convert.cpp 2011-07-14 07:09:25 EDT (Thu, 14 Jul 2011)
@@ -86,10 +86,10 @@
         std::cout << "Testing Unicode normalization" << std::endl;
         test_norm("\xEF\xAC\x81","\xEF\xAC\x81",boost::locale::norm_nfd); /// ligature fi
         test_norm("\xEF\xAC\x81","\xEF\xAC\x81",boost::locale::norm_nfc);
- #if defined(_WIN32_NT) && _WIN32_NT >= 0x600
+ #if defined(_WIN32_NT) && _WIN32_NT >= 0x600
         test_norm("\xEF\xAC\x81","fi",boost::locale::norm_nfkd);
         test_norm("\xEF\xAC\x81","fi",boost::locale::norm_nfkc);
- #endif
+ #endif
         test_norm("ä","ä",boost::locale::norm_nfd); // ä to a and accent
         test_norm("ä","ä",boost::locale::norm_nfc);
     }

Modified: trunk/libs/locale/test/test_winapi_formatting.cpp
==============================================================================
--- trunk/libs/locale/test/test_winapi_formatting.cpp (original)
+++ trunk/libs/locale/test/test_winapi_formatting.cpp 2011-07-14 07:09:25 EDT (Thu, 14 Jul 2011)
@@ -141,12 +141,12 @@
         ss << as::currency;
         ss << 1043.34;
         TEST(ss);
-
- wchar_t buf[256];
- GetCurrencyFormatW(lcid,0,L"1043.34",0,buf,256);
         
- TEST(equal(ss.str(),buf));
- }
+ wchar_t buf[256];
+ GetCurrencyFormatW(lcid,0,L"1043.34",0,buf,256);
+
+ TEST(equal(ss.str(),buf));
+ }
 
     {
         std::cout << "--- Testing as::date/time" << std::endl;
@@ -168,13 +168,13 @@
         ss << as::time_zone("GMT+00:15");
         ss << as::ftime(conv_to_char<CharType>("%M")) << a_datetime << CharType('\n');
 
- wchar_t time_buf[256];
- wchar_t date_buf[256];
-
- SYSTEMTIME st= { 1970, 2,5, 5,15,33,13,0 };
- GetTimeFormatW(lcid,0,&st,0,time_buf,256);
- GetDateFormatW(lcid,0,&st,0,date_buf,256);
- TEST(equal(ss.str(),std::wstring(date_buf)+L"\n" + time_buf +L"\n" + date_buf + L" " + time_buf + L"\n16\n48\n"));
+ wchar_t time_buf[256];
+ wchar_t date_buf[256];
+
+ SYSTEMTIME st= { 1970, 2,5, 5,15,33,13,0 };
+ GetTimeFormatW(lcid,0,&st,0,time_buf,256);
+ GetDateFormatW(lcid,0,&st,0,date_buf,256);
+ TEST(equal(ss.str(),std::wstring(date_buf)+L"\n" + time_buf +L"\n" + date_buf + L" " + time_buf + L"\n16\n48\n"));
 
     }
 
@@ -183,45 +183,45 @@
 
 void test_date_time(std::locale l)
 {
- std::ostringstream ss;
- ss.imbue(l);
+ std::ostringstream ss;
+ ss.imbue(l);
 
     ss << boost::locale::as::time_zone("GMT");
 
- time_t a_date = 3600*24*(31+4); // Feb 5th
- time_t a_time = 3600*15+60*33; // 15:33:13
- time_t a_timesec = 13;
- time_t a_datetime = a_date + a_time + a_timesec;
-
- std::string pat[] = {
- "a", "Thu",
- "A", "Thursday",
- "b", "Feb",
- "B", "February",
- "d", "05",
- "D", "02/05/70",
- "e", "5",
- "h", "Feb",
- "H", "15",
- "I", "03",
- "m", "02",
- "M", "33",
- "n", "\n",
- "p", "PM",
- "r", "03:33:13 PM",
- "R", "15:33",
- "S", "13",
- "t", "\t",
- "y", "70",
- "Y", "1970",
- "%", "%"
- };
-
- for(unsigned i=0;i<sizeof(pat)/sizeof(pat[0]);i+=2) {
- ss.str("");
- ss << boost::locale::as::ftime("%" + pat[i]) << a_datetime;
- TEST(equal(ss.str(),pat[i+1]));
- }
+ time_t a_date = 3600*24*(31+4); // Feb 5th
+ time_t a_time = 3600*15+60*33; // 15:33:13
+ time_t a_timesec = 13;
+ time_t a_datetime = a_date + a_time + a_timesec;
+
+ std::string pat[] = {
+ "a", "Thu",
+ "A", "Thursday",
+ "b", "Feb",
+ "B", "February",
+ "d", "05",
+ "D", "02/05/70",
+ "e", "5",
+ "h", "Feb",
+ "H", "15",
+ "I", "03",
+ "m", "02",
+ "M", "33",
+ "n", "\n",
+ "p", "PM",
+ "r", "03:33:13 PM",
+ "R", "15:33",
+ "S", "13",
+ "t", "\t",
+ "y", "70",
+ "Y", "1970",
+ "%", "%"
+ };
+
+ for(unsigned i=0;i<sizeof(pat)/sizeof(pat[0]);i+=2) {
+ ss.str("");
+ ss << boost::locale::as::ftime("%" + pat[i]) << a_datetime;
+ TEST(equal(ss.str(),pat[i+1]));
+ }
 }
 
 int main()
@@ -233,7 +233,7 @@
         boost::locale::generator gen;
         std::string name;
         std::string names[] = { "en_US.UTF-8", "he_IL.UTF-8", "ru_RU.UTF-8" };
- int lcids[] = { 0x0409, 0x040D ,0x0419 };
+ int lcids[] = { 0x0409, 0x040D ,0x0419 };
 
         for(unsigned i=0;i<sizeof(names)/sizeof(names[9]);i++) {
             name = names[i];
@@ -244,8 +244,8 @@
             std::cout << "-- UTF-16" << std::endl;
             test_by_char<wchar_t>(l1,name,lcids[i]);
         }
- std::cout << "- Testing strftime" <<std::endl;
- test_date_time(gen("en_US.UTF-8"));
+ std::cout << "- Testing strftime" <<std::endl;
+ test_date_time(gen("en_US.UTF-8"));
     }
     catch(std::exception const &e) {
         std::cerr << "Failed " << e.what() << std::endl;

Modified: trunk/libs/locale/tools/cross-compile-gettext.sh
==============================================================================
--- trunk/libs/locale/tools/cross-compile-gettext.sh (original)
+++ trunk/libs/locale/tools/cross-compile-gettext.sh 2011-07-14 07:09:25 EDT (Thu, 14 Jul 2011)
@@ -1,4 +1,12 @@
 #!/bin/bash
+#
+# Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
+#
+# Distributed under the Boost Software License, Version 1.0. (See
+# accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
+#
+
 
 # Small and Fast Cross Compile Script
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk