<commit_before>package org.jctools.queues;

import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.sameInstance;
import static org.jctools.queues.matchers.Matchers.emptyAndZeroSize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeThat;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Queue;
import java.util.concurrent.atomic.AtomicBoolean;

import org.jctools.queues.spec.ConcurrentQueueSpec;
import org.jctools.queues.spec.Ordering;
import org.jctools.queues.spec.Preference;
import org.jctools.util.Pow2;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class QueueSanityTest {

    private static final int SIZE = 8192 * 2;
    @Parameterized.Parameters
    public static Collection parameters() {
        ArrayList<Object[]> list = new ArrayList<Object[]>();
        list.add(test(1, 1, 1, Ordering.FIFO, null));
        list.add(test(1, 1, 0, Ordering.FIFO, null));
        list.add(test(1, 1, SIZE, Ordering.FIFO, null));
        list.add(test(1, 1, 32, Ordering.FIFO, new SpscGrowableArrayQueue<Integer>(4, 32)));
        list.add(test(1, 1, 0, Ordering.FIFO, new SpscUnboundedArrayQueue<Integer>(16)));
        list.add(test(1, 0, 1, Ordering.FIFO, null));
        list.add(test(1, 0, SIZE, Ordering.FIFO, null));
        list.add(test(0, 1, 0, Ordering.FIFO, null));
        list.add(test(0, 1, 1, Ordering.FIFO, null));
        list.add(test(0, 1, SIZE, Ordering.FIFO, null));
        list.add(test(0, 1, 1, Ordering.PRODUCER_FIFO, null));
        list.add(test(0, 1, SIZE, Ordering.PRODUCER_FIFO, null));
        // Compound queue minimal size is the core count
        list.add(test(0, 1, Runtime.getRuntime().availableProcessors(), Ordering.NONE, null));
        list.add(test(0, 1, SIZE, Ordering.NONE, null));
        // Mpmc minimal size is 2
        list.add(test(0, 0, 2, Ordering.FIFO, null));
        list.add(test(0, 0, SIZE, Ordering.FIFO, null));<commit_msg>Update test with minimal SPSC size<commit_after>package org.jctools.queues;

import static org.hamcrest.Matchers.hasSize;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.sameInstance;
import static org.jctools.queues.matchers.Matchers.emptyAndZeroSize;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeThat;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Queue;
import java.util.concurrent.atomic.AtomicBoolean;

import org.jctools.queues.spec.ConcurrentQueueSpec;
import org.jctools.queues.spec.Ordering;
import org.jctools.queues.spec.Preference;
import org.jctools.util.Pow2;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class QueueSanityTest {

    private static final int SIZE = 8192 * 2;
    @Parameterized.Parameters
    public static Collection parameters() {
        ArrayList<Object[]> list = new ArrayList<Object[]>();
        list.add(test(1, 1, 4, Ordering.FIFO, null));
        list.add(test(1, 1, 0, Ordering.FIFO, null));
        list.add(test(1, 1, SIZE, Ordering.FIFO, null));
        list.add(test(1, 1, 32, Ordering.FIFO, new SpscGrowableArrayQueue<Integer>(4, 32)));
        list.add(test(1, 1, 0, Ordering.FIFO, new SpscUnboundedArrayQueue<Integer>(16)));
        list.add(test(1, 0, 1, Ordering.FIFO, null));
        list.add(test(1, 0, SIZE, Ordering.FIFO, null));
        list.add(test(0, 1, 0, Ordering.FIFO, null));
        list.add(test(0, 1, 1, Ordering.FIFO, null));
        list.add(test(0, 1, SIZE, Ordering.FIFO, null));
        list.add(test(0, 1, 1, Ordering.PRODUCER_FIFO, null));
        list.add(test(0, 1, SIZE, Ordering.PRODUCER_FIFO, null));
        // Compound queue minimal size is the core count
        list.add(test(0, 1, Runtime.getRuntime().availableProcessors(), Ordering.NONE, null));
        list.add(test(0, 1, SIZE, Ordering.NONE, null));
        // Mpmc minimal size is 2
        list.add(test(0, 0, 2, Ordering.FIFO, null));
        list.add(test(0, 0, SIZE, Ordering.FIFO, null));
{'fraction_non_alphanumeric': 0.1359510238547604, 'fraction_numerical': 0.022799240025332488, 'mean_word_length': 4.051172707889126, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '937921', 'n_tokens_mistral': 1693, 'n_tokens_neox': 1604, 'n_words': 358}