Verificacion de argumentos en test_core
authorslack <slack@ommadawn.(none)>
Sat, 21 Jun 2008 22:40:02 +0000 (00:40 +0200)
committerslack <slack@ommadawn.(none)>
Sat, 21 Jun 2008 22:40:02 +0000 (00:40 +0200)
Makefile
tests/test_core.cc

index 71704cf0ad7a35a9513a6aed10c2265572f3eb3f..0c67d3765fd49f55380139c2e55d7317a9f70985 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ CXXFLAGS=-g -Wall -Weffc++ -Wstrict-null-sentinel -Wold-style-cast \
         -Woverloaded-virtual 
 LDFLAGS=-g
 
-all: gbcore.o MBC.o GBMemory.o GBRom.o GBVideo.o
+all: tests
 
 tests: tests/test_gbrom tests/test_core
 
index 6a6b257b5427f3a9ee2f091b8ae2add2bbc2a146..5518065e8cb2b4e9ff89d17e65393273cf4b96b9 100644 (file)
@@ -1,13 +1,16 @@
 #include "../gbcore.h"
 #include <iostream>
+#include <cstdlib>
 
 int main(int argc, char **argv)
 {
+       if (argc != 2) {
+               std::cerr << "Usage: " << argv[0] << " rom_file" << std::endl;
+               exit(EXIT_FAILURE);
+       }
        GameBoy gb(argv[1]);
        while(1)
        {
                gb.run_cycle();
        }
-
-
 }