Index: base/version.h |
diff --git a/base/version.h b/base/version.h |
index b2ad7f596aee9b1b2b29dad92d41486d747273b0..6b0680a32d54b0e266379dc1d962e28a9318ce45 100644 |
--- a/base/version.h |
+++ b/base/version.h |
@@ -9,6 +9,7 @@ |
#include <vector> |
#include "base/basictypes.h" |
+#include "testing/gtest/include/gtest/gtest_prod.h" |
class Version { |
public: |
@@ -18,6 +19,11 @@ class Version { |
static Version* GetVersionFromString(const std::wstring& version_str); |
static Version* GetVersionFromString(const std::string& version_str); |
+ // Exposed only so that a Version can be stored in STL containers; |
+ // any call to the methods below on a default-constructed Version |
+ // will DCHECK. |
+ Version(); |
+ |
~Version() {} |
bool Equals(const Version& other) const; |
@@ -31,10 +37,14 @@ class Version { |
const std::vector<uint16>& components() const { return components_; } |
private: |
- Version() {} |
bool InitFromString(const std::string& version_str); |
+ bool is_valid_; |
std::vector<uint16> components_; |
+ |
+ FRIEND_TEST(VersionTest, DefaultConstructor); |
+ FRIEND_TEST(VersionTest, GetVersionFromString); |
+ FRIEND_TEST(VersionTest, Compare); |
}; |
#endif // BASE_VERSION_H_ |