diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-20 15:43:08 -0200 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-01-20 15:43:08 -0200 |
commit | d269265cebf40e2da5fb9ee4904d3ec815f06e80 (patch) | |
tree | 92f38e3fb48513a0144737bbafd51082995a0b5c | |
parent | f7f4da79cf71242a494ca407ccd26d64b1735cc5 (diff) |
Added another constructor to Str class, just to test the new char behaviour.
The new behaviour consists in accepting numbers or 1-sized strings when a
char is expected.
-rw-r--r-- | tests/libsample/str.cpp | 6 | ||||
-rw-r--r-- | tests/libsample/str.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/libsample/str.cpp b/tests/libsample/str.cpp index 87e1145ce..29dac75c7 100644 --- a/tests/libsample/str.cpp +++ b/tests/libsample/str.cpp @@ -45,6 +45,12 @@ Str::Str(const Str& s) init(s.cstring()); } +Str::Str(char c) +{ + char str[2] = { c, 0 }; + init(str); +} + Str::Str(const char* cstr) { init(cstr); diff --git a/tests/libsample/str.h b/tests/libsample/str.h index 1fe27ec8b..7cf62acbe 100644 --- a/tests/libsample/str.h +++ b/tests/libsample/str.h @@ -42,6 +42,7 @@ class LIBSAMPLE_API Str { public: Str(const Str& s); + Str(char c); Str(const char* cstr = ""); ~Str(); |