@@ -9,7 +9,6 @@ using namespace std;
9
9
10
10
const char ekey[] = " 12345678901234567890123456789012" ;
11
11
const char eiv[] = " 09876543210987654321098765432109" ;
12
- // const char teststr[] = "Testing_source_words_for_libendetool_and_endecmd.";
13
12
const char teststr[] = " Testing_source_words_for_libendetool_and_endecmd." ;
14
13
15
14
void test1 ()
@@ -22,9 +21,8 @@ void test1()
22
21
printf ( " Ok.\n " );
23
22
printf ( " > Configure : " );
24
23
fflush ( stdout );
25
- // ende.cryptkey( ekey, eiv );
26
24
ende->compress ( false );
27
- ende->cryptkey ( ekey );
25
+ ende->cryptkey ( ekey, eiv );
28
26
29
27
printf ( " Ok.\n " );
30
28
fflush ( stdout );
@@ -33,7 +31,12 @@ void test1()
33
31
fflush ( stdout );
34
32
35
33
ende->text ( teststr );
36
- string encstr = ende->encodedtext ();
34
+ printf ( " > encoding ... " );
35
+ fflush ( stdout );
36
+ string encstr;
37
+ const char * rets = ende->encodedtext ();
38
+ if ( rets != NULL )
39
+ encstr = rets;
37
40
printf ( " > encoded : %s\n " , encstr.c_str () );
38
41
fflush ( stdout );
39
42
@@ -57,9 +60,10 @@ void test2()
57
60
if ( ende != NULL )
58
61
{
59
62
ende->compress ( true );
60
- ende->cryptkey ( ekey );
63
+ ende->cryptkey ( ekey, eiv );
61
64
62
65
printf ( " testing compressed encryption\n " );
66
+ fflush ( stdout );
63
67
64
68
ende->text ( teststr );
65
69
string encstr = ende->encodedtext ();
@@ -77,14 +81,19 @@ int main( int argc, char** argv )
77
81
printf ( " libendetool testing.\n " );
78
82
fflush ( stdout );
79
83
84
+ printf ( " ========================================================\n " );
80
85
printf ( " TESTING 1: plain texts.\n " );
81
86
fflush ( stdout );
82
87
test1 ();
83
88
89
+ printf ( " \n\n " );
90
+ printf ( " ========================================================\n " );
84
91
printf ( " TESTING 2: compressed texts.\n " );
85
92
fflush ( stdout );
86
93
test2 ();
87
94
95
+ printf ( " \n\n " );
96
+ printf ( " ========================================================\n " );
88
97
fflush ( stdout );
89
98
system ( " pause" );
90
99
0 commit comments