File: win32_encryption_tests.cpp

package info (click to toggle)
cpprest 2.10.19-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,916 kB
  • sloc: cpp: 71,086; sh: 275; makefile: 170; javascript: 147
file content (49 lines) | stat: -rw-r--r-- 1,358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/***
 * Copyright (C) Microsoft. All rights reserved.
 * Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 *
 * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
 *
 * win32_encryption_tests.cpp
 *
 * Tests for win32_encryption class.
 *
 * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 ****/

#include "stdafx.h"

using namespace utility;

namespace tests
{
namespace functional
{
namespace utils_tests
{
#if defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA && !defined(__cplusplus_winrt)
SUITE(win32_encryption)
{
    TEST(win32_encryption_random_string)
    {
        utility::string_t rndStr = utility::conversions::to_string_t("random string");
        web::details::win32_encryption enc(rndStr);

        VERIFY_ARE_EQUAL(*enc.decrypt(), rndStr);
    }

    TEST(win32_encryption_empty_string)
    {
        utility::string_t emptyStr = utility::conversions::to_string_t("");
        web::details::win32_encryption enc(emptyStr);

        VERIFY_ARE_EQUAL(*enc.decrypt(), emptyStr);
    }

} // SUITE(win32_encryption)

#endif // defined(_WIN32) && _WIN32_WINNT >= _WIN32_WINNT_VISTA && !defined(__cplusplus_winrt)

} // namespace utils_tests
} // namespace functional
} // namespace tests