Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,14 @@ add_test(NAME AnnotationTests COMMAND test_annotations)
add_executable(test_attributes tests/test_attributes.cpp)
target_include_directories(test_attributes PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
target_link_libraries(test_attributes dxfrw ${ICONV_LIBRARY})
add_test(NAME AttributeTests COMMAND test_attributes)
add_test(NAME AttributeTests COMMAND test_attributes)

add_executable(test_class_underflow tests/test_class_underflow.cpp)
target_include_directories(test_class_underflow PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
target_link_libraries(test_class_underflow dxfrw ${ICONV_LIBRARY})
add_test(NAME ClassUnderflowTests COMMAND test_class_underflow)

add_executable(test_dwg_classes tests/test_dwg_classes.cpp)
target_include_directories(test_dwg_classes PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
target_link_libraries(test_dwg_classes dxfrw ${ICONV_LIBRARY})
add_test(NAME DWGClassParsingTests COMMAND test_dwg_classes)
4 changes: 3 additions & 1 deletion src/intern/dwgreader18.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,9 @@ bool dwgReader18::readDwgClasses(){

/*******************************/

duint32 endDataPos = maxClassNum-499;
// Classes 0-499 are built-in; custom classes start at 500.
// If maxClassNum <= 499, there are no custom classes to parse.
duint32 endDataPos = (maxClassNum > 499) ? (maxClassNum - 499) : 0;
DRW_DBG("\nbuff.getPosition: "); DRW_DBG(dataBuf.getPosition());
for (duint32 i= 0; i<endDataPos;i++) {
DRW_Class *cl = new DRW_Class();
Expand Down
4 changes: 3 additions & 1 deletion src/intern/dwgreader21.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ bool dwgReader21::readDwgClasses(){

/*******************************/

duint32 endDataPos = maxClassNum-499;
// Classes 0-499 are built-in; custom classes start at 500.
// If maxClassNum <= 499, there are no custom classes to parse.
duint32 endDataPos = (maxClassNum > 499) ? (maxClassNum - 499) : 0;
DRW_DBG("\nbuff.getPosition: "); DRW_DBG(buff.getPosition());
for (duint32 i= 0; i<endDataPos;i++) {
DRW_Class *cl = new DRW_Class();
Expand Down
Loading
Loading