mirror of
https://github.com/reactos/reactos.git
synced 2025-04-20 04:20:46 +00:00
[ATL_APITEST] Add a test for CString.AllocSysString
This commit is contained in:
parent
0e9d9ce905
commit
bccdcded28
5 changed files with 27 additions and 9 deletions
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS api tests
|
* PROJECT: ReactOS api tests
|
||||||
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
||||||
* PURPOSE: Test for CString
|
* PURPOSE: Test for CString
|
||||||
* PROGRAMMERS: Mark Jansen
|
* COPYRIGHT: Copyright 2016-2017 Mark Jansen (mark.jansen@reactos.org)
|
||||||
* Katayama Hirofumi MZ
|
* Copyright 2017 Katayama Hirofumi MZ
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <atlstr.h>
|
#include <atlstr.h>
|
||||||
|
@ -254,8 +254,11 @@ START_TEST(CString)
|
||||||
test_load_strW();
|
test_load_strW();
|
||||||
test_load_strA();
|
test_load_strA();
|
||||||
|
|
||||||
|
test_bstrW();
|
||||||
|
test_bstrA();
|
||||||
|
|
||||||
#ifndef __REACTOS__
|
#ifndef __REACTOS__
|
||||||
printf("CString: %i tests executed (0 marked as todo, %i failures), %i skipped.\n", g_tests_executed, g_tests_failed, g_tests_skipped);
|
printf("CString: %i tests executed (0 marked as todo, %i failures), %i skipped.\n", g_tests_executed, g_tests_failed, g_tests_skipped);
|
||||||
return 0;
|
return g_tests_failed;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,3 +424,18 @@ TEST_NAMEX(load_str)
|
||||||
CStringX str5(MAKEINTRESOURCEY(IDS_TEST2));
|
CStringX str5(MAKEINTRESOURCEY(IDS_TEST2));
|
||||||
ok(str5 == _X("I am a happy BSTR"), "The value was '%s'\n", dbgstrx(str5));
|
ok(str5 == _X("I am a happy BSTR"), "The value was '%s'\n", dbgstrx(str5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_NAMEX(bstr)
|
||||||
|
{
|
||||||
|
CStringX str;
|
||||||
|
|
||||||
|
str = _X("Some test text here...");
|
||||||
|
|
||||||
|
BSTR bstr = str.AllocSysString();
|
||||||
|
ok(!!bstr, "Expected a valid pointer\n");
|
||||||
|
if (bstr)
|
||||||
|
{
|
||||||
|
ok(!wcscmp(bstr, L"Some test text here..."), "Expected 'Some test text here...', got: '%S'\n", bstr);
|
||||||
|
::SysFreeString(bstr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<RegisterOutput>true</RegisterOutput>
|
<RegisterOutput>false</RegisterOutput>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<RegisterOutput>true</RegisterOutput>
|
<RegisterOutput>false</RegisterOutput>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<RegisterOutput>true</RegisterOutput>
|
<RegisterOutput>false</RegisterOutput>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
|
Loading…
Reference in a new issue