Ejemplo n.º 1
0
int main(int argc, char ** argv){
	const int n = 2000;
	char * test_d = "another text\n but this time its test word to encrypt and decrypt ok";
	char * fout = 0, * fout2 = 0, * fout3 = 0;
	clc_bytes_16 b;
	clc_bytes_20 b20;
	
	if(argc > 1){
		test_d = argv[1];
	}
	if( argc > 4 ){
		fout = argv[2];
		fout2 = argv[3];
		fout3 = argv[4];
	}
	
	test();
	test_16(n);
	test_24(n);
	test_32(n);
	
	clc_md5((const unsigned char*)test_d,strlen(test_d),&b);
	printf("\nmd5: ");
	clc_print_b(&b);
	
	clc_sha1((const unsigned char*)test_d,strlen(test_d),&b20);
	printf("\nsha1 (%lu): ",strlen(test_d));
	clc_print_b_20(&b20);
	
	clc_encrypt_file("test_pass",fout,fout2);
	clc_decrypt_file("test_pass",fout2,fout3);
	return 0;
}
Ejemplo n.º 2
0
int main () {

	#ifdef _DEBUG
		Profiler::set_total("ArrayHandler", 24);

		test_1 ();
		test_2 ();
		test_3 ();
		test_4 ();
		test_5 ();
		test_6 ();
		test_7 ();
		test_8 ();
		test_9 ();
		test_10 ();
		test_11 ();
		test_12 ();
		test_13 ();
		test_14 ();
		test_15 ();
		test_16 ();

		cout << "\n\nTesting iterators:\n\n";

		Profiler::set_total("ArrayIterator", 17);

		test_17 ();
		test_18 ();
		test_19 ();
		test_20 ();

		//Profiler::report();
		Profiler::report_to_file();

		cout << "------------------------------------------------------------\n\n";
		cout << "        CHECK Profiler data in Profiler_report.txt\n\n";
		cout << "  To show all debug info - comment line 12 in ArrayIterator.h\n\n";
		cout << "------------------------------------------------------------\n\n";


	#else
		cout << "Testing requires DEBUG mode.\n\n";
	#endif


	return EXIT_SUCCESS;
}
Ejemplo n.º 3
0
int main() {

	printf("1) %d \n", test_1());
	printf("2) %d \n", test_2());
	test_3();
	printf("\n4) %d \n", test_4());
	printf("5) %d \n", test_5());
	printf("6) %d \n", test_6());
	printf("7) %d \n", test_7());
	test_8();
	test_9();
	test_10();
	printf("\n11) string \`%c\` \n", test_11());
	printf("\n12) %d", test_12());
	test_13();
	test_14();
	test_15();
	test_16();
	test_17();
	test_18();
	test_19();
}
Ejemplo n.º 4
0
/**
 *  Test sk_memset16 and sk_memset32.
 *  For performance considerations, implementations may take different paths
 *  depending on the alignment of the dst, and/or the size of the count.
 */
static void TestMemset(skiatest::Reporter* reporter) {
    test_16(reporter);
    test_32(reporter);

    test_chunkalloc(reporter);
};
Ejemplo n.º 5
0
/**
 *  Test sk_memset16 and sk_memset32.
 *  For performance considerations, implementations may take different paths
 *  depending on the alignment of the dst, and/or the size of the count.
 */
DEF_TEST(Memset, reporter) {
    test_16(reporter);
    test_32(reporter);

    test_chunkalloc(reporter);
}