diff --git a/components/misc/tests/slice_test.cpp b/components/misc/tests/slice_test.cpp index 950194279f..a0ea55311d 100644 --- a/components/misc/tests/slice_test.cpp +++ b/components/misc/tests/slice_test.cpp @@ -8,21 +8,21 @@ using namespace std; int main() { - SString s, t; - s = SString("hello"); + Misc::SString s, t; + s = Misc::SString("hello"); cout << s.toString() << ", len=" << s.length << endl; cout << (s=="hel") << (s=="hell") << (s=="hello") << endl; t = s; - s = SString("othello"+2, 4); + s = Misc::SString("othello"+2, 4); cout << s.toString() << ", len=" << s.length << endl; cout << (s=="hel") << (s=="hell") << (s=="hello") << endl; - cout << (s==t) << (SString("hello")==t) << endl; + cout << (s==t) << (Misc::SString("hello")==t) << endl; const int arr[4] = {1,2,3,4}; - IntArray ia(arr,4); + Misc::IntArray ia(arr,4); cout << ia.length << " " << ia.ptr[2] << endl; diff --git a/components/misc/tests/strops_test.cpp b/components/misc/tests/strops_test.cpp index ca5bd55a9c..2a1fdd77d0 100644 --- a/components/misc/tests/strops_test.cpp +++ b/components/misc/tests/strops_test.cpp @@ -4,45 +4,45 @@ int main() { - assert(begins("abc", "a")); - assert(begins("abc", "ab")); - assert(begins("abc", "abc")); - assert(begins("abcd", "abc")); - - assert(!begins("abc", "b")); - assert(!begins("abc", "bc")); - assert(!begins("abc", "bcd")); - assert(!begins("abc", "abcd")); - - assert(ibegins("Abc", "a")); - assert(ibegins("aBc", "ab")); - assert(ibegins("abC", "abc")); - assert(ibegins("abcD", "abc")); - - assert(!ibegins("abc", "b")); - assert(!ibegins("abc", "bc")); - assert(!ibegins("abc", "bcd")); - assert(!ibegins("abc", "abcd")); - - assert(ends("abc", "c")); - assert(ends("abc", "bc")); - assert(ends("abc", "abc")); - assert(ends("abcd", "abcd")); - - assert(!ends("abc", "b")); - assert(!ends("abc", "ab")); - assert(!ends("abc", "bcd")); - assert(!ends("abc", "abcd")); - - assert(iends("Abc", "c")); - assert(iends("aBc", "bc")); - assert(iends("abC", "abc")); - assert(iends("abcD", "abcd")); - - assert(!iends("abc", "b")); - assert(!iends("abc", "ab")); - assert(!iends("abc", "bcd")); - assert(!iends("abc", "abcd")); + assert(Misc::begins("abc", "a")); + assert(Misc::begins("abc", "ab")); + assert(Misc::begins("abc", "abc")); + assert(Misc::begins("abcd", "abc")); + + assert(!Misc::begins("abc", "b")); + assert(!Misc::begins("abc", "bc")); + assert(!Misc::begins("abc", "bcd")); + assert(!Misc::begins("abc", "abcd")); + + assert(Misc::ibegins("Abc", "a")); + assert(Misc::ibegins("aBc", "ab")); + assert(Misc::ibegins("abC", "abc")); + assert(Misc::ibegins("abcD", "abc")); + + assert(!Misc::ibegins("abc", "b")); + assert(!Misc::ibegins("abc", "bc")); + assert(!Misc::ibegins("abc", "bcd")); + assert(!Misc::ibegins("abc", "abcd")); + + assert(Misc::ends("abc", "c")); + assert(Misc::ends("abc", "bc")); + assert(Misc::ends("abc", "abc")); + assert(Misc::ends("abcd", "abcd")); + + assert(!Misc::ends("abc", "b")); + assert(!Misc::ends("abc", "ab")); + assert(!Misc::ends("abc", "bcd")); + assert(!Misc::ends("abc", "abcd")); + + assert(Misc::iends("Abc", "c")); + assert(Misc::iends("aBc", "bc")); + assert(Misc::iends("abC", "abc")); + assert(Misc::iends("abcD", "abcd")); + + assert(!Misc::iends("abc", "b")); + assert(!Misc::iends("abc", "ab")); + assert(!Misc::iends("abc", "bcd")); + assert(!Misc::iends("abc", "abcd")); return 0; }