58 lines
1.6 KiB
C++
58 lines
1.6 KiB
C++
#include <stdio.h>
|
|
#include "test.h"
|
|
|
|
#include "beatmap.h"
|
|
#include "beatsaber.h"
|
|
|
|
//tests
|
|
int difficulties_test();
|
|
int characteristics_test();
|
|
|
|
test_t tests[] = {
|
|
difficulties_test, characteristics_test,
|
|
NULL};
|
|
|
|
int main(int argc, char** argv) {
|
|
|
|
test_t* current = tests;
|
|
int failcount = 0;
|
|
int testcount = 0;
|
|
for(; *current; current++) {
|
|
testcount++;
|
|
printf("\033[1mRunning test number: %d ", testcount);
|
|
if((*current)()) {
|
|
printf("\033[1;92msucceeded\033[0;1m!\n");
|
|
} else {
|
|
printf("\033[1;91mfailed\033[0;1m\n");
|
|
failcount++;
|
|
}
|
|
}
|
|
|
|
printf("\033[1;93m%d\033[0;1m/%d failed\n", failcount, testcount);
|
|
|
|
//beatsaber installation dir discovery test
|
|
std::string installdir = Beatsaber::findBeatsaberInstallation();
|
|
std::cout << "Beatsaber installation directory: " << installdir << std::endl;
|
|
|
|
auto list = Beatsaber::loadMapsfromInstallation();
|
|
std::cout << "Loaded: " << list.size() << " Maps from Beatsaber Installation" << std::endl;
|
|
|
|
/*for(auto i : list) {
|
|
if(i) {
|
|
i->printDebug();
|
|
std::cin.get();
|
|
}
|
|
}*/
|
|
|
|
//simple read test
|
|
/*std::shared_ptr<Beatsaber::BeatMap> bmap = Beatsaber::BeatMap::loadFromFolder("/home/yannis/Nextcloud/yannis/Beatsaber/BeatSaverLevel/1dd (Portal - Still Alive (Uppermost Remix) - kryptikos)");
|
|
if(!bmap) std::cout << "Could not load File" << std::endl;
|
|
else bmap->printDebug();
|
|
bmap = Beatsaber::BeatMap::loadFromZip("/home/yannis/Nextcloud/yannis/Beatsaber/BeatSaverLevel/18b92 (Empress of Light - ShadowLantern).zip");
|
|
if(!bmap) std::cout << "Could not load File" << std::endl;
|
|
else bmap->printDebug();
|
|
*/
|
|
|
|
return failcount > 0;
|
|
}
|