Skip to content

Commit

Permalink
rename test package from compoundOperationOnSharedAtomicVariables to …
Browse files Browse the repository at this point in the history
…compoundoperation
  • Loading branch information
JuditKnoll committed Dec 4, 2024
1 parent dec02fd commit f52b3a9
Show file tree
Hide file tree
Showing 30 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,47 +139,47 @@ void noBugSynchronizedBlockPrimitiveSeparateMethod() {

@Test
void noBugCompoundOpOnAtomicVariable() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundOperationOnSharedAtomicVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundOperationOnSharedAtomicVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 0);
}

@Test
void noBugCompoundOperationVolatileReadSyncWrite() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundAdditionOnSharedVolatileReadSyncWrite.class");
performAnalysis("multithreaded/compoundoperation/CompoundAdditionOnSharedVolatileReadSyncWrite.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 0);
}

@Test
void noBugCompoundOperationReadWriteLock() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundNegateReadWriteLock.class");
performAnalysis("multithreaded/compoundoperation/CompoundNegateReadWriteLock.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 0);
}

@Test
void noBugCompoundOperationOnNotSharedVariable() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundDivisionOnVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundDivisionOnVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 0);
}

@Test
void noBugCompoundOperationInSynchronizedBlock() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/SynchronizedBlockCompoundOperationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/SynchronizedBlockCompoundOperationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 0);
}

