}
+void
+check_rollback_statistics(unsigned int numCreate, unsigned int numModify, unsigned int numDelete)
+{
+ sh->setComparison(first, second);
+
+ Files& files = sh->getFiles();
+ for (Files::iterator it = files.begin(); it != files.end(); ++it)
+ it->setRollback(true);
+
+ RollbackStatistic rs = sh->getRollbackStatistic();
+
+ check_int_equal(rs.numCreate, numCreate);
+ check_int_equal(rs.numModify, numModify);
+ check_int_equal(rs.numDelete, numDelete);
+}
+
+
void
rollback()
{
}
-#define check_true(expr) \
- do { \
- bool actual = (expr); \
- if (!actual) \
- check_failure(#expr, actual, true, __FILE__, __LINE__, \
- __PRETTY_FUNCTION__); \
+#define check_true(expr) \
+ do { \
+ bool actual = (expr); \
+ if (!actual) \
+ check_failure(#expr, actual, true, __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__); \
} while (0)
-#define check_zero(expr) \
- do { \
- int actual = (expr); \
- if (actual != 0) \
- check_failure(#expr, actual, 0, __FILE__, __LINE__, \
- __PRETTY_FUNCTION__); \
+#define check_zero(expr) \
+ do { \
+ int actual = (expr); \
+ if (actual != 0) \
+ check_failure(#expr, actual, 0, __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__); \
+ } while (0)
+
+
+#define check_int_equal(expr, expected) \
+ do { \
+ unsigned int actual = (expr); \
+ if (actual != expected) \
+ check_failure(#expr, actual, expected, __FILE__, __LINE__, \
+ __PRETTY_FUNCTION__); \
} while (0)
void setup();
void first_snapshot();
void second_snapshot();
+void check_rollback_statistics(unsigned int numCreate, unsigned int numModify,
+ unsigned int numDelete);
void rollback();
void check_first();