Пример #1
0
 TEST(WriteConcern, Defaults) {
     WriteConcern wc;
     ASSERT_FALSE(wc.hasMode());
     ASSERT_EQUALS(wc.nodes(), 1);
     ASSERT_FALSE(wc.journal());
     ASSERT_FALSE(wc.fsync());
     ASSERT_EQUALS(wc.timeout(), 0);
 }
Пример #2
0
    TEST(WriteConcern, Chain) {
        WriteConcern wc = WriteConcern().nodes(2).journal(true);
        ASSERT_EQUALS(wc.nodes(), 2);
        ASSERT_FALSE(wc.hasMode());
        ASSERT_TRUE(wc.journal());

        // should be defaults
        ASSERT_FALSE(wc.fsync());
        ASSERT_EQUALS(wc.timeout(), 0);
    }