Merge branch 'develop' into MAX-324

This commit is contained in:
Markus Makela
2015-01-30 20:58:57 +02:00
20 changed files with 110 additions and 193 deletions

View File

@ -2,7 +2,7 @@ if(${ERRMSG} MATCHES "ERRMSG-NOTFOUND")
message(FATAL_ERROR "The errmsg.sys file was not found, please define the path with -DERRMSG=<path>")
else()
if(${CMAKE_VERSION} VERSION_LESS 2.8)
execute_process(COMMAND cp ${ERRMSG} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${ERRMSG} ${CMAKE_CURRENT_BINARY_DIR})
else()
file(COPY ${ERRMSG} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()
@ -11,4 +11,4 @@ endif()
add_subdirectory(canonical_tests)
add_executable(classify classify.c)
target_link_libraries(classify query_classifier fullcore)
add_test(TestQueryClassifier classify ${CMAKE_CURRENT_SOURCE_DIR}/input.sql ${CMAKE_CURRENT_SOURCE_DIR}/expected.sql)
add_test(TestQueryClassifier classify ${CMAKE_CURRENT_SOURCE_DIR}/input.sql ${CMAKE_CURRENT_SOURCE_DIR}/expected.sql)

View File

@ -44,8 +44,22 @@ int main(int argc, char** argv)
}
input = fopen(argv[1],"rb");
if(input == NULL)
{
printf("Error: Failed to open input file %s", argv[1]);
return 1;
}
expected = fopen(argv[2],"rb");
if(expected == NULL)
{
fclose(input);
printf("Error: Failed to open expected output file %s", argv[2]);
return 1;
}
while((rd = fread(buffer,sizeof(char),1023,input))){
/**Fill the read buffer*/