Go to the source code of this file.
|
| | TEST (yEnc, EncodeDecode) |
◆ ydec_single
| #define ydec_single |
( |
| stringiter, |
|
|
| ret ) |
Value: MACRO_BEGIN \
if (conv <= 0) \
ret = -1; \
else \
{ \
if (conv == '=') \
{ \
conv -= 64; \
} \
if (conv < 42) \
conv += 256; \
conv -= 42; \
ret = conv; \
} \
#define STRING_ITERATOR_GET(this)
Definition at line 31 of file yenc.qh.
31#define ydec_single(stringiter, ret) MACRO_BEGIN \
32 int conv = STRING_ITERATOR_GET(stringiter); \
33 if (conv <= 0) \
34 ret = -1; \
35 else \
36 { \
37 if (conv == '=') \
38 { \
39 conv = STRING_ITERATOR_GET(stringiter); \
40 conv -= 64; \
41 } \
42 if (conv < 42) \
43 conv += 256; \
44 conv -= 42; \
45 ret = conv; \
46 } \
47MACRO_END
Referenced by TEST().
◆ yenc_single
| #define yenc_single |
( |
| c, |
|
|
| ret ) |
Value: MACRO_BEGIN \
int conv = c; \
conv += 42; \
if (conv >= 256) \
conv -= 256; \
switch (conv) \
{ \
default: \
{ \
ret = yenc_it; \
break; \
} \
case 0: \
case '\n': \
case '\r': \
case '=': \
{ \
conv += 64; \
string yenc_it =
chr2str(
'=', conv); \
ret = yenc_it; \
break; \
} \
} \
Definition at line 5 of file yenc.qh.
5#define yenc_single(c, ret) MACRO_BEGIN \
6 int conv = c; \
7 conv += 42; \
8 if (conv >= 256) \
9 conv -= 256; \
10 switch (conv) \
11 { \
12 default: \
13 { \
14 string yenc_it = chr2str(conv); \
15 ret = yenc_it; \
16 break; \
17 } \
18 case 0: \
19 case '\n': \
20 case '\r': \
21 case '=': \
22 { \
23 conv += 64; \
24 string yenc_it = chr2str('=', conv); \
25 ret = yenc_it; \
26 break; \
27 } \
28 } \
29MACRO_END
Referenced by TEST(), and WriteByte().
◆ TEST()
| TEST |
( |
yEnc | , |
|
|
EncodeDecode | ) |
Definition at line 49 of file yenc.qh.
50{
51 for (int i = 0; i <= 255; ++i)
52 {
53 int expect = i;
54
57
58 int encdec = 0;
61
63 }
65}
#define STRING_ITERATOR(this, s, i)
#define EXPECT_EQ(expected_, actual_)
#define SUCCEED()
Must be present at the end of a test.
#define yenc_single(c, ret)
#define ydec_single(stringiter, ret)
References EXPECT_EQ, STRING_ITERATOR, string_null, SUCCEED, ydec_single, and yenc_single.