Browse Source

SC: cleanup getResultAsInt

tags/v1.3.0
Brian Heim 5 years ago
parent
commit
be15b44450
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      src/SuperColliderEngine.cpp

+ 10
- 5
src/SuperColliderEngine.cpp View File

@@ -174,12 +174,17 @@ int SC_VcvPrototypeClient::getResultAsInt(const char* text) noexcept {
auto* resultSlot = &scGlobals()->result;
if (IsInt(resultSlot)) {
auto intResult = slotRawInt(resultSlot);
printf("%s: %d\n", text, intResult);
return intResult;
if (intResult > 0) {
return intResult;
} else {
// TODO better formatting
FAIL(std::string("Result of '") + text "' should be > 0");
return -1;
}
} else {
FAIL(std::string("Result of '") + text + "' should be Integer");
return -1;
}

FAIL(std::string("Result of '") + text + "' was not int as expected");
return -1;
}

__attribute__((constructor(1000)))


Loading…
Cancel
Save