OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Ginsu Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "c_salt/integration_tests/property_tester.h" | |
6 | |
7 #include <cstdio> | |
8 | |
9 #include "c_salt/property.h" | |
10 #include "c_salt/scripting_bridge.h" | |
11 #include "c_salt/variant.h" | |
12 #include "c_salt/variant_ptrs.h" | |
13 | |
14 void PropertyTester::InitializeMethods(c_salt::ScriptingBridge* bridge) { | |
15 // No methods in this class. | |
16 } | |
17 | |
18 void PropertyTester::InitializeProperties(c_salt::ScriptingBridge* bridge) { | |
19 c_salt::SharedVariant value(new c_salt::Variant(static_cast<int32_t>(42))); | |
20 c_salt::PropertyAttributes prop1("intProp", value); | |
21 prop1.set_static().set_immutable(); | |
22 bridge->AddProperty(c_salt::Property(prop1)); | |
23 | |
24 value.reset(new c_salt::Variant("A string.")); | |
25 c_salt::PropertyAttributes prop2("stringProp", value); | |
26 prop2.set_mutable(); | |
27 bridge->AddProperty(c_salt::Property(prop2)); | |
28 } | |
OLD | NEW |