aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/include/libaddressinput/address_input_helper.h4
-rw-r--r--cpp/include/libaddressinput/localization.h1
-rw-r--r--cpp/include/libaddressinput/supplier.h1
-rw-r--r--cpp/include/libaddressinput/util/basictypes.h5
-rw-r--r--cpp/include/libaddressinput/util/scoped_ptr.h11
-rw-r--r--cpp/src/address_field.cc4
-rw-r--r--cpp/src/address_field_util.h4
-rw-r--r--cpp/src/address_formatter.cc2
-rw-r--r--cpp/src/address_input_helper.cc10
-rw-r--r--cpp/src/address_metadata.cc1
-rw-r--r--cpp/src/address_normalizer.cc3
-rw-r--r--cpp/src/address_problem.cc4
-rw-r--r--cpp/src/address_ui.cc1
-rw-r--r--cpp/src/address_validator.cc3
-rw-r--r--cpp/src/localization.cc3
-rw-r--r--cpp/src/lookup_key.cc1
-rw-r--r--cpp/src/ondemand_supplier.cc2
-rw-r--r--cpp/src/ondemand_supply_task.cc11
-rw-r--r--cpp/src/ondemand_supply_task.h1
-rw-r--r--cpp/src/post_box_matchers.cc4
-rw-r--r--cpp/src/preload_supplier.cc1
-rw-r--r--cpp/src/region_data.cc1
-rw-r--r--cpp/src/region_data_constants.cc7
-rw-r--r--cpp/src/rule.cc7
-rw-r--r--cpp/src/rule.h3
-rw-r--r--cpp/src/util/lru_cache_using_std.h2
-rw-r--r--cpp/src/util/md5.cc2
-rw-r--r--cpp/src/util/md5.h1
-rw-r--r--cpp/src/util/string_util.cc5
-rw-r--r--cpp/src/validating_storage.cc4
-rw-r--r--cpp/src/validation_task.cc5
-rw-r--r--cpp/src/validation_task.h3
-rw-r--r--cpp/test/address_field_util_test.cc2
-rw-r--r--cpp/test/address_metadata_test.cc6
-rw-r--r--cpp/test/address_normalizer_test.cc4
-rw-r--r--cpp/test/address_ui_test.cc2
-rw-r--r--cpp/test/address_validator_test.cc3
-rw-r--r--cpp/test/fake_downloader.cc1
-rw-r--r--cpp/test/format_element_test.cc2
-rw-r--r--cpp/test/localization_test.cc22
-rw-r--r--cpp/test/lookup_key_test.cc2
-rw-r--r--cpp/test/mock_downloader.h3
-rw-r--r--cpp/test/null_storage_test.cc3
-rw-r--r--cpp/test/post_box_matchers_test.cc4
-rw-r--r--cpp/test/preload_supplier_test.cc8
-rw-r--r--cpp/test/region_data_builder_test.cc4
-rw-r--r--cpp/test/region_data_constants_test.cc1
-rw-r--r--cpp/test/region_data_test.cc1
-rw-r--r--cpp/test/retriever_test.cc2
-rw-r--r--cpp/test/rule_test.cc1
-rw-r--r--cpp/test/supplier_test.cc4
-rw-r--r--cpp/test/util/json_test.cc1
-rw-r--r--cpp/test/util/scoped_ptr_unittest.cc2
-rw-r--r--cpp/test/util/string_util_test.cc1
-rw-r--r--cpp/test/validation_task_test.cc2
55 files changed, 104 insertions, 94 deletions
diff --git a/cpp/include/libaddressinput/address_input_helper.h b/cpp/include/libaddressinput/address_input_helper.h
index 043d3fc..feb04d7 100644
--- a/cpp/include/libaddressinput/address_input_helper.h
+++ b/cpp/include/libaddressinput/address_input_helper.h
@@ -15,10 +15,10 @@
#ifndef I18N_ADDRESSINPUT_ADDRESS_INPUT_HELPER_H_
#define I18N_ADDRESSINPUT_ADDRESS_INPUT_HELPER_H_
-#include <vector>
-
#include <libaddressinput/util/basictypes.h>
+#include <vector>
+
namespace i18n {
namespace addressinput {
diff --git a/cpp/include/libaddressinput/localization.h b/cpp/include/libaddressinput/localization.h
index acfdf7e..9d31265 100644
--- a/cpp/include/libaddressinput/localization.h
+++ b/cpp/include/libaddressinput/localization.h
@@ -19,7 +19,6 @@
#include <libaddressinput/address_problem.h>
#include <string>
-#include <vector>
namespace i18n {
namespace addressinput {
diff --git a/cpp/include/libaddressinput/supplier.h b/cpp/include/libaddressinput/supplier.h
index fcd64ad..7d079cf 100644
--- a/cpp/include/libaddressinput/supplier.h
+++ b/cpp/include/libaddressinput/supplier.h
@@ -16,7 +16,6 @@
#define I18N_ADDRESSINPUT_SUPPLIER_H_
#include <libaddressinput/callback.h>
-#include <libaddressinput/util/basictypes.h>
namespace i18n {
namespace addressinput {
diff --git a/cpp/include/libaddressinput/util/basictypes.h b/cpp/include/libaddressinput/util/basictypes.h
index 763b179..663133f 100644
--- a/cpp/include/libaddressinput/util/basictypes.h
+++ b/cpp/include/libaddressinput/util/basictypes.h
@@ -20,9 +20,8 @@
#ifndef I18N_ADDRESSINPUT_UTIL_BASICTYPES_H_
#define I18N_ADDRESSINPUT_UTIL_BASICTYPES_H_
-#include <limits.h> // So we can set the bounds of our types
-#include <stddef.h> // For size_t
-#include <string.h> // for memcpy
+#include <climits> // So we can set the bounds of our types
+#include <cstddef> // For size_t
#if !defined(_WIN32)
// stdint.h is part of C99 but MSVC doesn't have it.
diff --git a/cpp/include/libaddressinput/util/scoped_ptr.h b/cpp/include/libaddressinput/util/scoped_ptr.h
index fe15fca..a88c2a9 100644
--- a/cpp/include/libaddressinput/util/scoped_ptr.h
+++ b/cpp/include/libaddressinput/util/scoped_ptr.h
@@ -11,15 +11,14 @@
// This is an implementation designed to match the anticipated future TR2
// implementation of the scoped_ptr class and scoped_ptr_malloc (deprecated).
-#include <assert.h>
-#include <stddef.h>
-#include <stdlib.h>
-
-#include <algorithm> // For std::swap().
-
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/template_util.h>
+#include <algorithm> // For std::swap().
+#include <cassert>
+#include <cstddef>
+#include <cstdlib>
+
namespace i18n {
namespace addressinput {
diff --git a/cpp/src/address_field.cc b/cpp/src/address_field.cc
index 9831479..7d57e06 100644
--- a/cpp/src/address_field.cc
+++ b/cpp/src/address_field.cc
@@ -14,11 +14,11 @@
#include <libaddressinput/address_field.h>
+#include <libaddressinput/util/basictypes.h>
+
#include <cstddef>
#include <ostream>
-#include <libaddressinput/util/basictypes.h>
-
using i18n::addressinput::AddressField;
using i18n::addressinput::COUNTRY;
using i18n::addressinput::RECIPIENT;
diff --git a/cpp/src/address_field_util.h b/cpp/src/address_field_util.h
index 62a6b7e..123672b 100644
--- a/cpp/src/address_field_util.h
+++ b/cpp/src/address_field_util.h
@@ -20,11 +20,11 @@
#include <string>
#include <vector>
-#include "format_element.h"
-
namespace i18n {
namespace addressinput {
+class FormatElement;
+
// Clears |fields|, parses |format|, and adds the format address fields to
// |fields|. The |fields| may also contain NEWLINE elements. For example, parses
// "%S%C%n%D%X" into {ADMIN_AREA, LOCALITY, NEWLINE, DEPENDENT_LOCALITY,
diff --git a/cpp/src/address_formatter.cc b/cpp/src/address_formatter.cc
index f4fc04d..0bf5c5d 100644
--- a/cpp/src/address_formatter.cc
+++ b/cpp/src/address_formatter.cc
@@ -16,8 +16,10 @@
#include <libaddressinput/address_data.h>
#include <libaddressinput/address_field.h>
+#include <libaddressinput/util/basictypes.h>
#include <algorithm>
+#include <cassert>
#include <cstddef>
#include <functional>
#include <string>
diff --git a/cpp/src/address_input_helper.cc b/cpp/src/address_input_helper.cc
index a8ce92f..39a6264 100644
--- a/cpp/src/address_input_helper.cc
+++ b/cpp/src/address_input_helper.cc
@@ -14,15 +14,17 @@
#include <libaddressinput/address_input_helper.h>
+#include <libaddressinput/address_data.h>
+#include <libaddressinput/address_field.h>
+#include <libaddressinput/preload_supplier.h>
+#include <libaddressinput/util/basictypes.h>
+
#include <cassert>
#include <cstddef>
#include <string>
#include <vector>
-#include <libaddressinput/address_data.h>
-#include <libaddressinput/address_field.h>
-#include <libaddressinput/preload_supplier.h>
-#include <libaddressinput/util/basictypes.h>
+#include <re2/re2.h>
#include "language.h"
#include "lookup_key.h"
diff --git a/cpp/src/address_metadata.cc b/cpp/src/address_metadata.cc
index 2310f2e..c088e0d 100644
--- a/cpp/src/address_metadata.cc
+++ b/cpp/src/address_metadata.cc
@@ -19,6 +19,7 @@
#include <algorithm>
#include <string>
+#include "format_element.h"
#include "region_data_constants.h"
#include "rule.h"
diff --git a/cpp/src/address_normalizer.cc b/cpp/src/address_normalizer.cc
index e80489d..562203e 100644
--- a/cpp/src/address_normalizer.cc
+++ b/cpp/src/address_normalizer.cc
@@ -20,9 +20,10 @@
#include <cassert>
#include <cstddef>
+#include <string>
+#include <vector>
#include "lookup_key.h"
-#include "region_data_constants.h"
#include "rule.h"
#include "util/string_compare.h"
diff --git a/cpp/src/address_problem.cc b/cpp/src/address_problem.cc
index e6cf446..0fade17 100644
--- a/cpp/src/address_problem.cc
+++ b/cpp/src/address_problem.cc
@@ -14,11 +14,11 @@
#include <libaddressinput/address_problem.h>
+#include <libaddressinput/util/basictypes.h>
+
#include <cstddef>
#include <ostream>
-#include <libaddressinput/util/basictypes.h>
-
using i18n::addressinput::AddressProblem;
using i18n::addressinput::UNEXPECTED_FIELD;
using i18n::addressinput::USES_P_O_BOX;
diff --git a/cpp/src/address_ui.cc b/cpp/src/address_ui.cc
index a099335..06baac5 100644
--- a/cpp/src/address_ui.cc
+++ b/cpp/src/address_ui.cc
@@ -24,7 +24,6 @@
#include <string>
#include <vector>
-#include "address_field_util.h"
#include "format_element.h"
#include "grit.h"
#include "language.h"
diff --git a/cpp/src/address_validator.cc b/cpp/src/address_validator.cc
index b3e4aae..8f0c33c 100644
--- a/cpp/src/address_validator.cc
+++ b/cpp/src/address_validator.cc
@@ -14,6 +14,9 @@
#include <libaddressinput/address_validator.h>
+#include <cassert>
+#include <cstddef>
+
#include "validation_task.h"
namespace i18n {
diff --git a/cpp/src/localization.cc b/cpp/src/localization.cc
index 9bb32a5..737d8c9 100644
--- a/cpp/src/localization.cc
+++ b/cpp/src/localization.cc
@@ -21,8 +21,9 @@
#include <cassert>
#include <cstddef>
#include <string>
+#include <vector>
-#include "grit.h"
+#include "messages.h"
#include "region_data_constants.h"
#include "rule.h"
#include "util/string_split.h"
diff --git a/cpp/src/lookup_key.cc b/cpp/src/lookup_key.cc
index c0c7b86..acde828 100644
--- a/cpp/src/lookup_key.cc
+++ b/cpp/src/lookup_key.cc
@@ -18,6 +18,7 @@
#include <libaddressinput/address_field.h>
#include <libaddressinput/util/basictypes.h>
+#include <algorithm>
#include <cassert>
#include <cstddef>
#include <functional>
diff --git a/cpp/src/ondemand_supplier.cc b/cpp/src/ondemand_supplier.cc
index 9228570..dddeae5 100644
--- a/cpp/src/ondemand_supplier.cc
+++ b/cpp/src/ondemand_supplier.cc
@@ -19,8 +19,6 @@
#include <map>
#include <string>
-#include <libaddressinput/util/scoped_ptr.h>
-
#include "lookup_key.h"
#include "ondemand_supply_task.h"
#include "region_data_constants.h"
diff --git a/cpp/src/ondemand_supply_task.cc b/cpp/src/ondemand_supply_task.cc
index ab92746..64568b3 100644
--- a/cpp/src/ondemand_supply_task.cc
+++ b/cpp/src/ondemand_supply_task.cc
@@ -14,6 +14,11 @@
#include "ondemand_supply_task.h"
+#include <libaddressinput/address_field.h>
+#include <libaddressinput/callback.h>
+#include <libaddressinput/supplier.h>
+#include <libaddressinput/util/basictypes.h>
+
#include <algorithm>
#include <cassert>
#include <cstddef>
@@ -22,12 +27,6 @@
#include <string>
#include <utility>
-#include <libaddressinput/address_field.h>
-#include <libaddressinput/callback.h>
-#include <libaddressinput/supplier.h>
-#include <libaddressinput/util/basictypes.h>
-#include <libaddressinput/util/scoped_ptr.h>
-
#include "lookup_key.h"
#include "retriever.h"
#include "rule.h"
diff --git a/cpp/src/ondemand_supply_task.h b/cpp/src/ondemand_supply_task.h
index 61e3567..45b33c9 100644
--- a/cpp/src/ondemand_supply_task.h
+++ b/cpp/src/ondemand_supply_task.h
@@ -29,7 +29,6 @@ namespace i18n {
namespace addressinput {
class LookupKey;
-class Retriever;
class Rule;
// An OndemandSupplyTask object encapsulates the information necessary to
diff --git a/cpp/src/post_box_matchers.cc b/cpp/src/post_box_matchers.cc
index 1edd8b3..e8628b5 100644
--- a/cpp/src/post_box_matchers.cc
+++ b/cpp/src/post_box_matchers.cc
@@ -20,12 +20,12 @@
#include <utility>
#include <vector>
+#include <re2/re2.h>
+
#include "language.h"
#include "rule.h"
#include "util/re2ptr.h"
-#include <re2/re2.h>
-
namespace i18n {
namespace addressinput {
diff --git a/cpp/src/preload_supplier.cc b/cpp/src/preload_supplier.cc
index 3f3dc0e..3a9cdc3 100644
--- a/cpp/src/preload_supplier.cc
+++ b/cpp/src/preload_supplier.cc
@@ -32,7 +32,6 @@
#include <utility>
#include <vector>
-#include "language.h"
#include "lookup_key.h"
#include "region_data_constants.h"
#include "retriever.h"
diff --git a/cpp/src/region_data.cc b/cpp/src/region_data.cc
index f5f0275..798501e 100644
--- a/cpp/src/region_data.cc
+++ b/cpp/src/region_data.cc
@@ -14,7 +14,6 @@
#include <libaddressinput/region_data.h>
-#include <cassert>
#include <cstddef>
#include <string>
#include <vector>
diff --git a/cpp/src/region_data_constants.cc b/cpp/src/region_data_constants.cc
index 0a1f78b..1dce6c3 100644
--- a/cpp/src/region_data_constants.cc
+++ b/cpp/src/region_data_constants.cc
@@ -16,6 +16,9 @@
#include "region_data_constants.h"
+#include <libaddressinput/address_field.h>
+#include <libaddressinput/util/basictypes.h>
+
#include <algorithm>
#include <cstddef>
#include <map>
@@ -24,10 +27,8 @@
#include <utility>
#include <vector>
-#include <libaddressinput/address_field.h>
-#include <libaddressinput/util/basictypes.h>
-
#include "address_field_util.h"
+#include "format_element.h"
#include "lookup_key.h"
namespace i18n {
diff --git a/cpp/src/rule.cc b/cpp/src/rule.cc
index 4d1cff5..a6fd9b5 100644
--- a/cpp/src/rule.cc
+++ b/cpp/src/rule.cc
@@ -14,14 +14,15 @@
#include "rule.h"
-#include <libaddressinput/address_field.h>
-
#include <cstddef>
#include <map>
#include <string>
#include <utility>
+#include <re2/re2.h>
+
#include "address_field_util.h"
+#include "format_element.h"
#include "grit.h"
#include "messages.h"
#include "region_data_constants.h"
@@ -29,8 +30,6 @@
#include "util/re2ptr.h"
#include "util/string_split.h"
-#include <re2/re2.h>
-
namespace i18n {
namespace addressinput {
diff --git a/cpp/src/rule.h b/cpp/src/rule.h
index 38f20b3..10615f4 100644
--- a/cpp/src/rule.h
+++ b/cpp/src/rule.h
@@ -27,11 +27,10 @@
#include <string>
#include <vector>
-#include "format_element.h"
-
namespace i18n {
namespace addressinput {
+class FormatElement;
class Json;
struct RE2ptr;
diff --git a/cpp/src/util/lru_cache_using_std.h b/cpp/src/util/lru_cache_using_std.h
index 25aced7..6062d28 100644
--- a/cpp/src/util/lru_cache_using_std.h
+++ b/cpp/src/util/lru_cache_using_std.h
@@ -21,8 +21,10 @@
#define I18N_ADDRESSINPUT_UTIL_LRU_CACHE_USING_STD_H_
#include <cassert>
+#include <cstddef>
#include <list>
#include <map>
+#include <utility>
// Class providing fixed-size (by number of records)
// LRU-replacement cache of a function with signature
diff --git a/cpp/src/util/md5.cc b/cpp/src/util/md5.cc
index 4a629d0..ea7561b 100644
--- a/cpp/src/util/md5.cc
+++ b/cpp/src/util/md5.cc
@@ -28,7 +28,9 @@
#include <libaddressinput/util/basictypes.h>
+#include <cstddef>
#include <string>
+#include <string.h>
namespace {
diff --git a/cpp/src/util/md5.h b/cpp/src/util/md5.h
index 8d05301..98bc325 100644
--- a/cpp/src/util/md5.h
+++ b/cpp/src/util/md5.h
@@ -8,6 +8,7 @@
#ifndef I18N_ADDRESSINPUT_UTIL_MD5_H_
#define I18N_ADDRESSINPUT_UTIL_MD5_H_
+#include <cstddef>
#include <string>
namespace i18n {
diff --git a/cpp/src/util/string_util.cc b/cpp/src/util/string_util.cc
index 18d0a87..8396d51 100644
--- a/cpp/src/util/string_util.cc
+++ b/cpp/src/util/string_util.cc
@@ -10,10 +10,9 @@
#include "string_util.h"
-#include <libaddressinput/util/basictypes.h>
-
-#include <algorithm>
#include <cassert>
+#include <cstddef>
+#include <stdint.h>
#include <string>
#include <vector>
diff --git a/cpp/src/validating_storage.cc b/cpp/src/validating_storage.cc
index 7dc231c..d809bcc 100644
--- a/cpp/src/validating_storage.cc
+++ b/cpp/src/validating_storage.cc
@@ -52,7 +52,7 @@ class Helper {
std::string* data) {
if (success) {
assert(data != NULL);
- bool is_stale = !ValidatingUtil::UnwrapTimestamp(data, time(NULL));
+ bool is_stale = !ValidatingUtil::UnwrapTimestamp(data, std::time(NULL));
bool is_corrupted = !ValidatingUtil::UnwrapChecksum(data);
success = !is_corrupted && !is_stale;
if (is_corrupted) {
@@ -84,7 +84,7 @@ ValidatingStorage::~ValidatingStorage() {}
void ValidatingStorage::Put(const std::string& key, std::string* data) {
assert(data != NULL);
- ValidatingUtil::Wrap(time(NULL), data);
+ ValidatingUtil::Wrap(std::time(NULL), data);
wrapped_storage_->Put(key, data);
}
diff --git a/cpp/src/validation_task.cc b/cpp/src/validation_task.cc
index e5beb1a..074847b 100644
--- a/cpp/src/validation_task.cc
+++ b/cpp/src/validation_task.cc
@@ -19,6 +19,7 @@
#include <libaddressinput/address_metadata.h>
#include <libaddressinput/address_problem.h>
#include <libaddressinput/address_validator.h>
+#include <libaddressinput/callback.h>
#include <libaddressinput/supplier.h>
#include <libaddressinput/util/basictypes.h>
@@ -29,13 +30,13 @@
#include <utility>
#include <vector>
+#include <re2/re2.h>
+
#include "lookup_key.h"
#include "post_box_matchers.h"
#include "rule.h"
#include "util/re2ptr.h"
-#include <re2/re2.h>
-
namespace i18n {
namespace addressinput {
diff --git a/cpp/src/validation_task.h b/cpp/src/validation_task.h
index f0895f3..5ab1b8f 100644
--- a/cpp/src/validation_task.h
+++ b/cpp/src/validation_task.h
@@ -22,11 +22,12 @@
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
+#include <string>
+
namespace i18n {
namespace addressinput {
class LookupKey;
-class Rule;
struct AddressData;
// A ValidationTask object encapsulates the information necessary to perform
diff --git a/cpp/test/address_field_util_test.cc b/cpp/test/address_field_util_test.cc
index 4a1d7a2..6e3bd6a 100644
--- a/cpp/test/address_field_util_test.cc
+++ b/cpp/test/address_field_util_test.cc
@@ -27,8 +27,8 @@ namespace {
using i18n::addressinput::AddressField;
using i18n::addressinput::COUNTRY;
-using i18n::addressinput::LOCALITY;
using i18n::addressinput::FormatElement;
+using i18n::addressinput::LOCALITY;
using i18n::addressinput::ParseFormatRule;
using i18n::addressinput::POSTAL_CODE;
using i18n::addressinput::RECIPIENT;
diff --git a/cpp/test/address_metadata_test.cc b/cpp/test/address_metadata_test.cc
index e1959cd..b60619b 100644
--- a/cpp/test/address_metadata_test.cc
+++ b/cpp/test/address_metadata_test.cc
@@ -20,13 +20,13 @@
namespace {
+using i18n::addressinput::IsFieldRequired;
+using i18n::addressinput::IsFieldUsed;
+
using i18n::addressinput::COUNTRY;
using i18n::addressinput::ADMIN_AREA;
using i18n::addressinput::DEPENDENT_LOCALITY;
-using i18n::addressinput::IsFieldRequired;
-using i18n::addressinput::IsFieldUsed;
-
TEST(AddressMetadataTest, IsFieldRequiredCountry) {
EXPECT_TRUE(IsFieldRequired(COUNTRY, "US"));
EXPECT_TRUE(IsFieldRequired(COUNTRY, "CH"));
diff --git a/cpp/test/address_normalizer_test.cc b/cpp/test/address_normalizer_test.cc
index 6f2d9f4..4253867 100644
--- a/cpp/test/address_normalizer_test.cc
+++ b/cpp/test/address_normalizer_test.cc
@@ -21,10 +21,12 @@
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
-#include "fake_downloader.h"
+#include <string>
#include <gtest/gtest.h>
+#include "fake_downloader.h"
+
namespace {
using i18n::addressinput::AddressData;
diff --git a/cpp/test/address_ui_test.cc b/cpp/test/address_ui_test.cc
index c23d205..ccfd437 100644
--- a/cpp/test/address_ui_test.cc
+++ b/cpp/test/address_ui_test.cc
@@ -26,9 +26,9 @@
namespace {
-using i18n::addressinput::ADMIN_AREA;
using i18n::addressinput::AddressField;
using i18n::addressinput::AddressUiComponent;
+using i18n::addressinput::ADMIN_AREA;
using i18n::addressinput::BuildComponents;
using i18n::addressinput::COUNTRY;
using i18n::addressinput::GetRegionCodes;
diff --git a/cpp/test/address_validator_test.cc b/cpp/test/address_validator_test.cc
index 79195e3..fce9777 100644
--- a/cpp/test/address_validator_test.cc
+++ b/cpp/test/address_validator_test.cc
@@ -15,6 +15,7 @@
#include <libaddressinput/address_validator.h>
#include <libaddressinput/address_data.h>
+#include <libaddressinput/address_field.h>
#include <libaddressinput/address_problem.h>
#include <libaddressinput/callback.h>
#include <libaddressinput/null_storage.h>
@@ -23,6 +24,7 @@
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
+#include <string>
#include <utility>
#include <gtest/gtest.h>
@@ -44,7 +46,6 @@ using i18n::addressinput::scoped_ptr;
using i18n::addressinput::COUNTRY;
using i18n::addressinput::ADMIN_AREA;
using i18n::addressinput::LOCALITY;
-using i18n::addressinput::DEPENDENT_LOCALITY;
using i18n::addressinput::POSTAL_CODE;
using i18n::addressinput::STREET_ADDRESS;
diff --git a/cpp/test/fake_downloader.cc b/cpp/test/fake_downloader.cc
index 0f3f8f1..2f18db7 100644
--- a/cpp/test/fake_downloader.cc
+++ b/cpp/test/fake_downloader.cc
@@ -15,6 +15,7 @@
#include "fake_downloader.h"
#include <cassert>
+#include <cstddef>
#include <fstream>
#include <map>
#include <string>
diff --git a/cpp/test/format_element_test.cc b/cpp/test/format_element_test.cc
index f4b8ae5..d23203f 100644
--- a/cpp/test/format_element_test.cc
+++ b/cpp/test/format_element_test.cc
@@ -14,6 +14,8 @@
#include "format_element.h"
+#include <libaddressinput/address_field.h>
+
#include <sstream>
#include <gtest/gtest.h>
diff --git a/cpp/test/localization_test.cc b/cpp/test/localization_test.cc
index 2ed4b07..e0f3e00 100644
--- a/cpp/test/localization_test.cc
+++ b/cpp/test/localization_test.cc
@@ -19,6 +19,7 @@
#include <libaddressinput/address_problem.h>
#include <string>
+#include <vector>
#include <gtest/gtest.h>
@@ -29,21 +30,22 @@ namespace {
using i18n::addressinput::AddressData;
using i18n::addressinput::AddressField;
-using i18n::addressinput::AddressProblem;
-using i18n::addressinput::ADMIN_AREA;
-using i18n::addressinput::COUNTRY;
-using i18n::addressinput::DEPENDENT_LOCALITY;
-using i18n::addressinput::INVALID_FORMAT;
using i18n::addressinput::INVALID_MESSAGE_ID;
-using i18n::addressinput::LOCALITY;
using i18n::addressinput::Localization;
-using i18n::addressinput::MISMATCHING_VALUE;
-using i18n::addressinput::MISSING_REQUIRED_FIELD;
-using i18n::addressinput::POSTAL_CODE;
-using i18n::addressinput::RECIPIENT;
+
+using i18n::addressinput::COUNTRY;
+using i18n::addressinput::ADMIN_AREA;
+using i18n::addressinput::LOCALITY;
+using i18n::addressinput::DEPENDENT_LOCALITY;
using i18n::addressinput::SORTING_CODE;
+using i18n::addressinput::POSTAL_CODE;
using i18n::addressinput::STREET_ADDRESS;
+using i18n::addressinput::RECIPIENT;
+
+using i18n::addressinput::MISSING_REQUIRED_FIELD;
using i18n::addressinput::UNKNOWN_VALUE;
+using i18n::addressinput::INVALID_FORMAT;
+using i18n::addressinput::MISMATCHING_VALUE;
using i18n::addressinput::USES_P_O_BOX;
// Tests for Localization object.
diff --git a/cpp/test/lookup_key_test.cc b/cpp/test/lookup_key_test.cc
index 18668f8..3f1fab6 100644
--- a/cpp/test/lookup_key_test.cc
+++ b/cpp/test/lookup_key_test.cc
@@ -17,6 +17,8 @@
#include <libaddressinput/address_data.h>
#include <libaddressinput/util/basictypes.h>
+#include <cstddef>
+
#include <gtest/gtest.h>
namespace {
diff --git a/cpp/test/mock_downloader.h b/cpp/test/mock_downloader.h
index b423660..d12b38d 100644
--- a/cpp/test/mock_downloader.h
+++ b/cpp/test/mock_downloader.h
@@ -18,12 +18,11 @@
#define I18N_ADDRESSINPUT_TEST_MOCK_DOWNLOADER_H_
#include <libaddressinput/downloader.h>
+#include <libaddressinput/util/basictypes.h>
#include <map>
#include <string>
-#include <libaddressinput/util/basictypes.h>
-
namespace i18n {
namespace addressinput {
diff --git a/cpp/test/null_storage_test.cc b/cpp/test/null_storage_test.cc
index e586568..82ad0f5 100644
--- a/cpp/test/null_storage_test.cc
+++ b/cpp/test/null_storage_test.cc
@@ -12,8 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include <libaddressinput/callback.h>
#include <libaddressinput/null_storage.h>
+
+#include <libaddressinput/callback.h>
#include <libaddressinput/storage.h>
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
diff --git a/cpp/test/post_box_matchers_test.cc b/cpp/test/post_box_matchers_test.cc
index eb9230c..8abd974 100644
--- a/cpp/test/post_box_matchers_test.cc
+++ b/cpp/test/post_box_matchers_test.cc
@@ -17,10 +17,10 @@
#include <cstddef>
#include <vector>
-#include "rule.h"
-
#include <gtest/gtest.h>
+#include "rule.h"
+
namespace i18n {
namespace addressinput {
struct RE2ptr;
diff --git a/cpp/test/preload_supplier_test.cc b/cpp/test/preload_supplier_test.cc
index ab787d8..754ff3f 100644
--- a/cpp/test/preload_supplier_test.cc
+++ b/cpp/test/preload_supplier_test.cc
@@ -20,15 +20,15 @@
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
-#include "fake_downloader.h"
-#include "lookup_key.h"
-#include "rule.h"
-
#include <cstddef>
#include <string>
#include <gtest/gtest.h>
+#include "fake_downloader.h"
+#include "lookup_key.h"
+#include "rule.h"
+
namespace {
using i18n::addressinput::AddressData;
diff --git a/cpp/test/region_data_builder_test.cc b/cpp/test/region_data_builder_test.cc
index 03b0981..e986d10 100644
--- a/cpp/test/region_data_builder_test.cc
+++ b/cpp/test/region_data_builder_test.cc
@@ -21,12 +21,12 @@
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
-#include "fake_downloader.h"
-
#include <string>
#include <gtest/gtest.h>
+#include "fake_downloader.h"
+
namespace {
using i18n::addressinput::BuildCallback;
diff --git a/cpp/test/region_data_constants_test.cc b/cpp/test/region_data_constants_test.cc
index b407374..8942445 100644
--- a/cpp/test/region_data_constants_test.cc
+++ b/cpp/test/region_data_constants_test.cc
@@ -15,7 +15,6 @@
#include "region_data_constants.h"
#include <string>
-#include <vector>
#include <gtest/gtest.h>
diff --git a/cpp/test/region_data_test.cc b/cpp/test/region_data_test.cc
index 66d06c6..074d3a6 100644
--- a/cpp/test/region_data_test.cc
+++ b/cpp/test/region_data_test.cc
@@ -14,6 +14,7 @@
#include <libaddressinput/region_data.h>
+#include <cstddef>
#include <string>
#include <gtest/gtest.h>
diff --git a/cpp/test/retriever_test.cc b/cpp/test/retriever_test.cc
index 513e799..874353c 100644
--- a/cpp/test/retriever_test.cc
+++ b/cpp/test/retriever_test.cc
@@ -38,8 +38,8 @@ using i18n::addressinput::FakeDownloader;
using i18n::addressinput::MockDownloader;
using i18n::addressinput::NullStorage;
using i18n::addressinput::Retriever;
-using i18n::addressinput::Storage;
using i18n::addressinput::scoped_ptr;
+using i18n::addressinput::Storage;
const char kKey[] = "data/CA/AB--fr";
diff --git a/cpp/test/rule_test.cc b/cpp/test/rule_test.cc
index 25426a2..c291cfd 100644
--- a/cpp/test/rule_test.cc
+++ b/cpp/test/rule_test.cc
@@ -24,7 +24,6 @@
#include <gtest/gtest.h>
-#include "address_field_util.h"
#include "format_element.h"
#include "grit.h"
#include "messages.h"
diff --git a/cpp/test/supplier_test.cc b/cpp/test/supplier_test.cc
index 13913c3..c51c5f7 100644
--- a/cpp/test/supplier_test.cc
+++ b/cpp/test/supplier_test.cc
@@ -16,11 +16,9 @@
#include <libaddressinput/address_data.h>
#include <libaddressinput/callback.h>
-#include <libaddressinput/downloader.h>
#include <libaddressinput/null_storage.h>
#include <libaddressinput/ondemand_supplier.h>
#include <libaddressinput/preload_supplier.h>
-#include <libaddressinput/storage.h>
#include <libaddressinput/util/basictypes.h>
#include <libaddressinput/util/scoped_ptr.h>
@@ -55,7 +53,6 @@ const char kKashiShi[] = "\xE5\x96\x80\xE4\xBB\x80\xE5\xB8\x82";
using i18n::addressinput::AddressData;
using i18n::addressinput::BuildCallback;
-using i18n::addressinput::Downloader;
using i18n::addressinput::FakeDownloader;
using i18n::addressinput::LookupKey;
using i18n::addressinput::NullStorage;
@@ -63,7 +60,6 @@ using i18n::addressinput::OndemandSupplier;
using i18n::addressinput::PreloadSupplier;
using i18n::addressinput::Rule;
using i18n::addressinput::scoped_ptr;
-using i18n::addressinput::Storage;
using i18n::addressinput::Supplier;
class SupplierWrapper {
diff --git a/cpp/test/util/json_test.cc b/cpp/test/util/json_test.cc
index a3b9f80..46d26c5 100644
--- a/cpp/test/util/json_test.cc
+++ b/cpp/test/util/json_test.cc
@@ -22,7 +22,6 @@
namespace {
using i18n::addressinput::Json;
-using i18n::addressinput::scoped_ptr;
TEST(JsonTest, EmptyStringIsNotValid) {
Json json;
diff --git a/cpp/test/util/scoped_ptr_unittest.cc b/cpp/test/util/scoped_ptr_unittest.cc
index 250ffca..633625c 100644
--- a/cpp/test/util/scoped_ptr_unittest.cc
+++ b/cpp/test/util/scoped_ptr_unittest.cc
@@ -9,6 +9,8 @@
#include <libaddressinput/util/basictypes.h>
+#include <cstddef>
+
#include <gtest/gtest.h>
namespace {
diff --git a/cpp/test/util/string_util_test.cc b/cpp/test/util/string_util_test.cc
index 9933b31..e7de1fc 100644
--- a/cpp/test/util/string_util_test.cc
+++ b/cpp/test/util/string_util_test.cc
@@ -15,6 +15,7 @@
#include "util/string_util.h"
#include <string>
+#include <vector>
#include <gtest/gtest.h>
diff --git a/cpp/test/validation_task_test.cc b/cpp/test/validation_task_test.cc
index 011a978..e3900bd 100644
--- a/cpp/test/validation_task_test.cc
+++ b/cpp/test/validation_task_test.cc
@@ -34,8 +34,6 @@
namespace i18n {
namespace addressinput {
-class LookupKey;
-
class ValidationTaskTest : public testing::Test {
protected:
ValidationTaskTest()