static int ext2_group_spare (int group) { if (group <= 1) { return 1; } return (test_root(group, 3) || test_root(group, 5) || test_root(group, 7)); }
static int ext4_group_sparse(ext4_group_t group) { if (group <= 1) return 1; if (!(group & 1)) return 0; return (test_root(group, 7) || test_root(group, 5) || test_root(group, 3)); }
bool ext2_bg_has_super(PEXT2_SUPER_BLOCK pExt2Sb, int group_block) { if (!(pExt2Sb->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) return true; if (test_root(group_block, 3) || (test_root(group_block, 5)) || test_root(group_block, 7)) return true; return false; }
int ext2fs_bg_has_super(ext2_filsys fs, int group_block) { if (!(fs->super->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) return 1; if (test_root(group_block, 3) || (test_root(group_block, 5)) || test_root(group_block, 7)) return 1; return 0; }
int ext2fs_bg_has_super(ext2_filsys fs, dgrp_t group) { if (group == 0) return 1; if (ext2fs_has_feature_sparse_super2(fs->super)) { if (group == fs->super->s_backup_bgs[0] || group == fs->super->s_backup_bgs[1]) return 1; return 0; } if ((group <= 1) || !ext2fs_has_feature_sparse_super(fs->super)) return 1; if (!(group & 1)) return 0; if (test_root(group, 3) || (test_root(group, 5)) || test_root(group, 7)) return 1; return 0; }
int ext2fs_bg_has_super(ext2_filsys fs, dgrp_t group) { if (group == 0) return 1; if (fs->super->s_feature_compat & EXT4_FEATURE_COMPAT_SPARSE_SUPER2) { if (group == fs->super->s_backup_bgs[0] || group == fs->super->s_backup_bgs[1]) return 1; return 0; } if ((group <= 1) || !(fs->super->s_feature_ro_compat & EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER)) return 1; if (!(group & 1)) return 0; if (test_root(group, 3) || (test_root(group, 5)) || test_root(group, 7)) return 1; return 0; }
TEST_F(PlistTests, test_parse_plist_content_with_blobs) { pt::ptree tree; fs::path test_root(kTestDataPath); auto s = parsePlist((test_root / "test_binary.plist").string(), tree); EXPECT_TRUE(s.ok()); EXPECT_EQ(s.toString(), "OK"); EXPECT_THROW(tree.get<bool>("foobar"), pt::ptree_bad_path); EXPECT_EQ(tree.get<std::string>("SessionItems.Controller"), "CustomListItems"); auto first_element = tree.get_child("SessionItems.CustomListItems").begin()->second; EXPECT_EQ(first_element.get<std::string>("Name"), "Flux"); std::string alias = base64Decode(first_element.get<std::string>("Alias")); // Verify we parsed the binary blob correctly EXPECT_NE(alias.find("Applications/Flux.app"), std::string::npos); }
int main(int argc, char** argv) { printf("TRIE TESTS\n"); printf("==================\n\n"); init (argc, argv); test_mount(); test_minimaltrie(); test_simple(); test_us(); test_cascading(); test_root(); test_default(); test_modules(); test_defaultonly(); printf("\ntest_trie RESULTS: %d test(s) done. %d error(s).\n", nbTest, nbError); return nbError; }
int main(int argc, char** argv) { printf("TRIE TESTS\n"); printf("==================\n\n"); init (argc, argv); test_minimaltrie(); test_simple(); test_iterate(); test_reviterate(); test_moreiterate(); test_revmoreiterate(); test_umlauts(); test_endings(); test_root(); test_double(); test_emptyvalues(); printf("\ntest_trie RESULTS: %d test(s) done. %d error(s).\n", nbTest, nbError); return nbError; }
static void test_all_root() { test_root(two, zero, zero, "2|zero"); test_root(three, zero, zero, "3|zero"); test_root(three, half, dec64_new(7937005259840997, -16), "3|1/2"); test_root(three, dec64_new(27, 0), three, "3|27"); test_root(three, dec64_new(-27, 0), dec64_new(-3, 0), "3|-27"); test_root(three, pi, dec64_new(14645918875615233, -16), "3|pi"); test_root(four, dec64_new(-27, 0), nan, "4|-27"); test_root(four, dec64_new(256, 0), four, "4|256"); test_root(four, dec64_new(1, 4), ten, "4|1e4"); test_root(four, dec64_new(1, 16), dec64_new(1, 4), "4|1e16"); test_root(four, pi, dec64_new(13313353638003897, -16), "4|pi"); }