aboutsummaryrefslogtreecommitdiff
path: root/test/common
diff options
context:
space:
mode:
Diffstat (limited to 'test/common')
-rw-r--r--test/common/algorithm.h24
-rw-r--r--test/common/str.h18
2 files changed, 21 insertions, 21 deletions
diff --git a/test/common/algorithm.h b/test/common/algorithm.h
index eeed59d821..13c0a15b3f 100644
--- a/test/common/algorithm.h
+++ b/test/common/algorithm.h
@@ -28,8 +28,8 @@ class AlgorithmTestSuite : public CxxTest::TestSuite {
/**
* Auxiliary function to check the equality of two generic collections (A and B), from one_first to one_last.
*
- * @note: It assumes that other has at least (one_last - one-first) lenght, starting from other_first.
- *
+ * @note: It assumes that other has at least (one_last - one-first) lenght, starting from other_first.
+ *
* @param one_first: The first element of the first collection to be compared.
* @param one_last: The last element of the first collection to be compared.
* @param other_first: The first element of the collection to be compared.
@@ -37,19 +37,19 @@ class AlgorithmTestSuite : public CxxTest::TestSuite {
*/
template<typename It>
bool checkEqual(It one_first, It one_last, It other_first) {
- if (one_first == one_last)
+ if (one_first == one_last)
return true;
// Check whether two containers have the same items in the same order,
// starting from some iterators one_first and other_first
- //
+ //
// It iterates through the containers, comparing the elements one by one.
// If it finds a discrepancy, it returns false. Otherwise, it returns true.
- for (; one_first != one_last; ++one_first, ++other_first)
- if (*one_first != *other_first)
+ for (; one_first != one_last; ++one_first, ++other_first)
+ if (*one_first != *other_first)
return false;
-
+
return true;
}
@@ -125,19 +125,19 @@ public:
Common::sort(list.begin(), list.end());
TS_ASSERT_EQUALS(checkSort(list.begin(), list.end(), Common::Less<Item>()), true);
}
-
+
void test_string_replace() {
Common::String original = "Hello World";
Common::String expected = "Hells Wsrld";
Common::replace(original.begin(), original.end(), 'o', 's');
-
- TS_ASSERT_EQUALS(original, expected);
+
+ TS_ASSERT_EQUALS(original, expected);
}
void test_container_replace() {
-
+
Common::List<int> original;
Common::List<int> expected;
for (int i = 0; i < 6; ++i) {
@@ -150,7 +150,7 @@ public:
}
Common::replace(original.begin(), original.end(), 3, 5);
-
+
TS_ASSERT_EQUALS(checkEqual(original.begin(), original.end(), expected.begin()), true);
}
};
diff --git a/test/common/str.h b/test/common/str.h
index 461b26088a..c59c5a5efd 100644
--- a/test/common/str.h
+++ b/test/common/str.h
@@ -438,16 +438,16 @@ class StringTestSuite : public CxxTest::TestSuite
// Using iterators (also a terribly useless program as a test).
testString.replace(testString.begin(), testString.end(), "That is the supernew string.");
- TS_ASSERT_EQUALS(testString, Common::String("That is the supernew string."));
-
+ TS_ASSERT_EQUALS(testString, Common::String("That is the supernew string."));
+
// With sub strings of character arrays.
testString.replace(21, 6, "That phrase is new.", 5, 6);
TS_ASSERT_EQUALS(testString, Common::String("That is the supernew phrase."));
- // Now with substrings.
+ // Now with substrings.
testString.replace(12, 2, Common::String("That hy is new."), 5, 2);
TS_ASSERT_EQUALS(testString, Common::String("That is the hypernew phrase."));
-
+
// --------------------------
// Tests with displacement
// --------------------------
@@ -463,20 +463,20 @@ class StringTestSuite : public CxxTest::TestSuite
// Using iterators (also a terribly useless program as a test)
testString.replace(testString.begin() + 4, testString.begin() + 5, " coffee ");
- TS_ASSERT_EQUALS(testString, Common::String("Good coffee friends"));
+ TS_ASSERT_EQUALS(testString, Common::String("Good coffee friends"));
// With sub strings of character arrays
testString.replace(4, 0, "Lorem ipsum expresso dolor sit amet", 11, 9);
TS_ASSERT_EQUALS(testString, Common::String("Good expresso coffee friends"));
-
- // Now with substrings
+
+ // Now with substrings
testString.replace(5, 9, Common::String("Displaced ristretto string"), 10, 10);
TS_ASSERT_EQUALS(testString, Common::String("Good ristretto coffee friends"));
-
+
// -----------------------
// Deep copy compliance
// -----------------------
-
+
// Makes a deep copy without changing the length of the original
Common::String s1 = "TestTestTestTestTestTestTestTestTestTestTest";
Common::String s2(s1);