int main (int argc, const char **argv) { int res = 0; size_t i, j; for (i = 0; i < num_angle_tests; i ++) { if (!test_angle (test_angles[i])) res = 1; } for (i = 0; i < num_angle_tests; i ++) { for (j = 0; j < num_scale_tests; j ++) { if (!test_transform (test_angles[i], test_scales[j])) res = 1; } } for (i = 0; i < num_angle_tests; i ++) { for (j = 0; j < num_scale_tests; j ++) { if (!test_transform2 (test_angles[i], test_scales[j])) res = 1; } } for (i = 0; i < num_angle_tests; i ++) { for (j = 0; j < num_scale_tests; j ++) { if (!test_inverse (test_angles[i], test_scales[j])) res = 1; } } return res; }
int main() { int Error = 0; Error += test_angle(); return Error; }
int main() { int Error = 0; Error += test_angle(); Error += test_orientedAngle_vec2(); Error += test_orientedAngle_vec3(); return Error; }
int TestApp::main() { // Create a console window for text-output if not available ConsoleWindow console("Console"); try { Console::write_line("ClanLib Test Suite:"); Console::write_line("-------------------"); #ifdef WIN32 Console::write_line("Target: WIN32"); #else Console::write_line("Target: LINUX"); #endif Console::write_line("Directory: API/Core/Math"); test_bigint(); test_angle(); test_quaternion_f(); test_quaternion_d(); test_vector2(); test_vector3(); test_vector4(); test_matrix(); test_line2(); test_line3(); test_line_ray2(); test_line_ray3(); test_line_segment2(); test_line_segment3(); test_triangle(); test_rect(); Console::write_line("All Tests Complete"); console.display_close_message(); } catch(Exception error) { Console::write_line("Exception caught:"); Console::write_line(error.message); console.display_close_message(); return -1; } return 0; }
int main( int argc, char **argv ) { printf("Init la_ctest\n"); (void) argc; (void) argv; // init srand((unsigned int)time(NULL)); // might break in 2038 aa_test_ulimit(); test_ssd(); test_angle(); test_meancov(); printf("Ending la_ctest\n"); }
void asw_test_marinenearby_f(const CCommand &args) { Msg("0.5 as float = %f\n", 0.5f); Msg("0.5f as int = %d\n", (int) 0.5f); Msg("0.51f as int = %d\n", (int) 0.51f); Msg("0.52f as int = %d\n", (int) 0.52f); Msg("0.6f as int = %d\n", (int) 0.6f); Msg("0.56f as int = %d\n", (int) 0.56f); Msg("0.49f as int = %d\n", (int) 0.49f); Msg("1.99f as int = %d\n", (int) 1.99f); Msg("2.01f as int = %d\n", (int) 2.01f); CASW_Player *pPlayer = ToASW_Player(UTIL_GetCommandClient()); if (!ASWGameRules()) return; if (!pPlayer || !pPlayer->GetMarine()) return; if ( args.ArgC() < 4 ) { Msg("Usage: asw_test_marinenearby [0|1] [grid step] [grid count]\n"); } int iWide = atoi(args[1]); float fGridStep = atof(args[2]); int iGridCount = atoi(args[3]); //Msg("Wide = %d, step = %f, count = %d\n", iWide, fGridStep, iGridCount); Vector asw_default_camera_dir_2; QAngle test_angle(asw_marine_nearby_angle.GetFloat(), 90, 0); AngleVectors(test_angle, &asw_default_camera_dir_2); Vector asw_default_camera_offset_2 = asw_default_camera_dir_2 * -405.0f; for (int x=-iGridCount;x<iGridCount;x++) { for (int y=-iGridCount;y<iGridCount*3;y++) { Vector pos = pPlayer->GetMarine()->GetAbsOrigin() + Vector(x * fGridStep, y*fGridStep, 10); //Msg("Testing pos %f, %f, %f\n", pos.x, pos.y, pos.z); bool bCorpseCanSee = false; UTIL_ASW_AnyMarineCanSee(pos, iWide, bCorpseCanSee); } } Vector pos = (pPlayer->GetMarine()->GetAbsOrigin() + asw_default_camera_offset_2); //NDebugOverlay::Line(pos, pos + asw_default_camera_dir_2 * 410, 0,0,255,true, 30); }