X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=rostests%2Fapitests%2Fatl%2FCString.inl;h=cd016ade1d3f86d33c1afa433e6972f2629b8069;hp=28ed04d02c4b083cf328da5e4a9cb1e8872ef4ff;hb=447c0daf7de4e2dd10df3484b6f279e9f9293e51;hpb=92d1110c006fc6e89b0241a80ce03027993d22d8 diff --git a/rostests/apitests/atl/CString.inl b/rostests/apitests/atl/CString.inl index 28ed04d02c4..cd016ade1d3 100644 --- a/rostests/apitests/atl/CString.inl +++ b/rostests/apitests/atl/CString.inl @@ -388,3 +388,39 @@ TEST_NAMEX(env) ok(test.IsEmpty() == true, "Expected test to be empty\n"); ok(test.GetLength() == 0, "Expected GetLength() to be 0, was: %i\n", test.GetLength()); } + +TEST_NAMEX(load_str) +{ + CStringX str; + + ok(str.LoadString(0) == FALSE, "LoadString should fail.\n"); + + ok(str.LoadString(IDS_TEST1) == TRUE, "LoadString failed.\n"); + ok(str == _X("Test string one."), "The value was '%s'\n", dbgstrx(str)); + + ok(str.LoadString(IDS_TEST2) == TRUE, "LoadString failed.\n"); + ok(str == _X("I am a happy BSTR"), "The value was '%s'\n", dbgstrx(str)); + + ok(str.LoadString(0) == FALSE, "LoadString should fail.\n"); + ok(str == _X("I am a happy BSTR"), "The value was '%s'\n", dbgstrx(str)); + + XCHAR *xNULL = NULL; + CStringX str0(xNULL); + ok(str0.IsEmpty(), "str0 should be empty.\n"); + + YCHAR *yNULL = NULL; + CStringX str1(yNULL); + ok(str1.IsEmpty(), "str1 should be empty.\n"); + + CStringX str2(MAKEINTRESOURCEX(IDS_TEST1)); + ok(str2 == _X("Test string one."), "The value was '%s'\n", dbgstrx(str2)); + + CStringX str3(MAKEINTRESOURCEX(IDS_TEST2)); + ok(str3 == _X("I am a happy BSTR"), "The value was '%s'\n", dbgstrx(str3)); + + CStringX str4(MAKEINTRESOURCEY(IDS_TEST1)); + ok(str4 == _X("Test string one."), "The value was '%s'\n", dbgstrx(str4)); + + CStringX str5(MAKEINTRESOURCEY(IDS_TEST2)); + ok(str5 == _X("I am a happy BSTR"), "The value was '%s'\n", dbgstrx(str5)); +}