@Test
void noBugCompoundOperationInSynchronizedMethod() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/SynchronizedMethodCompoundOperationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/SynchronizedMethodCompoundOperationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 0);
Expand All @@ -188,7 +188,7 @@ void noBugCompoundOperationInSynchronizedMethod() {
// --num
@Test
void bugForCompoundPreDecrementation() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundPreDecrementationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundPreDecrementationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -198,7 +198,7 @@ void bugForCompoundPreDecrementation() {
// num--
@Test
void bugForCompoundPostDecrementation() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundPostDecrementationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundPostDecrementationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -208,7 +208,7 @@ void bugForCompoundPostDecrementation() {
// ++num
@Test
void bugForCompoundPreIncrementation() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundPreIncrementationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundPreIncrementationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -219,7 +219,7 @@ void bugForCompoundPreIncrementation() {
@Test
void bugForCompoundPostIncrementation() {
// The order of the functions is reversed
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundPostIncrementationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundPostIncrementationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -230,7 +230,7 @@ void bugForCompoundPostIncrementation() {
@Test
void bugForCompoundIAND() {
// considered multithreaded because it has a volatile field (not the problematic)
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundIANDOperationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundIANDOperationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -241,7 +241,7 @@ void bugForCompoundIAND() {
@Test
void bugForCompoundIOR() {
// considered multithreaded because it has a field (not the problematic) from the java.util.concurrent.atomic package
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundIOROperationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundIOROperationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -252,7 +252,7 @@ void bugForCompoundIOR() {
@Test
void bugForCompoundLogicalRightShift() {
// considered multithreaded because it extends Thread
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundLogicalRightShiftingOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundLogicalRightShiftingOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -263,7 +263,7 @@ void bugForCompoundLogicalRightShift() {
@Test
void bugForCompoundRightShift() {
// considered multithreaded because it has a method with synchronized block
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundRightShiftingOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundRightShiftingOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -274,7 +274,7 @@ void bugForCompoundRightShift() {
@Test
void bugForCompoundLeftShift() {
// considered multithreaded because it has synchronized method
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundLeftShiftingOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundLeftShiftingOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -285,7 +285,7 @@ void bugForCompoundLeftShift() {
@Test
void bugForCompoundModulo() {
// considered multithreaded because it implements Runnable
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundModuloOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundModuloOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -295,7 +295,7 @@ void bugForCompoundModulo() {
// *=
@Test
void bugForCompoundMultiplication() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundMultiplicationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundMultiplicationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -305,7 +305,7 @@ void bugForCompoundMultiplication() {
// /=
@Test
void bugForCompoundDivision() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundDivisionOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundDivisionOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -315,7 +315,7 @@ void bugForCompoundDivision() {
// -=
@Test
void bugForCompoundSubtraction() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundSubtractionOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundSubtractionOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -327,7 +327,7 @@ void bugForCompoundSubtraction() {
@Test
void bugForCompoundAdditionOnVolatileVar() {
// simply defining the field as volatile is not enough
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundAdditionOnSharedVolatileVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundAdditionOnSharedVolatileVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -338,7 +338,7 @@ void bugForCompoundAdditionOnVolatileVar() {
@Test
void bugForCompoundXOR() {
// considered multithreaded because it has a field (not the problematic) with synchronized assignment
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundXOROperationOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundXOROperationOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -348,7 +348,7 @@ void bugForCompoundXOR() {
// num = num + 2
@Test
void bugForSimpleAdditionDependingOnPrevValue() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/AdditionOnSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/AdditionOnSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -358,7 +358,7 @@ void bugForSimpleAdditionDependingOnPrevValue() {
// num = -num
@Test
void bugForNegateDependingOnPrevValue() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/NegateSharedVariable.class");
performAnalysis("multithreaded/compoundoperation/NegateSharedVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -368,7 +368,7 @@ void bugForNegateDependingOnPrevValue() {
// num -= num + 2
@Test
void bugForCompoundSubtractionComplex() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundSubstractComplexExpression.class");
performAnalysis("multithreaded/compoundoperation/CompoundSubstractComplexExpression.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -378,7 +378,7 @@ void bugForCompoundSubtractionComplex() {
// num += num2 + 5
@Test
void bugForCompoundAdditionComplexWithAnotherVar() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundAdditionComplexExpressionWithAnotherVar.class");
performAnalysis("multithreaded/compoundoperation/CompoundAdditionComplexExpressionWithAnotherVar.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -388,7 +388,7 @@ void bugForCompoundAdditionComplexWithAnotherVar() {
// num2 = num; num += 1
@Test
void bugForCompoundAdditionWithAnotherVar() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundAdditionWithAnotherVar.class");
performAnalysis("multithreaded/compoundoperation/CompoundAdditionWithAnotherVar.class");
assertBugTypeCount(PRIMITIVE_BUG, 1);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -399,7 +399,7 @@ void bugForCompoundAdditionWithAnotherVar() {
// num += param
@Test
void bugForCompoundSubstractionOfArg() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundSubstractionOfArg.class");
performAnalysis("multithreaded/compoundoperation/CompoundSubstractionOfArg.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -409,7 +409,7 @@ void bugForCompoundSubstractionOfArg() {
// num += getOne()
@Test
void bugForCompoundSubstractionOfFunCall() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundSubstractionOfMethodReturnValue.class");
performAnalysis("multithreaded/compoundoperation/CompoundSubstractionOfMethodReturnValue.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 1);
Expand All @@ -418,7 +418,7 @@ void bugForCompoundSubstractionOfFunCall() {

@Test
void bugForTwoCompoundOperations() {
performAnalysis("multithreaded/compoundOperationOnSharedVariables/CompoundDivideMultiplyOnVariable.class");
performAnalysis("multithreaded/compoundoperation/CompoundDivideMultiplyOnVariable.class");
assertBugTypeCount(PRIMITIVE_BUG, 0);
assertBugTypeCount(WRITE_64BIT_BUG, 0);
assertBugTypeCount(OPS_BUG, 2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class AdditionOnSharedVariable extends Thread {
private int num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundAdditionComplexExpressionWithAnotherVar extends Thread {
private int num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundAdditionOnSharedVolatileReadSyncWrite extends Thread {
private volatile int num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundAdditionOnSharedVolatileVariable extends Thread {
private volatile int num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundAdditionWithAnotherVar extends Thread {
private int num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundDivideMultiplyOnVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundDivisionOnSharedVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundDivisionOnVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundIANDOperationOnSharedVariable {
private int num = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

import java.util.concurrent.atomic.AtomicInteger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundLeftShiftingOnSharedVariable {
private int num = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundLogicalRightShiftingOnSharedVariable extends Thread {
private int num = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundModuloOnSharedVariable implements Runnable {
private Integer num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundMultiplicationOnSharedVariable extends Thread {
private Integer num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

import java.util.concurrent.atomic.AtomicInteger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundPostDecrementationOnSharedVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundPostIncrementationOnSharedVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundPreDecrementationOnSharedVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundPreIncrementationOnSharedVariable extends Thread {
private double num = 3.0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundRightShiftingOnSharedVariable {
private int num = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundSubstractComplexExpression extends Thread {
private int num = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multithreaded.compoundOperationOnSharedVariables;
package multithreaded.compoundoperation;

public class CompoundSubstractionOfArg extends Thread {
private int num = 0;
Expand Down
Loading

0 comments on commit f52b3a9

Please sign in to comment.