From df196b55ec95a23beb5083425982af36e35da2b9 Mon Sep 17 00:00:00 2001 From: Volker Grabsch Date: Mon, 16 Apr 2012 15:26:23 +0200 Subject: Fix name of a test program (using a consistent suffix for C++ programs) --- src/hunspell-test.cpp | 37 +++++++++++++++++++++++++++++++++++++ src/hunspell-test.cxx | 37 ------------------------------------- src/hunspell.mk | 2 +- 3 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 src/hunspell-test.cpp delete mode 100644 src/hunspell-test.cxx diff --git a/src/hunspell-test.cpp b/src/hunspell-test.cpp new file mode 100644 index 0000000..67393d5 --- /dev/null +++ b/src/hunspell-test.cpp @@ -0,0 +1,37 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + (void)argc; + (void)argv; + + std::ofstream dic ("hunspell-test.dic"); + dic << "2\nHello\nWorld"; + dic.close(); + std::ofstream aff ("hunspell-test.aff"); + aff << "SET UTF-8\nTRY loredWH\nMAXDIFF 1"; + aff.close(); + Hunspell h("hunspell-test.aff", "hunspell-test.dic"); + + if (h.spell("Hello") == 0) + { + std::cerr << "Error: hunspell marked correct word as wrong" << std::endl; + } + if (h.spell("wrld") != 0) + { + std::cerr << "Error: hunspell marked wrong word as correct" << std::endl; + } + + char ** result; + int n = h.suggest(&result, "ell"); + for (int i = 0; i < n; i++) std::cout << result[i]; + + return 0; +} diff --git a/src/hunspell-test.cxx b/src/hunspell-test.cxx deleted file mode 100644 index 67393d5..0000000 --- a/src/hunspell-test.cxx +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This file is part of MXE. - * See index.html for further information. - */ - -#include -#include -#include - -int main(int argc, char *argv[]) -{ - (void)argc; - (void)argv; - - std::ofstream dic ("hunspell-test.dic"); - dic << "2\nHello\nWorld"; - dic.close(); - std::ofstream aff ("hunspell-test.aff"); - aff << "SET UTF-8\nTRY loredWH\nMAXDIFF 1"; - aff.close(); - Hunspell h("hunspell-test.aff", "hunspell-test.dic"); - - if (h.spell("Hello") == 0) - { - std::cerr << "Error: hunspell marked correct word as wrong" << std::endl; - } - if (h.spell("wrld") != 0) - { - std::cerr << "Error: hunspell marked wrong word as correct" << std::endl; - } - - char ** result; - int n = h.suggest(&result, "ell"); - for (int i = 0; i < n; i++) std::cout << result[i]; - - return 0; -} diff --git a/src/hunspell.mk b/src/hunspell.mk index 74e943e..0aa6190 100644 --- a/src/hunspell.mk +++ b/src/hunspell.mk @@ -31,6 +31,6 @@ define $(PKG)_BUILD # Test '$(TARGET)-g++' \ -W -Wall -Werror -ansi -pedantic \ - '$(2).cxx' -o '$(PREFIX)/$(TARGET)/bin/test-hunspell.exe' \ + '$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-hunspell.exe' \ `'$(TARGET)-pkg-config' hunspell --cflags --libs` endef -- cgit v0.12