2525#include < diffpy/srreal/PDFCalculator.hpp>
2626#include < diffpy/serialization.hpp>
2727#include " test_helpers.hpp"
28- #include " test_custompqconfig.hpp"
2928
3029using namespace std ;
3130using namespace diffpy ::srreal;
@@ -47,23 +46,20 @@ class TestNoMetaStructureAdapter : public CxxTest::TestSuite
4746 CxxTest::setAbortTestOnFail (true );
4847 if (!m_pswt)
4948 {
50- StructureAdapterPtr pswt;
51- pswt = loadTestPeriodicStructure (" PbScW25TiO3.stru" );
52- PeriodicAdapterWithPQConfigPtr pswt_pqcfg;
53- pswt_pqcfg = addCustomPQConfig (pswt);
54- pswt_pqcfg->cfg [" scale" ] = 2.5 ;
55- m_pswt = pswt_pqcfg;
49+ m_pswt = loadTestPeriodicStructure (" PbScW25TiO3.stru" );
5650 }
5751 CxxTest::setAbortTestOnFail (false );
5852 }
5953
6054
61- void test_PDFCalcMeta ()
55+ void test_PDFCalcPreservesConfiguration ()
6256 {
6357 PDFCalculator pdfc;
6458 pdfc.setRstep (0.1 );
6559 pdfc.setRmax (5.0 );
66- TS_ASSERT_EQUALS (1.0 , pdfc.getDoubleAttr (" scale" ));
60+ pdfc.setDoubleAttr (" scale" , 2.5 );
61+ pdfc.setStructure (m_pswt);
62+ TS_ASSERT_EQUALS (2.5 , pdfc.getDoubleAttr (" scale" ));
6763 pdfc.eval (m_pswt);
6864 TS_ASSERT_EQUALS (2.5 , pdfc.getDoubleAttr (" scale" ));
6965 }
@@ -84,7 +80,11 @@ class TestNoMetaStructureAdapter : public CxxTest::TestSuite
8480 {
8581 StructureAdapterPtr adpt0 = nometa (m_pswt);
8682 StructureAdapterPtr adpt1 = nometa (adpt0);
83+ TS_ASSERT_EQUALS (m_pswt, adpt0);
8784 TS_ASSERT_EQUALS (adpt0, adpt1);
85+ TS_ASSERT_EQUALS (emptyStructureAdapter (), nometa (StructureAdapterPtr ()));
86+ StructureAdapterPtr proxy (new NoMetaStructureAdapter (m_pswt));
87+ TS_ASSERT_EQUALS (proxy, nometa (proxy));
8888 }
8989
9090
@@ -93,7 +93,7 @@ class TestNoMetaStructureAdapter : public CxxTest::TestSuite
9393 using namespace diffpy ::serialization;
9494 stringstream storage (ios::in | ios::out | ios::binary);
9595 oarchive oa (storage, ios::binary);
96- StructureAdapterPtr pswtbare0 (nometa (m_pswt));
96+ StructureAdapterPtr pswtbare0 (new NoMetaStructureAdapter (m_pswt));
9797 oa << pswtbare0;
9898 iarchive ia (storage, ios::binary);
9999 StructureAdapterPtr pswtbare1;
0 commit comments