From 80a71b3d2bd6ea268764336cb4eb7599fd9ad7ea Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 25 Apr 2012 21:47:33 -0700 Subject: [PATCH] Bugfixes, unit test support. --- src/SerializedObject.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SerializedObject.h b/src/SerializedObject.h index b97fd286f2..0b4fbc7574 100644 --- a/src/SerializedObject.h +++ b/src/SerializedObject.h @@ -31,7 +31,10 @@ enum SOE_Field sfAccount, sfSequence, sfBalance, sfWalletLocator, sfEmailHash, sfBorrower, sfLendfer, sfLimit, sfOfferCurrency, sfLastReceive, sfLastTxn, sfLender, sfNextRate, sfNextRateLgr, sfNextRateExp, - sfNickname, sfMinimumOffer + sfNickname, sfMinimumOffer, + + // test fields + sfTest1, sfTest2, sfTest3, sfTest4 }; struct SOElement @@ -65,6 +68,7 @@ public: virtual bool isEquivalent(const SerializedType& t) const; void add(Serializer& s) const; + Serializer getSerializer() const { Serializer s; add(s); return s; } std::string getFullText() const; std::string getText() const; virtual Json::Value getJson(int options) const; @@ -119,8 +123,10 @@ public: { setValueFieldAccount(field, addr.getAccountID()); } bool isFieldPresent(SOE_Field field) const; - void makeFieldPresent(SOE_Field field); + SerializedType* makeFieldPresent(SOE_Field field); void makeFieldAbsent(SOE_Field field); + + static void unitTest(); };