void runTesting() { TESTING = true; bool res = true, test; string out; cout << "Datagame testing started..." << endl; printf("Testing antivirusManager:\n"); out = antivirusManagerTest(); res &= test = out == string(""); if(!test) printf("%s\n", out.c_str()); printf("Testing antivirusManager %s\n", test ? "[OK]" : "[FAILED]"); printf("\nTesting disk:\n"); out = diskTest(); res &= test = out == string(""); if(!test) printf("%s\n", out.c_str()); printf("Testing disk %s\n", test ? "[OK]" : "[FAILED]"); printf("\nTesting file:\n"); out = fileTest(); res &= test = out == string(""); if(!test) printf("%s\n", out.c_str()); printf("Testing file %s\n", test ? "[OK]" : "[FAILED]"); printf("\nTesting folder:\n"); out = folderTest(); res &= test = out == string(""); if(!test) printf("%s\n", out.c_str()); printf("Testing folder %s\n", test ? "[OK]" : "[FAILED]"); printf("\nTesting filemanager:\n"); out = fileManagerTest(); res &= test = out == string(""); if(!test) printf("%s\n", out.c_str()); printf("Testing filemanager %s\n", test ? "[OK]" : "[FAILED]"); printf("\nTesting virus:\n"); out = virusTest(); res &= test = out == string(""); if(!test) printf("%s\n", out.c_str()); printf("Testing virus %s\n", test ? "[OK]" : "[FAILED]"); TESTING = false; exit(res ? 0 : 1); }
void imageElement::loadImage(string filename, float _scale) { this->file = filename; ofFile fileTest(ofToDataPath(file)); if (fileTest.exists()) { img.loadImage(filename); mediaLoaded = true; } else { mediaLoaded = false; ofLogError() << ofGetFrameNum() << "\t" << "file doesn't exist " << file; } this->scale = _scale; if (mediaLoaded) { this->w = img.getWidth() * _scale; this->h = img.getHeight() * _scale; } }
int main() { // Loop test Ape a = Ape(); //a.update(); //return 0; //while (1) { printf("\n"); a.update(); a.sort(CPU); a.printProcesses(CPU); usleep(1000 * 1000); system("clear"); //} Sys s = Sys(); printf(s.version); fileTest(); //removeTest(); //mapTest(); //initTest(); //sysTest(); //procStatTest(); //procCPUTest(); //fileTest(); //testCore(); //sendSignal(); //getchar(); }
int main(void) { Init(); DBG_MSG("----- Power On -----"); if(USBDevice_PlugIn()) { DBG_MSG( "Usb Init Started"); USB_Init(); }else{ DBG_MSG("FileSystem_Init"); FileSystem_Init(); fileTest(); } while(true);//Stop here char color[] = {0xff, 0xff, 0x00}; WS2812_Set(0, 3, color); color[0] = 0x00; color[2] = 0xff; WS2812_Set(3, 3, color); color[0] = 0xff; color[1] = 0x00; WS2812_Set(6, 3, color); LED_RED(true); Delay_ms(200); LED_GREEN(true); Delay_ms(200); LED_BLUE(true); DBG_MSG("Temperature: %f", TMP102_GetTemp()); DBG_MSG("Temperature: %f", TMP102_GetTemp()); // WavePlayer_Init(); // WavePlayerMenu_Start("/", "teq.wav"); // WavePlayer_Start(); // Reflective_Start(); // Analog_SetChannel(PHOTOTRANS_1_CH, true); // Analog_SetChannel(PHOTOTRANS_2_CH, true); // Analog_SetChannel(PHOTOTRANS_3_CH, true); // Analog_SetChannel(PHOTOTRANS_4_CH, true); // Analog_SetChannel(PHOTOTRANS_5_CH, true); Delay_ms(2000); MPU9250_InitProcedure(); SysTick_t tick = 0; while(true) { float accel[3], gyro[3], mag[3]; float yaw, pitch, roll; if(GetSystemTick() - tick > 1000){ if(MPU9250_CheckNewSample()){ MPU9250_Get9AxisData(accel, gyro, mag); MPU9250_CalcOrientation(&yaw, &pitch, &roll); } DBG_MSG("Temperature: %f", TMP102_GetTemp()); // DBG_MSG("ADC: %d %d %d %d %d", // Analog_GetChannelValue(PHOTOTRANS_1_CH), // Analog_GetChannelValue(PHOTOTRANS_2_CH), // Analog_GetChannelValue(PHOTOTRANS_3_CH), // Analog_GetChannelValue(PHOTOTRANS_4_CH), // Analog_GetChannelValue(PHOTOTRANS_5_CH) // ); for (int i = 0; i < 3; ++i) { DBG_MSG("MPU-Accel-%c: %f", i+'X', accel[i]); } for (int i = 0; i < 3; ++i) { DBG_MSG("MPU-Gyro-%c: %f", i+'X', gyro[i]); } for (int i = 0; i < 3; ++i) { DBG_MSG("MPU-Mag-%c: %f", i+'X', mag[i]); } DBG_MSG("MPU-Temp: %f", MPU9250_GetTemperature()); DBG_MSG("yaw: %f, pitch: %f, roll: %f", yaw, pitch, roll); tick = GetSystemTick(); } } }