<commit_before>/**
 * \author      <NAME> <EMAIL>
 * \brief       Tests for zerofizzbuzz.
 * \date        03/28/2015 04:33:14 AM
 * \file        test.c
 * \version     2.0
 *
 * Tests basic assumptions about functions core to zerofizzbuzz.
 **/

#include <assert.h> /* assert */
#include <limits.h> /* ULONG_MAX */
#include <stdio.h> /* puts */

static unsigned long int div15( unsigned long int const i )
{
    /* TODO: get rid of the division somehow */
    return i / 15;
}

static unsigned long int mod15( unsigned long int const i )
{
    unsigned long int const division = div15( i );
    return i - (( division << 4 ) - division );
}

int main( int argc, char * args[] )
{
    ( void ) argc;
    ( void ) args;

    puts( "testing div15" );
    {
        unsigned long int i;

        for( i = 0; i < ULONG_MAX; ++i )
        {
            assert(( i / 15 ) == div15( i ));
        }

        assert(( ULONG_MAX / 15 ) == div15( ULONG_MAX ));
    }
    puts( "ok" );

    puts( "testing mod15" );
    {
        unsigned long int i;

        for( i = 0; i < ULONG_MAX; ++i )
        {
            assert(( i % 15 ) == mod15( i ));
        }

        assert(( ULONG_MAX % 15 ) == mod15( ULONG_MAX ));
    }
    puts( "ok" );

    return 0;
}<commit_msg>reduced testing range to 10^8 as full ulong range test was taking forever<commit_after>/**
 * \author      <NAME> <EMAIL>
 * \brief       Tests for zerofizzbuzz.
 * \date        03/28/2015 04:33:14 AM
 * \file        test.c
 * \version     2.0
 *
 * Tests basic assumptions about functions core to zerofizzbuzz.
 **/

#include <assert.h> /* assert */
#include <limits.h> /* ULONG_MAX */
#include <stdio.h> /* puts */

static unsigned long int div15( unsigned long int const i )
{
    /* TODO: get rid of the division somehow */
    return i / 15;
}

static unsigned long int mod15( unsigned long int const i )
{
    unsigned long int const division = div15( i );
    return i - (( division << 4 ) - division );
}

int main( int argc, char * args[] )
{
    ( void ) argc;
    ( void ) args;

    puts( "testing div15" );
    {
        unsigned long int i;

        for( i = 0; i < 100000000U; ++i )
        {
            assert(( i / 15 ) == div15( i ));
        }

        assert(( ULONG_MAX / 15 ) == div15( ULONG_MAX ));
    }
    puts( "ok" );

    puts( "testing mod15" );
    {
        unsigned long int i;

        for( i = 0; i < 100000000U; ++i )
        {
            assert(( i % 15 ) == mod15( i ));
        }

        assert(( ULONG_MAX % 15 ) == mod15( ULONG_MAX ));
    }
    puts( "ok" );

    return 0;
}
{'fraction_non_alphanumeric': 0.14468580294802172, 'fraction_numerical': 0.04538401861908456, 'mean_word_length': 1.8247535596933186, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1396238', 'n_tokens_mistral': 965, 'n_tokens_neox': 872, 'n_words': 286}