Index: pnacl/driver/tests/path_length_test.py |
diff --git a/pnacl/driver/tests/path_length_test.py b/pnacl/driver/tests/path_length_test.py |
index 39d4077233f027cc044f7bae32d156a8598da249..45dc390704f10c5db8688efad1398fe701c5e314 100644 |
--- a/pnacl/driver/tests/path_length_test.py |
+++ b/pnacl/driver/tests/path_length_test.py |
@@ -33,12 +33,17 @@ class TestPathNames(driver_test_utils.DriverTesterCommon): |
self.cwd_backup = os.getcwd() |
self.LongTempDir = os.path.join(self.cwd_backup, 'a' * dir_len) |
os.mkdir(self.LongTempDir) |
+ # Create a directory whose path will be exactly 235 chars long |
Karl
2015/02/20 16:30:43
Should there be a check to verify that the path is
jvoung (off chromium)
2015/02/23 22:12:00
Added an assert that it's exactly 235 (if that's w
Karl
2015/02/23 22:18:18
Actually, what I meant (both here and with path te
jvoung (off chromium)
2015/02/23 22:41:22
I see, I added another check for cwd's len.
|
+ shorter_dir_len = 235 - cwd_len - 1 |
+ self.ShorterTempDir = os.path.join(self.cwd_backup, 'a' * shorter_dir_len) |
+ os.mkdir(self.ShorterTempDir) |
def tearDown(self): |
super(TestPathNames, self).tearDown() |
os.chdir(self.cwd_backup) |
sys.exit = self.backup_exit |
shutil.rmtree(self.LongTempDir) |
+ shutil.rmtree(self.ShorterTempDir) |
def WriteCFile(self, filename): |
with open(filename, 'w') as f: |
@@ -56,7 +61,7 @@ class TestPathNames(driver_test_utils.DriverTesterCommon): |
if not driver_test_utils.CanRunHost(): |
return |
- name = os.path.join(self.LongTempDir, 'a file') |
+ name = os.path.join(self.ShorterTempDir, 'a file') |
self.WriteCFile(name + '.c') |
driver_tools.RunDriver('pnacl-clang', |
[name + '.c', '-c', '-o', name + '.o']) |