3 #include "OSGBaseInitFunctions.h"
5 void dump(OSG::TestFC
*pT
)
7 fprintf(stderr
, "%d %d\n",
8 pT
->getSFField2()->getValue(),
9 pT
->getSFField4()->getValue());
14 OSG::TestFCUnrecPtr pT1
= OSG::TestFC::create();
15 OSG::TestFCUnrecPtr pT2
= OSG::TestFC::create();
17 OSG::Thread::getCurrentChangeList()->clear();
22 addConnection(pT1
, "field2",
25 pT1
->editSFField2()->setValue(42);
36 void testTargetDestroyed(void)
38 OSG::TestFCUnrecPtr pT1
= OSG::TestFC::create();
39 OSG::TestFCUnrecPtr pT2
= OSG::TestFC::create();
41 OSG::Thread::getCurrentChangeList()->clear();
46 addConnection(pT1
, "field2",
49 pT1
->editSFField2()->setValue(42);
58 pT1
->editSFField2()->setValue(1199);
65 void testSubConnection(void)
67 OSG::TestFCUnrecPtr pT1
= OSG::TestFC::create();
68 OSG::TestFCUnrecPtr pT2
= OSG::TestFC::create();
70 OSG::Thread::getCurrentChangeList()->clear();
75 addConnection(pT1
, "field2",
78 pT1
->editSFField2()->setValue(42);
85 subConnection(pT1
, "field2",
89 pT1
->editSFField2()->setValue(1199);
101 void testSubConnectionSrcOnly(void)
103 OSG::TestFCUnrecPtr pT1
= OSG::TestFC::create();
104 OSG::TestFCUnrecPtr pT2
= OSG::TestFC::create();
106 OSG::Thread::getCurrentChangeList()->clear();
111 addConnection(pT1
, "field2",
114 pT1
->editSFField2()->setValue(42);
116 OSG::commitChanges();
121 subConnection(pT1
, "field2",
125 pT1
->editSFField2()->setValue(1199);
127 OSG::commitChanges();
137 void testSubConnectionSrcAll(void)
139 OSG::TestFCUnrecPtr pT1
= OSG::TestFC::create();
140 OSG::TestFCUnrecPtr pT2
= OSG::TestFC::create();
142 OSG::Thread::getCurrentChangeList()->clear();
147 addConnection(pT1
, "field2",
150 pT1
->editSFField2()->setValue(42);
152 OSG::commitChanges();
157 subConnection(pT1
, "field2",
161 pT1
->editSFField2()->setValue(1199);
163 OSG::commitChanges();
173 int main (int argc
, char **argv
)
175 OSG::osgInit(argc
, argv
);
177 fprintf(stderr
, "TestSimple\n");
180 fprintf(stderr
, "TestTargetDestroyed\n");
181 testTargetDestroyed();
183 fprintf(stderr
, "TestSubConnection\n");
186 fprintf(stderr
, "TestSubConnectionSrcOnly\n");
187 testSubConnectionSrcOnly();
189 fprintf(stderr
, "TestSubConnectionSrcAll\n");
190 testSubConnectionSrcAll();