https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e8902450bcd2c24815aba…
commit e8902450bcd2c24815aba83536472b27743a8d19
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sat Jun 5 22:16:41 2021 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Jun 5 23:28:38 2021 +0200
[ATL_APITEST] Add some testcases for CString 'operator !='
---
modules/rostests/apitests/atl/CMakeLists.txt | 1 +
modules/rostests/apitests/atl/CString.inl | 18 +++++++++++++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/apitests/atl/CMakeLists.txt
b/modules/rostests/apitests/atl/CMakeLists.txt
index 8f12a5071aa..bc3184793de 100644
--- a/modules/rostests/apitests/atl/CMakeLists.txt
+++ b/modules/rostests/apitests/atl/CMakeLists.txt
@@ -17,6 +17,7 @@ list(APPEND SOURCE
CSimpleArray.cpp
CSimpleMap.cpp
CString.cpp
+ CString.inl
SubclassWindow.cpp)
list(APPEND PCH_SKIP_SOURCE
diff --git a/modules/rostests/apitests/atl/CString.inl
b/modules/rostests/apitests/atl/CString.inl
index c0d661cfb8e..865804dc3a1 100644
--- a/modules/rostests/apitests/atl/CString.inl
+++ b/modules/rostests/apitests/atl/CString.inl
@@ -122,10 +122,27 @@ TEST_NAMEX(compare)
ok(s2[0] == _X('s'), "Expected s2[0] to be s, was: %c\n",
(char)s2[0]);
ok(s1 == _X("SOME TEXT 1!"), "Expected s1 to be 'SOME TEXT
1!', was: %s\n", dbgstrx(s1));
+ ok(s1 != _X("SOME TEXT 2!"), "Expected s2 not to match 'SOME TEXT
2!', was: %s\n", dbgstrx(s1));
+ ok(!(s1 != _X("SOME TEXT 1!")), "Expected s1 to be 'SOME TEXT
1!', was: %s\n", dbgstrx(s1));
CStringX s3 = s1.MakeLower();
ok(s1 == _X("some text 1!"), "Expected s1 to be 'some text
1!', was: %s\n", dbgstrx(s1));
ok(s1 == s3, "Expected s1 and s3 to be equal: '%s' ==
'%s'\n", dbgstrx(s1), dbgstrx(s3));
+ ok(!(s1 != s3), "Expected s1 and s3 to be equal: !('%s' ==
'%s')\n", dbgstrx(s1), dbgstrx(s3));
+
+ // Compare as chars
+ s1 = _X("Q");
+ ok(s1 == 'Q', "Expected s1 to be 'Q', was: %s\n",
dbgstrx(s1));
+ ok(!(s1 != 'Q'), "Expected s1 to be 'Q' (!=), was: %s\n",
dbgstrx(s1));
+ ok(s1 != 'S', "Expected s1 to be different from 'S', was:
%s\n", dbgstrx(s1));
+
+ s1.Empty();
+ ok(s1 != 'S', "Expected s1 to be different from 'S', was:
%s\n", dbgstrx(s1));
+ ok(s1 != 'Q', "Expected s1 to be different from 'S', was:
%s\n", dbgstrx(s1));
+
+ s1 = _X("QQ");
+ ok(s1 != 'S', "Expected s1 to be different from 'S', was:
%s\n", dbgstrx(s1));
+ ok(s1 != 'Q', "Expected s1 to be different from 'S', was:
%s\n", dbgstrx(s1));
}
@@ -522,7 +539,6 @@ TEST_NAMEX(tokenize)
// Calling with an empty pszTokens behaves exactly the same
res = str.Tokenize(_X(""), nCurPos);
- ok(res == _X(""), "Expected str to be 'st', was: %s\n",
dbgstrx(res));
ok(res == _X(""), "Expected str to be '', was: %s\n",
dbgstrx(res));
ok_dec(nCurPos, -1);
}