diff options
author | Elliott Hughes <enh@google.com> | 2014-08-19 14:30:30 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-08-19 14:30:30 -0700 |
commit | 09c39d6df0e952620f8c1751377b559a04e023aa (patch) | |
tree | 1ca25e04d3ed7ebea1dde6f4d3baaeee9526c0e5 /tests/libgen_test.cpp | |
parent | c5d6df6f2fe57fd5aadbd9ebb131023234c30a0c (diff) | |
download | android_bionic-09c39d6df0e952620f8c1751377b559a04e023aa.tar.gz android_bionic-09c39d6df0e952620f8c1751377b559a04e023aa.tar.bz2 android_bionic-09c39d6df0e952620f8c1751377b559a04e023aa.zip |
Implement the GNU basename(3) in addition to the POSIX one.
Code like perf(1) needs this.
Bug: 11860789
Change-Id: I907eb448052a7b165e4012d74303330d32328cb2
Diffstat (limited to 'tests/libgen_test.cpp')
-rw-r--r-- | tests/libgen_test.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/libgen_test.cpp b/tests/libgen_test.cpp index cae646f25..d0402dbf6 100644 --- a/tests/libgen_test.cpp +++ b/tests/libgen_test.cpp @@ -14,11 +14,10 @@ * limitations under the License. */ -#include <gtest/gtest.h> - #include <libgen.h> #include <errno.h> +#include <gtest/gtest.h> static void TestBasename(const char* in, const char* expected_out) { char* writable_in = (in != NULL) ? strdup(in) : NULL; @@ -40,7 +39,7 @@ static void TestDirname(const char* in, const char* expected_out) { // Do not use basename as the test name, it's defined to another value in glibc // so leads to a differently named test on host versus target architectures. -TEST(libgen, basename_smoke) { +TEST(libgen, posix_basename) { TestBasename(NULL, "."); TestBasename("", "."); TestBasename("/usr/lib", "lib"); |