Mantis: #18 - Move components from global namespace into their own namespace.

Updated components/misc tests.

Signed-off-by: Lukasz Gromanowski <lgromanowski@gmail.com>
pull/21/head
Lukasz Gromanowski 14 years ago
parent 90985e849e
commit 514b55766f

@ -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;

@ -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;
}

Loading…
Cancel
Save