Skip to content

Commit

Permalink
Update Error Prone tests for the Android Lint version of `CheckReturn…
Browse files Browse the repository at this point in the history
…Value`.

PiperOrigin-RevId: 499291765
  • Loading branch information
chaoren authored and Error Prone Team committed Jan 4, 2023
1 parent a604633 commit e8c8cc0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void negativeCase() {
public void packageAnnotation() {
compilationHelper
.addSourceLines(
"package-info.java", //
"lib/package-info.java", //
"@com.google.errorprone.annotations.CheckReturnValue",
"package lib;")
.addSourceLines(
Expand Down Expand Up @@ -153,7 +153,7 @@ public void classAnnotation() {
public void voidReturningMethodInAnnotatedPackage() {
compilationHelper
.addSourceLines(
"package-info.java", //
"lib/package-info.java", //
"@com.google.errorprone.annotations.CheckReturnValue",
"package lib;")
.addSourceLines(
Expand All @@ -176,7 +176,7 @@ public void voidReturningMethodInAnnotatedPackage() {
public void badCRVOnProcedure() {
compilationHelper
.addSourceLines(
"Test.java",
"lib/Test.java",
"package lib;",
"@com.google.errorprone.annotations.CheckReturnValue",
"public class Test {",
Expand All @@ -191,7 +191,7 @@ public void badCRVOnProcedure() {
public void badCRVOnPseudoProcedure() {
compilationHelper
.addSourceLines(
"Test.java",
"lib/Test.java",
"package lib;",
"@com.google.errorprone.annotations.CheckReturnValue",
"public class Test {",
Expand All @@ -208,7 +208,7 @@ public void badCRVOnPseudoProcedure() {
public void packageAnnotationButCanIgnoreReturnValue() {
compilationHelper
.addSourceLines(
"package-info.java",
"lib/package-info.java",
"@com.google.errorprone.annotations.CheckReturnValue",
"package lib;")
.addSourceLines(
Expand Down Expand Up @@ -253,7 +253,7 @@ public void classAnnotationButCanIgnoreReturnValue() {
public void badCanIgnoreReturnValueOnProcedure() {
compilationHelper
.addSourceLines(
"Test.java",
"lib/Test.java",
"package lib;",
"@com.google.errorprone.annotations.CheckReturnValue",
"public class Test {",
Expand Down Expand Up @@ -318,7 +318,7 @@ public void nestedClassWithCanIgnoreAnnotation() {
public void packageWithCanIgnoreAnnotation() {
compilationHelper
.addSourceLines(
"package-info.java",
"lib/package-info.java",
"@com.google.errorprone.annotations.CheckReturnValue",
"package lib;")
.addSourceLines(
Expand Down Expand Up @@ -371,7 +371,7 @@ public void errorBothMethod() {
public void javaLangVoidReturningMethodInAnnotatedPackage() {
compilationHelper
.addSourceLines(
"package-info.java",
"lib/package-info.java",
"@com.google.errorprone.annotations.CheckReturnValue",
"package lib;")
.addSourceLines(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class CheckReturnValueWellKnownLibrariesTest {
public void ignoreCRVOnMockito() {
compilationHelper
.addSourceLines(
"Test.java",
"lib/Test.java",
"package lib;",
"public class Test {",
" @com.google.errorprone.annotations.CheckReturnValue",
Expand Down Expand Up @@ -418,7 +418,7 @@ public void usingElementInTestExpected() {
public void autoValueBuilderSetterMethods() {
compilationHelper
.addSourceLines(
"Animal.java",
"com/google/frobber/Animal.java",
"package com.google.frobber;",
"import com.google.auto.value.AutoValue;",
"import com.google.errorprone.annotations.CheckReturnValue;",
Expand All @@ -438,7 +438,7 @@ public void autoValueBuilderSetterMethods() {
" }",
"}")
.addSourceLines(
"AnimalCaller.java",
"com/google/frobber/AnimalCaller.java",
"package com.google.frobber;",
"public final class AnimalCaller {",
" static void testAnimal() {",
Expand All @@ -456,7 +456,7 @@ public void autoValueBuilderSetterMethods() {
public void autoValueBuilderSetterMethodsOnInterface() {
compilationHelper
.addSourceLines(
"Animal.java",
"com/google/frobber/Animal.java",
"package com.google.frobber;",
"import com.google.auto.value.AutoValue;",
"import com.google.errorprone.annotations.CheckReturnValue;",
Expand All @@ -479,7 +479,7 @@ public void autoValueBuilderSetterMethodsOnInterface() {
" }",
"}")
.addSourceLines(
"AnimalCaller.java",
"com/google/frobber/AnimalCaller.java",
"package com.google.frobber;",
"public final class AnimalCaller {",
" static void testAnimal() {",
Expand All @@ -499,7 +499,7 @@ public void autoValueBuilderSetterMethodsOnInterface() {
public void autoValueGetterMethods() {
compilationHelper
.addSourceLines(
"Animal.java",
"com/google/frobber/Animal.java",
"package com.google.frobber;",
"import com.google.auto.value.AutoValue;",
"@AutoValue",
Expand All @@ -508,7 +508,7 @@ public void autoValueGetterMethods() {
" abstract int numberOfLegs();",
"}")
.addSourceLines(
"AnimalCaller.java",
"com/google/frobber/AnimalCaller.java",
"package com.google.frobber;",
"public final class AnimalCaller {",
" static void testAnimal() {",
Expand All @@ -529,13 +529,13 @@ public void autoValueGetterMethods() {
public void autoBuilderSetterMethods() {
compilationHelper
.addSourceLines(
"Person.java",
"com/google/frobber/Person.java",
"package com.google.frobber;",
"public final class Person {",
" public Person(String name, int id) {}",
"}")
.addSourceLines(
"PersonBuilder.java",
"com/google/frobber/PersonBuilder.java",
"package com.google.frobber;",
"import com.google.auto.value.AutoBuilder;",
"import com.google.errorprone.annotations.CheckReturnValue;",
Expand All @@ -550,7 +550,7 @@ public void autoBuilderSetterMethods() {
" Person build();",
"}")
.addSourceLines(
"PersonCaller.java",
"com/google/frobber/PersonCaller.java",
"package com.google.frobber;",
"public final class PersonCaller {",
" static void testPersonBuilder() {",
Expand All @@ -574,14 +574,14 @@ public void autoBuilderSetterMethods() {
public void autoBuilderSetterMethods_withInterface() {
compilationHelper
.addSourceLines(
"LogUtil.java",
"com/google/frobber/LogUtil.java",
"package com.google.frobber;",
"import java.util.logging.Level;",
"public class LogUtil {",
" public static void log(Level severity, String message) {}",
"}")
.addSourceLines(
"Caller.java",
"com/google/frobber/Caller.java",
"package com.google.frobber;",
"import com.google.auto.value.AutoBuilder;",
"import java.util.logging.Level;",
Expand All @@ -597,7 +597,7 @@ public void autoBuilderSetterMethods_withInterface() {
" void call(); // calls: LogUtil.log(severity, message)",
"}")
.addSourceLines(
"LogCaller.java",
"com/google/frobber/LogCaller.java",
"package com.google.frobber;",
"import java.util.logging.Level;",
"public final class LogCaller {",
Expand Down

0 comments on commit e8c8cc0

Please sign in to comment.