<commit_before>#include "solo5.h"

#define SECTOR_SIZE	512

int check_sector_write(uint64_t offset)
{
    uint8_t sector_write[SECTOR_SIZE];
    uint8_t sector_read[SECTOR_SIZE];
    int n = SECTOR_SIZE;
    int i;

    for (i = 0; i < SECTOR_SIZE; i++)
        sector_write[i] = '0' + i % 10;

    solo5_blk_write_sync(offset, sector_write, SECTOR_SIZE);
    solo5_blk_read_sync(offset, sector_read, &n);

    if (n != SECTOR_SIZE)
        return 1;
    
    for (i = 0; i < SECTOR_SIZE; i++) {
        if (sector_read[i] != '0' + i % 10)
            /* Check failed */
            return 1;
    }

    return 0;
}

/* Returns 0 if the tests pass, 1 otherwise. */
int solo5_app_main(char *cmdline __attribute__((unused)))
{
    uint64_t i;

    /* Write and read/check one tenth of the disk. */
    for (i = 0; i < solo5_blk_sectors(); i += 10) {
        if (check_sector_write(i * SECTOR_SIZE))
            /* Check failed */
            return 1;
    }
<commit_msg>test-blk is using byte offsets instead of LBAs<commit_after>#include "solo5.h"

#define SECTOR_SIZE	512

static uint8_t sector_write[SECTOR_SIZE];
static uint8_t sector_read[SECTOR_SIZE];

int check_sector_write(uint64_t sector)
{
    int n = SECTOR_SIZE;
    int i;

    for (i = 0; i < SECTOR_SIZE; i++) {
        sector_write[i] = '0' + i % 10;
        sector_read[i] = 0;
    }

    solo5_blk_write_sync(sector, sector_write, SECTOR_SIZE);
    solo5_blk_read_sync(sector, sector_read, &n);

    if (n != SECTOR_SIZE)
        return 1;
    
    for (i = 0; i < SECTOR_SIZE; i++) {
        if (sector_read[i] != '0' + i % 10)
            /* Check failed */
            return 1;
    }

    return 0;
}

/* Returns 0 if the tests pass, 1 otherwise. */
int solo5_app_main(char *cmdline __attribute__((unused)))
{
    uint64_t i;

    /* Write and read/check one tenth of the disk. */
    for (i = 0; i < solo5_blk_sectors(); i += 10) {
        if (check_sector_write(i))
            /* Check failed */
            return 1;
    }

{'fraction_non_alphanumeric': 0.12512512512512514, 'fraction_numerical': 0.03153153153153153, 'mean_word_length': 2.3709949409780777, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '1847860', 'n_tokens_mistral': 791, 'n_tokens_neox': 735, 'n_words': 192}