1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Revert "MDEV-27036: re-enable my_json_writer-t unit test"

This reverts commit 2d21917e7d.

No explainations, lots of code moved, wrong cmake changes
This commit is contained in:
Sergei Golubchik
2021-12-07 09:57:51 +01:00
parent 23bfacf1cc
commit 1e8bcbd0a0
17 changed files with 152 additions and 199 deletions

View File

@@ -31,7 +31,6 @@ ADD_DEPENDENCIES(mf_iocache-t GenError)
MY_ADD_TEST(mf_iocache)
# Json writer needs String which needs sql library
ADD_EXECUTABLE(my_json_writer-t my_json_writer-t.cc dummy_builtins.cc)
TARGET_LINK_LIBRARIES(my_json_writer-t PUBLIC sql mytap)
TARGET_COMPILE_DEFINITIONS(my_json_writer-t PUBLIC JSON_WRITER_UNIT_TEST)
MY_ADD_TEST(my_json_writer)
#ADD_EXECUTABLE(my_json_writer-t my_json_writer-t.cc dummy_builtins.cc)
#TARGET_LINK_LIBRARIES(my_json_writer-t sql mytap)
#MY_ADD_TEST(my_json_writer)

View File

@@ -26,6 +26,7 @@
*/
struct TABLE;
struct JOIN_TAB;
class Json_writer;
@@ -38,15 +39,13 @@ public:
Json_writer *get_current_json() { return nullptr; }
};
class THD
class THD
{
public:
Opt_trace opt_trace;
};
#ifndef JSON_WRITER_UNIT_TEST
#define JSON_WRITER_UNIT_TEST
#endif
#include "../sql/my_json_writer.h"
#include "../sql/my_json_writer.cc"
@@ -125,15 +124,19 @@ int main(int args, char **argv)
w.start_object();
w.add_member("name").add_ll(1);
w.add_member("name").add_ll(2);
w.end_object();
ok(w.invalid_json, "JSON object member name collision");
}
{
Json_writer w;
w.start_object();
w.add_member("name").start_object();
w.add_member("name").add_ll(1);
w.start_object();
w.add_member("name").add_ll(2);
ok(!w.invalid_json, "This must be valid JSON: nested object member has the same name");
w.end_object();
w.end_object();
ok(!w.invalid_json, "Valid JSON: nested object member name is the same");
}
diag("Done");