ardour
scalar_properties.cc
Go to the documentation of this file.
1 #include "scalar_properties.h"
2 
4 
5 using namespace std;
6 using namespace PBD;
7 
8 namespace Properties {
10 };
11 
12 void
14 {
15  Properties::fred.property_id = g_quark_from_static_string ("fred");
16 }
17 
19  : _fred (Properties::fred, 0)
20 {
21 }
22 
23 void
25 {
26  CPPUNIT_ASSERT (_fred.changed() == false);
27 
28  _fred = 4;
29  CPPUNIT_ASSERT (_fred == 4);
30  CPPUNIT_ASSERT (_fred.changed() == true);
31 
32  _fred.clear_changes ();
33  CPPUNIT_ASSERT (_fred.changed() == false);
34 
35  _fred = 5;
36  CPPUNIT_ASSERT (_fred == 5);
37  CPPUNIT_ASSERT (_fred.changed() == true);
38 
39  PropertyList changes;
40  _fred.get_changes_as_properties (changes, 0);
41 
42  CPPUNIT_ASSERT (changes.size() == 1);
43 
44  PropertyTemplate<int>* t = dynamic_cast<Property<int>*> (changes.begin()->second);
45  CPPUNIT_ASSERT (t);
46  CPPUNIT_ASSERT (t->val() == 5);
47 }
CPPUNIT_TEST_SUITE_REGISTRATION(ScalarPropertiesTest)
Definition: Beats.hpp:239
static void make_property_quarks()
bool changed() const
Definition: properties.h:130
PBD::PropertyDescriptor< int > fred
PBD::Property< int > _fred
Definition: debug.h:30