Commit 289abdc9 authored by peastman's avatar peastman
Browse files

Merge pull request #288 from peastman/master

Test cases detect if CPU is not supported and exit rather than crashing
parents 2b10b617 9966f134
...@@ -223,6 +223,10 @@ void testForce(int numParticles, NonbondedForce::NonbondedMethod method, GBSAOBC ...@@ -223,6 +223,10 @@ void testForce(int numParticles, NonbondedForce::NonbondedMethod method, GBSAOBC
int main() { int main() {
try { try {
if (!CpuPlatform::isProcessorSupported()) {
cout << "CPU is not supported. Exiting." << endl;
return 0;
}
testSingleParticle(); testSingleParticle();
testCutoffAndPeriodic(); testCutoffAndPeriodic();
for (int i = 5; i < 11; i++) { for (int i = 5; i < 11; i++) {
......
...@@ -264,6 +264,10 @@ void testRandomSeed() { ...@@ -264,6 +264,10 @@ void testRandomSeed() {
int main() { int main() {
try { try {
if (!CpuPlatform::isProcessorSupported()) {
cout << "CPU is not supported. Exiting." << endl;
return 0;
}
testSingleBond(); testSingleBond();
testTemperature(); testTemperature();
testConstraints(); testConstraints();
......
...@@ -105,6 +105,10 @@ void testConstraints() { ...@@ -105,6 +105,10 @@ void testConstraints() {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
try { try {
if (!CpuPlatform::isProcessorSupported()) {
cout << "CPU is not supported. Exiting." << endl;
return 0;
}
testConstraints(); testConstraints();
} }
catch(const exception& e) { catch(const exception& e) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment