|
|
@@ -1,7 +1,7 @@ |
|
|
|
#include <string> |
|
|
|
#include "any.h" |
|
|
|
#include "ctx.h" |
|
|
|
#include "memory_Context.h" |
|
|
|
#include <iostream> |
|
|
|
|
|
|
|
std::string s(const char *str) { |
|
|
|
return std::string(str); |
|
|
@@ -116,3 +116,26 @@ std::string test_ctx_Controller_registerFieldCallback_mismatch() { |
|
|
|
} |
|
|
|
return "ERR: ctx_Controller_registerFieldCallback_mismatch"; |
|
|
|
} |
|
|
|
|
|
|
|
std::string test_memory_Context_field() { |
|
|
|
auto c = memory_createContext(); |
|
|
|
c.input = "abc"; |
|
|
|
if ( |
|
|
|
libany::any_cast<std::string>(c.field("input")) == "abc" |
|
|
|
) { |
|
|
|
return "OK: memory_Context_field"; |
|
|
|
} |
|
|
|
return "ERR: memory_Context_field"; |
|
|
|
} |
|
|
|
|
|
|
|
std::string test_memory_Context_setField() { |
|
|
|
auto c = memory_createContext(); |
|
|
|
c.input = "abc"; |
|
|
|
c.setField("input", s("123")); |
|
|
|
if ( |
|
|
|
c.input == "123" |
|
|
|
) { |
|
|
|
return "OK: memory_Context_setField"; |
|
|
|
} |
|
|
|
return "ERR: memory_Context_setField"; |
|
|
|
} |