summaryrefslogtreecommitdiffstats
path: root/src/charset-test.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-04-23 14:34:24 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-04-23 14:34:24 +0200
commitc1ddb1febeb31a79d8f69634575bcc36f38103d4 (patch)
treed5503e66b47dd03b320ca08ee1c9437fc127f367 /src/charset-test.cpp
parent5c6b9fb58d66b01c660798d33c3e7704dada49e6 (diff)
downloadODR-AudioEnc-c1ddb1febeb31a79d8f69634575bcc36f38103d4.tar.gz
ODR-AudioEnc-c1ddb1febeb31a79d8f69634575bcc36f38103d4.tar.bz2
ODR-AudioEnc-c1ddb1febeb31a79d8f69634575bcc36f38103d4.zip
mot-encoder: Add charset converter for EBU Latin
Diffstat (limited to 'src/charset-test.cpp')
-rw-r--r--src/charset-test.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/charset-test.cpp b/src/charset-test.cpp
new file mode 100644
index 0000000..d65fcc7
--- /dev/null
+++ b/src/charset-test.cpp
@@ -0,0 +1,57 @@
+/*
+ Copyright (C) 2015 Matthias P. Braendli (http://opendigitalradio.org)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ charset.cpp
+ This is test code for the character set conversion. It does not
+ get compiled by default.
+ Please use
+ g++ -Wall -Wextra -std=c++11 -o charset-test charset-test.cpp
+ to compile this, and create a input.txt file with test data.
+
+ Authors:
+ Matthias P. Braendli <matthias@mpb.li>
+*/
+
+#include "charset.h"
+#include <iostream>
+#include <fstream>
+
+#include <cstdio>
+
+using namespace std;
+
+int main(int argc, char** argv)
+{
+ string test_file_path("input.txt");
+
+ ifstream fs8(test_file_path);
+ if (!fs8.is_open()) {
+ cerr << "Could not open " << test_file_path << endl;
+ return 1;
+ }
+
+ CharsetConverter conv;
+
+ string line;
+ // Play with all the lines in the file
+ while (getline(fs8, line)) {
+ cout << conv.convert(line) << endl;
+ }
+
+ return 0;
+}
+
+