TestCsvParser.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2015 Enrico Mariotti <enricomariotti@yahoo.it>
  3. * Copyright (C) 2017 KeePassXC Team <team@keepassxc.org>
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 2 or (at your option)
  8. * version 3 of the License.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef KEEPASSX_TESTCSVPARSER_H
  19. #define KEEPASSX_TESTCSVPARSER_H
  20. #include <QTemporaryFile>
  21. #include "format/CsvParser.h"
  22. class CsvParser;
  23. class TestCsvParser : public QObject
  24. {
  25. Q_OBJECT
  26. public:
  27. private slots:
  28. void init();
  29. void cleanup();
  30. void initTestCase();
  31. void testUnicode();
  32. void testLF();
  33. void testEmptyReparsing();
  34. void testSimple();
  35. void testEmptyQuoted();
  36. void testEmptyNewline();
  37. void testSeparator();
  38. void testCR();
  39. void testCRLF();
  40. void testMalformed();
  41. void testQualifier();
  42. void testNewline();
  43. void testEmptySimple();
  44. void testMissingQuote();
  45. void testComments();
  46. void testBackslashSyntax();
  47. void testReparsing();
  48. void testEmptyFile();
  49. void testQuoted();
  50. void testMultiline();
  51. void testColumns();
  52. private:
  53. QScopedPointer<QTemporaryFile> file;
  54. QScopedPointer<CsvParser> parser;
  55. CsvTable t;
  56. };
  57. #endif // KEEPASSX_TESTCSVPARSER_H