Beispiel #1
0
TEST(ng_charreach, set) {
    CharReach cr;

    ASSERT_EQ(0U, cr.count());
    ASSERT_TRUE(cr.none());
    ASSERT_FALSE(cr.all());
    cr.set('q');
    ASSERT_EQ(1U, cr.count());
    cr.setall();
    ASSERT_EQ(cr.size(), cr.count());
    ASSERT_TRUE(cr.all());
}
Beispiel #2
0
TEST(Truffle, CompileDot) {
    m128 mask1, mask2;
    memset(&mask1, 0, sizeof(mask1));
    memset(&mask2, 0, sizeof(mask2));

    CharReach chars;

    chars.setall();

    truffleBuildMasks(chars, (u8 *)&mask1, (u8 *)&mask2);

    CharReach out = truffle2cr((u8 *)&mask1, (u8 *)&mask2);

    ASSERT_EQ(out, chars);

}
Beispiel #3
0
TEST(ng_charreach, clear) {
    CharReach cr;

    ASSERT_EQ(0U, cr.count());
    ASSERT_TRUE(cr.none());
    ASSERT_FALSE(cr.all());
    cr.set('q');
    cr.set('u');
    cr.set('a');
    cr.set('r');
    cr.set('k');
    ASSERT_EQ(5U, cr.count());
    cr.clear('r');
    ASSERT_EQ(4U, cr.count());
    ASSERT_FALSE(cr.test('r'));
    cr.setall();
    ASSERT_EQ(cr.size(), cr.count());
    ASSERT_TRUE(cr.all());
    cr.clear(0xff);
    ASSERT_FALSE(cr.all());
}