Exemplo n.º 1
0
 void oops(U const &u) const
 {
     std::cerr
         << "> ERROR: CHECK failed \"" << expr_ << "\"\n"
         << "> \t" << filename_ << '(' << lineno_ << ')' << '\n';
     if(dismissed_)
         std::cerr
             << "> \tEXPECTED: " << stream(u) << "\n> \tACTUAL: " << stream(t_) << '\n';
     ++test_failures();
 }
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
#define BITMAP_BLOCKS	10

	struct dev *dev = &(struct dev){ .bits = 3 };
	/* This expect buffer is never reclaimed */
	init_buffers(dev, 1 << 20, 1);

	block_t volblocks = BITMAP_BLOCKS << (dev->bits + 3);
	struct sb *sb = rapid_sb(dev);
	sb->super = INIT_DISKSB(dev->bits, volblocks);
	setup_sb(sb, &sb->super);

	test_init(argv[0]);

	struct inode *bitmap = rapid_open_inode(sb, NULL, 0);
	sb->bitmap = bitmap;

	/* Setup buffers for bitmap */
	for (int block = 0; block < BITMAP_BLOCKS; block++) {
		struct buffer_head *buffer = blockget(bitmap->map, block);
		memset(bufdata(buffer), 0, sb->blocksize);
		set_buffer_clean(buffer);
		blockput(buffer);
	}

	/* Set fake backend mark to modify backend objects. */
	tux3_start_backend(sb);

	if (test_start("test01"))
		test01(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test02"))
		test02(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test03"))
		test03(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test04"))
		test04(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test05"))
		test05(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test06"))
		test06(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test07"))
		test07(sb, BITMAP_BLOCKS);
	test_end();

	if (test_start("test08"))
		test08(sb, BITMAP_BLOCKS);
	test_end();

	tux3_end_backend();

	clean_main(sb);

	return test_failures();
}