From 2d48ae784ea6828e8626c32c848f64232d8f35c0 Mon Sep 17 00:00:00 2001 From: geronimo Date: Fri, 13 Jul 2012 04:26:40 +0200 Subject: initial import --- tests/JSonTest/JSonTest.cbp | 66 ++++++++++++++++++++++++++++++++++++++ tests/JSonTest/JSonTest.cbp.save | 66 ++++++++++++++++++++++++++++++++++++++ tests/JSonTest/JSonTest.cc | 68 ++++++++++++++++++++++++++++++++++++++++ tests/JSonTest/JSonTest.depend | 18 +++++++++++ tests/JSonTest/JSonTest.layout | 9 ++++++ 5 files changed, 227 insertions(+) create mode 100644 tests/JSonTest/JSonTest.cbp create mode 100644 tests/JSonTest/JSonTest.cbp.save create mode 100644 tests/JSonTest/JSonTest.cc create mode 100644 tests/JSonTest/JSonTest.depend create mode 100644 tests/JSonTest/JSonTest.layout (limited to 'tests/JSonTest') diff --git a/tests/JSonTest/JSonTest.cbp b/tests/JSonTest/JSonTest.cbp new file mode 100644 index 0000000..9328615 --- /dev/null +++ b/tests/JSonTest/JSonTest.cbp @@ -0,0 +1,66 @@ + + + + + + diff --git a/tests/JSonTest/JSonTest.cbp.save b/tests/JSonTest/JSonTest.cbp.save new file mode 100644 index 0000000..9328615 --- /dev/null +++ b/tests/JSonTest/JSonTest.cbp.save @@ -0,0 +1,66 @@ + + + + + + diff --git a/tests/JSonTest/JSonTest.cc b/tests/JSonTest/JSonTest.cc new file mode 100644 index 0000000..c4500c1 --- /dev/null +++ b/tests/JSonTest/JSonTest.cc @@ -0,0 +1,68 @@ +/* + * File: JSonTest.cc + * Author: django + * + * Created on 12.07.2012, 07:31:46 + */ + +#include +#include +#include +#include + +/* + * Simple C++ Test Suite + */ + +void test1() +{ + char buf[512] = {0}; + cStringBuilder sb; + cJSonWriter jw(sb); + + std::cout << "JSonTest test 1" << std::endl; + + jw.Object().Key("total").Value(123); + jw.Key("errorCode").Value(-1); + jw.Key("testmode").Value(true); + jw.Key("results").Array(); + + for (int i=0; i < 3; ++i) { + jw.Object().Key("counter").Value(i); + jw.Key("nase").Value("bär"); + jw.EndObject(); + } + jw.EndArray(); + jw.Key("fasel").Value("blub"); + jw.EndObject(); + + std::cout << "size of json-Object: " << sb.Size() << std::endl; + sb.Copy(buf, sizeof(buf)); + + std::cout << "json object looks like" << std::endl << buf << std::endl; +} + +void test2() +{ + std::cout << "JSonTest test 2" << std::endl; + std::cout << "%TEST_FAILED% time=0 testname=test2 (JSonTest) message=error message sample" << std::endl; +} + +int main(int argc, char** argv) +{ + std::cout << "%SUITE_STARTING% JSonTest" << std::endl; + std::cout << "%SUITE_STARTED%" << std::endl; + + std::cout << "%TEST_STARTED% test1 (JSonTest)" << std::endl; + test1(); + std::cout << "%TEST_FINISHED% time=0 test1 (JSonTest)" << std::endl; + +// std::cout << "%TEST_STARTED% test2 (JSonTest)\n" << std::endl; +// test2(); +// std::cout << "%TEST_FINISHED% time=0 test2 (JSonTest)" << std::endl; + + std::cout << "%SUITE_FINISHED% time=0" << std::endl; + + return (EXIT_SUCCESS); +} + diff --git a/tests/JSonTest/JSonTest.depend b/tests/JSonTest/JSonTest.depend new file mode 100644 index 0000000..deeec5d --- /dev/null +++ b/tests/JSonTest/JSonTest.depend @@ -0,0 +1,18 @@ +# depslib dependency file v1.0 +1342071807 source:/d/linux/CMP/tests/JSonTest/JSonTest.cc + + + + + +1342076412 /d/linux/CMP/libs/util/include/StringBuilder.h + + + +1341942404 /d/linux/CMP/libs/util/include/ManagedVector.h + + + +1342076888 /d/linux/CMP/libs/util/include/JSonWriter.h + + diff --git a/tests/JSonTest/JSonTest.layout b/tests/JSonTest/JSonTest.layout new file mode 100644 index 0000000..a4583b3 --- /dev/null +++ b/tests/JSonTest/JSonTest.layout @@ -0,0 +1,9 @@ + + + + + + + + + -- cgit v1.2.3