"vscode:/vscode.git/clone" did not exist on "f08e5bf159ec9bf518e8764ded31e4bf6f52db6f"
Commit 9966f134 authored by Peter Eastman's avatar Peter Eastman
Browse files

Test cases detect if CPU is not supported and exit rather than crashing

parent bd543402
...@@ -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