<commit_before>
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE libstorage

#include <boost/test/unit_test.hpp>
#include <iostream>

#include "storage/Devices/Bcache.h"
#include "storage/Devices/BcacheCset.h"
#include "storage/Devices/Encryption.h"

#include "storage/Filesystems/BlkFilesystem.h"
#include "storage/Filesystems/MountPoint.h"
#include "storage/Devices/LvmVg.h"
#include "storage/Devices/LvmPv.h"

#include "testsuite/CompoundAction/Fixture.h"

#define BLOCK_SIZE	1024L
#define kiB             1L
#define MiB		(1024L*kiB)
#define GiB		(1024L*MiB)
#define TiB		(1024L*GiB)


using std::cout;
using std::endl;


namespace storage
{
    namespace test
    {
	struct BCacheFixture: public CompoundActionFixture
	{
	    BCacheFixture():
		disk0(0),
		disk1(0),
		ssd0(0),
		ssd1(0),
                bcache0(0),
                bcache1(0),
                cset0(0),
                cset1(0)
	    {
                init_disks();
            }


	    void init_disks()
	    {
		Environment environment(true, ProbeMode::NONE, TargetMode::IMAGE);
		storage = shared_ptr<Storage>(new Storage(environment));
		staging = storage->get_staging();

		disk0 = Disk::create( staging, "/dev/sda", Region( 0,   2*TiB, BLOCK_SIZE ) );
		disk1 = Disk::create( staging, "/dev/sdb", Region( 0, 512*GiB, BLOCK_SIZE ) );

		ssd0  = Disk::create( staging, "/dev/sdf", Region( 0, 128*MiB, BLOCK_SIZE ) );
		ssd1  = Disk::create( staging, "/dev/sdg", Region( 0, 160*MiB, BLOCK_SIZE ) );

		copy_staging_to_probed();
	    }


            void init_bcaches()
            {
                init_bcache0();
                init_bcache1();
            }


            void init_bcache0()
            {
                cset0 = ssd0->create_bcache_cset();
                bcache0 = disk0->create_bcache( "/dev/bcache0" );
                bcache0->attach_bcache_cset( cset0 );
            }


            void init_bcache1()
            {
                cset1 = ssd1->create_bcache_cset();
                bcache1 = disk1->create_bcache( "/dev/bcache1" );<commit_msg>Use existing constants<commit_after>
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_MODULE libstorage

#include <boost/test/unit_test.hpp>
#include <iostream>

#include "storage/Devices/Bcache.h"
#include "storage/Devices/BcacheCset.h"
#include "storage/Devices/Encryption.h"

#include "storage/Filesystems/BlkFilesystem.h"
#include "storage/Filesystems/MountPoint.h"
#include "storage/Devices/LvmVg.h"
#include "storage/Devices/LvmPv.h"
#include "storage/Utils/HumanString.h"

#include "testsuite/CompoundAction/Fixture.h"

#define BLOCK_SIZE	512L

using std::cout;
using std::endl;


namespace storage
{
    namespace test
    {
	struct BCacheFixture: public CompoundActionFixture
	{
	    BCacheFixture():
		disk0(0),
		disk1(0),
		ssd0(0),
		ssd1(0),
                bcache0(0),
                bcache1(0),
                cset0(0),
                cset1(0)
	    {
                init_disks();
            }


	    void init_disks()
	    {
		Environment environment(true, ProbeMode::NONE, TargetMode::IMAGE);
		storage = shared_ptr<Storage>(new Storage(environment));
		staging = storage->get_staging();

		disk0 = Disk::create( staging, "/dev/sda", Region( 0,   2*TiB / BLOCK_SIZE, BLOCK_SIZE ) );
		disk1 = Disk::create( staging, "/dev/sdb", Region( 0, 512*GiB / BLOCK_SIZE, BLOCK_SIZE ) );

		ssd0  = Disk::create( staging, "/dev/sdf", Region( 0, 128*MiB / BLOCK_SIZE, BLOCK_SIZE ) );
		ssd1  = Disk::create( staging, "/dev/sdg", Region( 0, 160*MiB / BLOCK_SIZE, BLOCK_SIZE ) );

		copy_staging_to_probed();
	    }


            void init_bcaches()
            {
                init_bcache0();
                init_bcache1();
            }


            void init_bcache0()
            {
                cset0 = ssd0->create_bcache_cset();
                bcache0 = disk0->create_bcache( "/dev/bcache0" );
                bcache0->attach_bcache_cset( cset0 );
            }


            void init_bcache1()
            {
                cset1 = ssd1->create_bcache_cset();
                bcache1 = disk1->create_bcache( "/dev/bcache1" );
{'fraction_non_alphanumeric': 0.13055148853099072, 'fraction_numerical': 0.029282576866764276, 'mean_word_length': 2.427257525083612, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 21, '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': '5315051', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1413, 'n_words': 250}