Add tests for konsole_wcwidth()

This is a WIP - need to determine best way of handling this

cherry-pick 89c732bc2f
wilder-portage
Kurt Hindenburg 12 years ago
parent 6e17744781
commit d6c9ee289f
  1. 6
      src/autotests/CMakeLists.txt
  2. 3
      src/konsole_wcwidth.cpp

@ -9,6 +9,12 @@ ecm_mark_as_test(CharacterColorTest)
add_test(CharacterColorTest CharacterColorTest)
target_link_libraries(CharacterColorTest ${KONSOLE_TEST_LIBS})
add_executable(CharacterWidthTest CharacterWidthTest.cpp)
ecm_mark_as_test(CharacterWidthTest)
add_test(CharacterWidthTest CharacterWidthTest)
target_link_libraries(CharacterWidthTest ${KONSOLE_TEST_LIBS})
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_executable(DBusTest DBusTest.cpp)
ecm_mark_as_test(DBusTest)

@ -68,6 +68,7 @@
// Own
#include "konsole_wcwidth.h"
#include "konsole_export.h"
struct interval {
unsigned long first;
@ -125,7 +126,7 @@ static int bisearch(unsigned long ucs, const struct interval* table, int max)
* in ISO 10646.
*/
int konsole_wcwidth(quint16 oucs)
int KONSOLEPRIVATE_EXPORT konsole_wcwidth(quint16 oucs)
{
/* NOTE: It is not possible to compare quint16 with the new last four lines of characters,
* therefore this cast is now necessary.

Loading…
Cancel
Save