Permalink
Browse files

Replace tabs with spaces

  • Loading branch information...
1 parent 2a14993 commit 2822875ca9bef97bb88bf2bff17d91bae277badb @kayahr committed Aug 1, 2012
Showing with 60 additions and 60 deletions.
  1. +11 −11 src/image.cc
  2. +1 −1 src/image.h
  3. +1 −1 src/title_pic.h
  4. +30 −30 test/bit_reader_test.cc
  5. +6 −6 test/bit_reader_test.h
  6. +6 −6 test/image_test.h
  7. +5 −5 test/transparent_image_test.h
View
@@ -27,8 +27,8 @@ image::image(const int width, const int height)
this->width = width;
this->height = height;
int size = get_data_size(width, height);
- data = new char[size];
- memset(data, 0, size);
+ data = new char[size];
+ memset(data, 0, size);
}
/**
@@ -50,7 +50,7 @@ image::image(const image &image) :
*/
image::~image()
{
- delete[] data;
+ delete[] data;
}
/**
@@ -105,7 +105,7 @@ int image::get_data_index(const int x, const int y) const
*/
int image::get_width() const
{
- return width;
+ return width;
}
/**
@@ -115,7 +115,7 @@ int image::get_width() const
*/
int image::get_height() const
{
- return height;
+ return height;
}
/**
@@ -130,12 +130,12 @@ int image::get_height() const
*/
image::color image::get_color(const int x, const int y) const
{
- if (y < 0 || x < 0 || x >= width || y >= height) return 0;
- int index = get_data_index(x, y);
- if (x & 1)
- return (data[index] & 0xf0) >> 4;
- else
- return data[index] & 0xf;
+ if (y < 0 || x < 0 || x >= width || y >= height) return 0;
+ int index = get_data_index(x, y);
+ if (x & 1)
+ return (data[index] & 0xf0) >> 4;
+ else
+ return data[index] & 0xf;
}
/**
View
@@ -18,7 +18,7 @@ class image
{
public:
/** Type representing a single 4 bit color with valid values 0 - 15. */
- typedef char color;
+ typedef char color;
image(const int width, const int height);
image(const image& image);
View
@@ -45,7 +45,7 @@ namespace wasteland
class title_pic : public vxor_image
{
public:
- title_pic();
+ title_pic();
};
}
View
@@ -15,40 +15,40 @@ CPPUNIT_TEST_SUITE_REGISTRATION(bit_reader_test);
void bit_reader_test::test_read_bit()
{
- stringstream stream("wl");
- bit_reader reader(stream);
-
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
-
- CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
- CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
-
- CPPUNIT_ASSERT_EQUAL(-1, reader.read_bit());
+ stringstream stream("wl");
+ bit_reader reader(stream);
+
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
+
+ CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(1, reader.read_bit());
+ CPPUNIT_ASSERT_EQUAL(0, reader.read_bit());
+
+ CPPUNIT_ASSERT_EQUAL(-1, reader.read_bit());
}
void bit_reader_test::test_read_bits()
{
- stringstream stream("wl");
- bit_reader reader(stream);
-
- CPPUNIT_ASSERT_EQUAL(0b0111, reader.read_bits(4));
- CPPUNIT_ASSERT_EQUAL(0b11, reader.read_bits(2));
- CPPUNIT_ASSERT_EQUAL(0b0001, reader.read_bits(4));
- CPPUNIT_ASSERT_EQUAL(0b1011, reader.read_bits(4));
- CPPUNIT_ASSERT_EQUAL(-1, reader.read_bits(3));
+ stringstream stream("wl");
+ bit_reader reader(stream);
+
+ CPPUNIT_ASSERT_EQUAL(0b0111, reader.read_bits(4));
+ CPPUNIT_ASSERT_EQUAL(0b11, reader.read_bits(2));
+ CPPUNIT_ASSERT_EQUAL(0b0001, reader.read_bits(4));
+ CPPUNIT_ASSERT_EQUAL(0b1011, reader.read_bits(4));
+ CPPUNIT_ASSERT_EQUAL(-1, reader.read_bits(3));
}
}
View
@@ -14,14 +14,14 @@ namespace wasteland
class bit_reader_test: public CPPUNIT_NS::TestFixture
{
- CPPUNIT_TEST_SUITE(bit_reader_test);
- CPPUNIT_TEST(test_read_bit);
- CPPUNIT_TEST(test_read_bits);
- CPPUNIT_TEST_SUITE_END();
+ CPPUNIT_TEST_SUITE(bit_reader_test);
+ CPPUNIT_TEST(test_read_bit);
+ CPPUNIT_TEST(test_read_bits);
+ CPPUNIT_TEST_SUITE_END();
protected:
- void test_read_bit();
- void test_read_bits();
+ void test_read_bit();
+ void test_read_bits();
};
}
View
@@ -14,22 +14,22 @@ namespace wasteland
class image_test: public CPPUNIT_NS::TestFixture
{
- CPPUNIT_TEST_SUITE(image_test);
+ CPPUNIT_TEST_SUITE(image_test);
CPPUNIT_TEST(test_constructor);
CPPUNIT_TEST(test_copy_constructor);
CPPUNIT_TEST(test_assignment_operator);
- CPPUNIT_TEST(test_get_width);
+ CPPUNIT_TEST(test_get_width);
CPPUNIT_TEST(test_get_height);
CPPUNIT_TEST(test_get_set_color);
- CPPUNIT_TEST_SUITE_END();
+ CPPUNIT_TEST_SUITE_END();
protected:
void test_constructor();
void test_copy_constructor();
void test_assignment_operator();
- void test_get_width();
- void test_get_height();
- void test_get_set_color();
+ void test_get_width();
+ void test_get_height();
+ void test_get_set_color();
};
}
@@ -14,22 +14,22 @@ namespace wasteland
class transparent_image_test: public CPPUNIT_NS::TestFixture
{
- CPPUNIT_TEST_SUITE(transparent_image_test);
+ CPPUNIT_TEST_SUITE(transparent_image_test);
CPPUNIT_TEST(test_constructor);
CPPUNIT_TEST(test_copy_constructor);
CPPUNIT_TEST(test_assignment_operator);
- CPPUNIT_TEST(test_get_width);
+ CPPUNIT_TEST(test_get_width);
CPPUNIT_TEST(test_get_height);
CPPUNIT_TEST(test_get_set_color);
CPPUNIT_TEST(test_get_set_transparent);
- CPPUNIT_TEST_SUITE_END();
+ CPPUNIT_TEST_SUITE_END();
protected:
void test_constructor();
void test_copy_constructor();
void test_assignment_operator();
- void test_get_width();
- void test_get_height();
+ void test_get_width();
+ void test_get_height();
void test_get_set_color();
void test_get_set_transparent();
};

0 comments on commit 2822875

Please sign in to comment.