コード例 #1
0
ファイル: test_algorithms.cpp プロジェクト: mrLarbi/CPAEgrep
int main(int argc, char** argv)
{
	test_determinisation();
	test_epsilon_deleting();
	test_parsing();
	test_parsing_2();
	test_serialize();
}
コード例 #2
0
TEST(MultilineLiteralString, Simple) {
    test_parsing("''''''", "");
    test_parsing("''' ' '''", " ' ");
    test_parsing("''' '' '''", " '' ");
    test_parsing("'''' '''", "' ");
    test_parsing("''''' '''", "'' ");
    test_parsing("'''test'''", "test");
    test_parsing("'''test\ntest'''", "test\ntest");
}
コード例 #3
0
ファイル: test_commands.c プロジェクト: ipstatic/naemon-core
int main(int /*@unused@*/ argc, char /*@unused@*/ **arv)
{
	const char *test_config_file = TESTDIR "naemon.cfg";
	plan_tests(489);
	init_event_queue();

	config_file_dir = nspath_absolute_dirname(test_config_file, NULL);
	assert(OK == read_main_config_file(test_config_file));
	assert(OK == read_all_object_data(test_config_file));
	assert(OK == initialize_downtime_data());
	assert(OK == initialize_retention_data());
	test_register();
	test_parsing();
	test_core_commands();
	return exit_status();
}
コード例 #4
0
int main(int argc, char * * argv)
{
	FILE * f;
	char buffer[4096];
	int l;
	int ok;

	if(argc<2)
	{
		fprintf(stderr, "Usage: %s file.xml [file.namevalues]\n", argv[0]);
		return 1;
	}
	f = fopen(argv[1], "r");
	if(!f)
	{
		fprintf(stderr, "Error : can not open file %s\n", argv[1]);
		return 2;
	}
	l = fread(buffer, 1, sizeof(buffer)-1, f);
	fclose(f);
	f = NULL;
	buffer[l] = '\0';
	if(argc >= 2)
	{
		f = fopen(argv[2], "r");
		if(!f)
		{
			fprintf(stderr, "Error : can not open file %s\n", argv[2]);
			return 2;
		}
	}
#ifdef DEBUG
	DisplayNameValueList(buffer, l);
#endif
	ok = test_parsing(buffer, l, f);
	if(f)
	{
		fclose(f);
	}
	return ok ? 0 : 3;
}
コード例 #5
0
int main(int argc, char * * argv)
{
	FILE * f;
	char buffer[4096];
	int l;
	if(argc<2)
	{
		fprintf(stderr, "Usage: %s file.xml\n", argv[0]);
		return 1;
	}
	f = fopen(argv[1], "r");
	if(!f)
	{
		fprintf(stderr, "Error : can not open file %s\n", argv[1]);
		return 2;
	}
	l = fread(buffer, 1, sizeof(buffer)-1, f);
	fclose(f);
	buffer[l] = '\0';
	DisplayNameValueList(buffer, l);
	test_parsing(buffer, l);
	return 0;
}
コード例 #6
0
TEST(MultilineLiteralString, NoEscape) {
    test_parsing("'''  \t test \\test\"test\\\n  test\\\r\n  test'''",
                 "  \t test \\test\"test\\\n  test\\\n  test");
}
コード例 #7
0
TEST(MultilineLiteralString, SkipFirstEOL) {
    test_parsing("'''\n  test\ntest'''", "  test\ntest");
    test_parsing("'''\r\n  test\ntest'''", "  test\ntest");
    test_parsing("'''\r\ntest\r\ntest'''", "test\ntest");
}
コード例 #8
0
ファイル: basic_string.cpp プロジェクト: andrusha97/loltoml
TEST(BasicString, Escape) {
    test_parsing("\"test\\b\\t\\n\\f\\r\\\"\\\\\"", "test\b\t\n\f\r\"\\");
    test_parsing("\"\\u0001\"", "\x01");
    test_parsing("\"\\U00000001\"", "\x01");
    test_parsing("\"\\U000000e9\"", "é");
    test_parsing("\"test\\ud7fftest\"", "test\xed\x9f\xbftest");
    test_parsing("\"test\\ud7FFtest\"", "test\xed\x9f\xbftest");
    test_parsing("\"test\\ue000test\"", "test\xee\x80\x80test");
    test_parsing("\"test\\uE000test\"", "test\xee\x80\x80test");
    test_parsing("\"test\\U0000e000test\"", "test\xee\x80\x80test");
    test_parsing("\"test\\U0000E000test\"", "test\xee\x80\x80test");
    test_parsing("\"test\\U0010fffftest\"", "test\xf4\x8f\xbf\xbftest");
    test_parsing("\"test\\U0010FFFFtest\"", "test\xf4\x8f\xbf\xbftest");
}
コード例 #9
0
ファイル: basic_string.cpp プロジェクト: andrusha97/loltoml
TEST(BasicString, Simple) {
    test_parsing("\"\"", "");
    test_parsing("\"test\"", "test");
}