From bf0e5604c49401c94e22c4877b826efd7aa056c9 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Fri, 19 Oct 2012 16:07:02 +0000 Subject: [PATCH] Making fileutils test handle any checkout dir This is needed since the checkout dir is not always named 'trunk', e.g. on branches and buildbot checkouts. BUG=Tests fails if checkout dir is not named trunk. TEST=test_support_unittests in a couple of different working directory setups. Review URL: https://webrtc-codereview.appspot.com/915004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2957 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/test/testsupport/fileutils_unittest.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/test/testsupport/fileutils_unittest.cc b/src/test/testsupport/fileutils_unittest.cc index 940b07042..54a308e32 100644 --- a/src/test/testsupport/fileutils_unittest.cc +++ b/src/test/testsupport/fileutils_unittest.cc @@ -94,12 +94,10 @@ std::string FileUtilsTest::original_working_dir_ = ""; // directory that is automatically set when the test executable is launched. // The test is not fully testing the implementation, since we cannot be sure // of where the executable was launched from. -// The test will fail if the top level directory is not named "trunk". -TEST_F(FileUtilsTest, ProjectRootPathFromUnchangedWorkingDir) { - std::string path = webrtc::test::ProjectRootPath(); - std::string expected_end = "trunk"; - expected_end = kPathDelimiter + expected_end + kPathDelimiter; - ASSERT_EQ(path.length() - expected_end.length(), path.find(expected_end)); +TEST_F(FileUtilsTest, ProjectRootPath) { + std::string project_root = webrtc::test::ProjectRootPath(); + // Not very smart, but at least tests something. + ASSERT_GT(project_root.length(), 0u); } // Similar to the above test, but for the output dir