-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add specializations for more ATL/MFC strings
* CSimpleStringT, CFixedStringT * For C++20 - any string derived from CSimpleStringT
- Loading branch information
Showing
3 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2024 Rimas Misevičius | ||
// Distributed under the BSD-style license that can be | ||
// found in the LICENSE file. | ||
// | ||
|
||
#include "doctest-main.h" | ||
|
||
#ifdef _MSC_VER | ||
# define UPA_TEST_URL_FOR_ATL | ||
# include "upa/url_for_atl.h" | ||
# include <atlsimpstr.h> | ||
# include <atlstr.h> | ||
# include <cstringt.h> | ||
#endif | ||
|
||
#ifdef UPA_TEST_URL_FOR_ATL | ||
|
||
TEST_CASE("ATL::CSimpleStringA input") { | ||
ATL::CStringA basestr; | ||
|
||
ATL::CSimpleStringA str_input("http://host/", basestr.GetManager()); | ||
upa::url url{ str_input }; | ||
CHECK(url.href() == "http://host/"); | ||
} | ||
|
||
TEST_CASE("ATL::CSimpleStringW input") { | ||
ATL::CStringW basestr; | ||
|
||
ATL::CSimpleStringW str_input(L"http://host/", basestr.GetManager()); | ||
upa::url url{ str_input }; | ||
CHECK(url.href() == "http://host/"); | ||
} | ||
|
||
TEST_CASE_TEMPLATE_DEFINE("ATL string input", StrT, test_url_for_atl) { | ||
StrT str_input("http://host/"); | ||
upa::url url{ str_input }; | ||
CHECK(url.href() == "http://host/"); | ||
} | ||
|
||
TEST_CASE_TEMPLATE_INVOKE(test_url_for_atl, | ||
ATL::CStringA, ATL::CFixedStringT<ATL::CStringA, 16>, | ||
ATL::CStringW, ATL::CFixedStringT<ATL::CStringW, 16>); | ||
|
||
#endif // UPA_TEST_URL_FOR_ATL |