Пример #1
0
int main(int argc, char **argv) {
    spdlog::set_sync_mode();
    auto console = spdlog::stdout_color_mt("console");
    console->set_level(spdlog::level::warn);
    console->set_pattern("[          ] [%Y-%m-%d %H:%M:%S] [%t] [%l] %v");

    int result = perform_tests(argc, argv);

    spdlog::drop_all();
    return result;
}
Пример #2
0
void Character::print_calculations(char* key){		//prints the results
	perform_tests();
	if(*key=='1'){
		std::cout<<"Character in bounding box: "<<ul_r<<","<<ul_c<<" to "<<ul_r+height<<","<<ul_c+width<<std::endl;
		std::cout<<"===================================="<<std::endl;
		std::cout<<"BQ1="<<q1<<" BQ2="<<q2<<" BQ3="<<q3<<" BQ4="<<q4<<" BQD="<<qd<<std::endl;
		std::cout<<"Euler number="<<euler<<std::endl;
		std::cout<<"Area="<<area<<std::endl;
		std::cout<<"Perimeter="<<perimeter<<std::endl;
		std::cout<<"VCentroid="<<vcen<<" / HCentroid="<<hcen<<std::endl;
		std::cout<<"Shifted VCentroid="<<svcen<<" / Shifted HCentroid="<<shcen<<std::endl;
		std::cout<<"VSym="<<vsym<<" / HSym="<<hsym<<std::endl;
		std::cout<<"Aspect ratio="<<aspect<<std::endl;
		std::cout<<"Character is classified as: "<<get_classification()<<"\n"<<std::endl;
	}else{
		std::cout<<get_classification()<<" ";
	}
}
Пример #3
0
int
main (int argc, char *argv[])
{
  size_t nr_failed;
  guestfs_h *g;

  setbuf (stdout, NULL);

  no_test_warnings ();

  g = create_handle ();

  nr_failed = perform_tests (g);

  guestfs_close (g);

  if (nr_failed > 0) {
    printf ("***** %zu / %zu tests FAILED *****\n", nr_failed, nr_tests);
    exit (EXIT_FAILURE);
  }

  exit (EXIT_SUCCESS);
}
Пример #4
0
int main(void)
{
    const struct bios_config *bios;
    int acpi_enabled;

    /* Initialise hypercall stubs with RET, rendering them no-ops. */
    memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);

    printf("HVM Loader\n");

    init_hypercalls();

    xenbus_setup();

    bios = detect_bios();
    printf("System requested %s\n", bios->name);

    printf("CPU speed is %u MHz\n", get_cpu_mhz());

    apic_setup();
    pci_setup();

    smp_initialise();

    perform_tests();

    if ( bios->bios_info_setup )
        bios->bios_info_setup();

    if ( bios->create_smbios_tables )
    {
        printf("Writing SMBIOS tables ...\n");
        bios->create_smbios_tables();
    }

    printf("Loading %s ...\n", bios->name);
    if ( bios->bios_load )
        bios->bios_load(bios);
    else
    {
        BUG_ON(bios->bios_address + bios->image_size >
               HVMLOADER_PHYSICAL_ADDRESS);
        memcpy((void *)bios->bios_address, bios->image,
               bios->image_size);
    }

    if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode )
    {
        if ( bios->create_mp_tables )
            bios->create_mp_tables();
        if ( bios->create_pir_tables )
            bios->create_pir_tables();
    }

    if ( bios->load_roms )
        bios->load_roms();

    acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1);

    if ( acpi_enabled )
    {
        init_vnuma_info();

        if ( bios->acpi_build_tables )
        {
            printf("Loading ACPI ...\n");
            bios->acpi_build_tables();
        }

        acpi_enable_sci();

        hvm_param_set(HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
    }

    init_vm86_tss();

    cmos_write_memory_size();

    printf("BIOS map:\n");
    if ( SCRATCH_PHYSICAL_ADDRESS != scratch_start )
        printf(" %05x-%05lx: Scratch space\n",
               SCRATCH_PHYSICAL_ADDRESS, scratch_start);
    printf(" %05x-%05x: Main BIOS\n",
           bios->bios_address,
           bios->bios_address + bios->image_size - 1);

    if ( bios->e820_setup )
        bios->e820_setup();

    if ( bios->bios_info_finish )
        bios->bios_info_finish();

    xenbus_shutdown();

    printf("Invoking %s ...\n", bios->name);
    return 0;
}
Пример #5
0
int main(void)
{
    const struct bios_config *bios;
    int acpi_enabled;
    const struct hvm_modlist_entry *bios_module;

    /* Initialise hypercall stubs with RET, rendering them no-ops. */
    memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE);

    printf("HVM Loader\n");
    BUG_ON(hvm_start_info->magic != XEN_HVM_START_MAGIC_VALUE);

    init_hypercalls();

    memory_map_setup();

    xenbus_setup();

    bios = detect_bios();
    printf("System requested %s\n", bios->name);

    printf("CPU speed is %u MHz\n", get_cpu_mhz());

    apic_setup();
    pci_setup();

    smp_initialise();

    perform_tests();

    if ( bios->bios_info_setup )
        bios->bios_info_setup();

    if ( bios->create_smbios_tables )
    {
        printf("Writing SMBIOS tables ...\n");
        bios->create_smbios_tables();
    }

    printf("Loading %s ...\n", bios->name);
    bios_module = get_module_entry(hvm_start_info, "firmware");
    if ( bios_module )
    {
        uint32_t paddr = bios_module->paddr;

        bios->bios_load(bios, (void*)paddr, bios_module->size);
    }
#ifdef ENABLE_ROMBIOS
    else if ( bios == &rombios_config )
    {
        bios->bios_load(bios, NULL, 0);
    }
#endif
    else
    {
        /*
         * If there is no BIOS module supplied and if there is no embeded BIOS
         * image, then we failed. Only rombios might have an embedded bios blob.
         */
        printf("no BIOS ROM image found\n");
        BUG();
    }

    if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode )
    {
        if ( bios->create_mp_tables )
            bios->create_mp_tables();
        if ( bios->create_pir_tables )
            bios->create_pir_tables();
    }

    if ( bios->load_roms )
        bios->load_roms();

    acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1);

    if ( acpi_enabled )
    {
        init_vnuma_info();

        if ( bios->acpi_build_tables )
        {
            printf("Loading ACPI ...\n");
            bios->acpi_build_tables();
        }

        acpi_enable_sci();

        hvm_param_set(HVM_PARAM_ACPI_IOPORTS_LOCATION, 1);
    }

    init_vm86_tss();

    cmos_write_memory_size();

    printf("BIOS map:\n");
    if ( SCRATCH_PHYSICAL_ADDRESS != scratch_start )
        printf(" %05x-%05lx: Scratch space\n",
               SCRATCH_PHYSICAL_ADDRESS, scratch_start);
    printf(" %05x-%05x: Main BIOS\n",
           bios->bios_address,
           bios->bios_address + bios->image_size - 1);

    if ( bios->e820_setup )
        bios->e820_setup();

    if ( bios->bios_info_finish )
        bios->bios_info_finish();

    xenbus_shutdown();

    printf("Invoking %s ...\n", bios->name);
    return 0;
}