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

Unified Diff: tests/OSPathTest.cpp

Issue 16098011: Fix bug in setting directories for tests. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Respond to comments Created 7 years, 6 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 | « include/core/SkOSFile.h ('k') | tests/StreamTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/OSPathTest.cpp
diff --git a/tests/OSPathTest.cpp b/tests/OSPathTest.cpp
index 96ff8a712d173242e04ca2efb0470e161be80187..5ae32ebc0d352f854dd3d39999cfc5273d0e55bc 100644
--- a/tests/OSPathTest.cpp
+++ b/tests/OSPathTest.cpp
@@ -59,6 +59,12 @@ static void test_os_path_utils_tests(skiatest::Reporter* reporter) {
dir.appendUnichar(SkPATH_SEPARATOR);
test_dir_with_file(reporter, dir, filename);
+ // Test using no filename.
+ test_dir_with_file(reporter, dir, SkString());
+
+ // Testing using no directory.
+ test_dir_with_file(reporter, SkString(), filename);
+
// Test with a sub directory.
dir.append("subDir");
test_dir_with_file(reporter, dir, filename);
@@ -71,6 +77,11 @@ static void test_os_path_utils_tests(skiatest::Reporter* reporter) {
// Basename of NULL is an empty string.
SkString empty = SkOSPath::SkBasename(NULL);
REPORTER_ASSERT(reporter, empty.size() == 0);
+
+ // Test that NULL can be used for the directory and filename.
+ SkString emptyPath = SkOSPath::SkPathJoin(NULL, NULL);
+ REPORTER_ASSERT(reporter, emptyPath.size() == 1);
+ REPORTER_ASSERT(reporter, emptyPath.contains(SkPATH_SEPARATOR));
}
#include "TestClassDef.h"
« no previous file with comments | « include/core/SkOSFile.h ('k') | tests/StreamTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698