File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ class TestBaseType
3434 int mdarray[2 ][3 ][5 ];
3535 std::function<int (int )> func_member;
3636
37+ void set_string_val (std::string &t_str)
38+ {
39+ t_str = " 42" ;
40+ }
41+
3742 private:
3843 TestBaseType &operator =(const TestBaseType &) = delete ;
3944};
@@ -52,6 +57,7 @@ class Type2
5257 return m_bt.val ;
5358 }
5459
60+
5561 const char *get_str () const
5662 {
5763 return m_str.c_str ();
@@ -171,6 +177,7 @@ CHAISCRIPT_MODULE_EXPORT chaiscript::ModulePtr create_chaiscript_module_test_mo
171177 m->add (chaiscript::fun (&TestBaseType::val), " val" );
172178 m->add (chaiscript::fun (&TestBaseType::const_val), " const_val" );
173179 m->add (chaiscript::fun (&TestBaseType::base_only_func), " base_only_func" );
180+ m->add (chaiscript::fun (&TestBaseType::set_string_val), " set_string_val" );
174181
175182#ifndef CHAISCRIPT_MSVC_12
176183 // we cannot support these in MSVC_12 because of a bug in the implementation of
Original file line number Diff line number Diff line change 1+ load_module("test_module")
2+
3+ var t2 = TestBaseType();
4+
5+ var s = "5";
6+ t2.set_string_val(s);
7+ assert_equal(s, "42")
8+
You can’t perform that action at this time.
0 commit comments