Skip to content

Commit

Permalink
Added tests to cover the non-empty but all NULL case.
Browse files Browse the repository at this point in the history
  • Loading branch information
lbooker42 committed May 7, 2024
1 parent 448cd8c commit 5eadbcd
Showing 1 changed file with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,24 @@ public EnumSet<TableDiff.DiffItems> diffItems() {

// region Static Zero Key Tests

@Test
public void testStaticZeroKeyWithAllNullWindows() {
final QueryTable t = createTestTable(10000, false, false, false, 0x31313131).t;
t.setRefreshing(false);

// With a window size of 1 and 10% null generation, guaranteed to cover the all NULL case.
final int prevTicks = 1;
final int postTicks = 0;

final Table summed = t.updateBy(UpdateByOperation.RollingSum(prevTicks, postTicks));

for (String col : t.getDefinition().getColumnNamesArray()) {
assertWithRollingSumTicks(DataAccessHelpers.getColumn(t, col).getDirect(),
DataAccessHelpers.getColumn(summed, col).getDirect(),
DataAccessHelpers.getColumn(summed, col).getType(), prevTicks, postTicks);
}
}

@Test
public void testStaticZeroKeyRev() {
final QueryTable t = createTestTable(10000, false, false, false, 0x31313131).t;
Expand Down Expand Up @@ -313,6 +331,14 @@ public void testNullOnBucketChange() {
assertTableEquals(expected, r);
}

@Test
public void testStaticBucketedAllNull() {
// With a window size of 1 and 10% null generation, guaranteed to cover the all NULL case.
final int prevTicks = 1;
final int postTicks = 0;
doTestStaticBucketed(false, prevTicks, postTicks);
}

@Test
public void testStaticBucketedRev() {
final int prevTicks = 100;
Expand Down Expand Up @@ -445,6 +471,14 @@ private void doTestStaticBucketedTimed(boolean grouped, Duration prevTime, Durat

// region Live Tests

@Test
public void testZeroKeyAppendOnlyAllNull() {
// With a window size of 1 and 10% null generation, guaranteed to cover the all NULL case.
final int prevTicks = 1;
final int postTicks = 0;
doTestAppendOnly(false, prevTicks, postTicks);
}

@Test
public void testZeroKeyAppendOnlyRev() {
final int prevTicks = 100;
Expand Down Expand Up @@ -480,6 +514,14 @@ public void testZeroKeyAppendOnlyFwdRev() {
doTestAppendOnly(false, prevTicks, postTicks);
}

@Test
public void testBucketedAppendOnlyAllNull() {
// With a window size of 1 and 10% null generation, guaranteed to cover the all NULL case.
final int prevTicks = 1;
final int postTicks = 0;
doTestAppendOnly(true, prevTicks, postTicks);
}

@Test
public void testBucketedAppendOnlyRev() {
final int prevTicks = 100;
Expand Down

0 comments on commit 5eadbcd

Please sign in to comment.