Correct isThirdParty check
Previously, isThirdParty check was over-selecting for third-party-ness,
the only non-third-party paths were those explicitly excluded from
typically third party directories, results in ~all code being considered
third party.
Updated test to ensure bionic is not considered third party, which fails
without this change.
Test: go soong tests
Change-Id: Id371aaad2ceef2b3163384fa84712397877cbe90
diff --git a/cc/compiler_test.go b/cc/compiler_test.go
index c301388..a3ee4a6 100644
--- a/cc/compiler_test.go
+++ b/cc/compiler_test.go
@@ -19,23 +19,24 @@
)
func TestIsThirdParty(t *testing.T) {
- shouldFail := []string{
+ thirdPartyPaths := []string{
"external/foo/",
"vendor/bar/",
"hardware/underwater_jaguar/",
}
- shouldPass := []string{
+ nonThirdPartyPaths := []string{
"vendor/google/cts/",
"hardware/google/pixel",
"hardware/interfaces/camera",
"hardware/ril/supa_ril",
+ "bionic/libc",
}
- for _, path := range shouldFail {
+ for _, path := range thirdPartyPaths {
if !isThirdParty(path) {
t.Errorf("Expected %s to be considered third party", path)
}
}
- for _, path := range shouldPass {
+ for _, path := range nonThirdPartyPaths {
if isThirdParty(path) {
t.Errorf("Expected %s to *not* be considered third party", path)
}