Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Unified Diff: webrtc/base/versionparsing_unittest.cc

Issue 2373003002: Delete unused file versionparsing.h. (Closed)
Patch Set: Rebased. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/versionparsing.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/versionparsing_unittest.cc
diff --git a/webrtc/base/versionparsing_unittest.cc b/webrtc/base/versionparsing_unittest.cc
deleted file mode 100644
index 51156991a63f8c91e36e91ffcd54840825436da0..0000000000000000000000000000000000000000
--- a/webrtc/base/versionparsing_unittest.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2010 The WebRTC Project Authors. All rights reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "webrtc/base/versionparsing.h"
-
-#include "webrtc/base/gunit.h"
-
-namespace rtc {
-
-static const int kExampleSegments = 4;
-
-typedef int ExampleVersion[kExampleSegments];
-
-TEST(VersionParsing, TestGoodParse) {
- ExampleVersion ver;
- std::string str1("1.1.2.0");
- static const ExampleVersion expect1 = {1, 1, 2, 0};
- EXPECT_TRUE(ParseVersionString(str1, kExampleSegments, ver));
- EXPECT_EQ(0, CompareVersions(ver, expect1, kExampleSegments));
- std::string str2("2.0.0.1");
- static const ExampleVersion expect2 = {2, 0, 0, 1};
- EXPECT_TRUE(ParseVersionString(str2, kExampleSegments, ver));
- EXPECT_EQ(0, CompareVersions(ver, expect2, kExampleSegments));
-}
-
-TEST(VersionParsing, TestBadParse) {
- ExampleVersion ver;
- std::string str1("1.1.2");
- EXPECT_FALSE(ParseVersionString(str1, kExampleSegments, ver));
- std::string str2("");
- EXPECT_FALSE(ParseVersionString(str2, kExampleSegments, ver));
- std::string str3("garbarge");
- EXPECT_FALSE(ParseVersionString(str3, kExampleSegments, ver));
-}
-
-TEST(VersionParsing, TestCompare) {
- static const ExampleVersion ver1 = {1, 0, 21, 0};
- static const ExampleVersion ver2 = {1, 1, 2, 0};
- static const ExampleVersion ver3 = {1, 1, 3, 0};
- static const ExampleVersion ver4 = {1, 1, 3, 9861};
-
- // Test that every combination of comparisons has the expected outcome.
- EXPECT_EQ(0, CompareVersions(ver1, ver1, kExampleSegments));
- EXPECT_EQ(0, CompareVersions(ver2, ver2, kExampleSegments));
- EXPECT_EQ(0, CompareVersions(ver3, ver3, kExampleSegments));
- EXPECT_EQ(0, CompareVersions(ver4, ver4, kExampleSegments));
-
- EXPECT_GT(0, CompareVersions(ver1, ver2, kExampleSegments));
- EXPECT_LT(0, CompareVersions(ver2, ver1, kExampleSegments));
-
- EXPECT_GT(0, CompareVersions(ver1, ver3, kExampleSegments));
- EXPECT_LT(0, CompareVersions(ver3, ver1, kExampleSegments));
-
- EXPECT_GT(0, CompareVersions(ver1, ver4, kExampleSegments));
- EXPECT_LT(0, CompareVersions(ver4, ver1, kExampleSegments));
-
- EXPECT_GT(0, CompareVersions(ver2, ver3, kExampleSegments));
- EXPECT_LT(0, CompareVersions(ver3, ver2, kExampleSegments));
-
- EXPECT_GT(0, CompareVersions(ver2, ver4, kExampleSegments));
- EXPECT_LT(0, CompareVersions(ver4, ver2, kExampleSegments));
-
- EXPECT_GT(0, CompareVersions(ver3, ver4, kExampleSegments));
- EXPECT_LT(0, CompareVersions(ver4, ver3, kExampleSegments));
-}
-
-} // namespace rtc
« no previous file with comments | « webrtc/base/versionparsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698