improved readability of numeric assertion failures
This commit is contained in:
parent
92ab2c84b6
commit
aa6743e118
|
@ -1187,7 +1187,7 @@ void setupSimulatedSystem(vector<Future<Void>>* systemActors, std::string baseFo
|
|||
}
|
||||
deterministicRandom()->randomShuffle(coordinatorAddresses);
|
||||
|
||||
ASSERT( coordinatorAddresses.size() == coordinatorCount );
|
||||
ASSERT_EQ( coordinatorAddresses.size(), coordinatorCount );
|
||||
ClusterConnectionString conn(coordinatorAddresses, LiteralStringRef("TestCluster:0"));
|
||||
|
||||
// If extraDB==0, leave g_simulator.extraDB as null because the test does not use DR.
|
||||
|
@ -1216,7 +1216,7 @@ void setupSimulatedSystem(vector<Future<Void>>* systemActors, std::string baseFo
|
|||
int machines = machineCount / dataCenters + (dc < machineCount % dataCenters); // add remainder of machines to first datacenter
|
||||
int dcCoordinators = coordinatorCount / dataCenters + (dc < coordinatorCount%dataCenters);
|
||||
printf("Datacenter %d: %d/%d machines, %d/%d coordinators\n", dc, machines, machineCount, dcCoordinators, coordinatorCount);
|
||||
ASSERT( dcCoordinators <= machines );
|
||||
ASSERT_LE(dcCoordinators, machines);
|
||||
|
||||
//FIXME: temporarily code to test storage cache
|
||||
//TODO: caching disabled for this merge
|
||||
|
|
|
@ -72,7 +72,12 @@ Error internal_error_impl(const char* msg, const char* file, int line) {
|
|||
}
|
||||
|
||||
Error internal_error_impl(const char* a_nm, long long a, const char * op_nm, const char * b_nm, long long b, const char * file, int line) {
|
||||
fprintf(stderr, "Assertion %s (%lld) %s %s (%lld) failed @ %s %d:\n", a_nm, a, op_nm, b_nm, b, file, line, platform::get_backtrace().c_str());
|
||||
fprintf(stderr, "Assertion failed @ %s %d:\n", file, line);
|
||||
fprintf(stderr, " expression:\n");
|
||||
fprintf(stderr, " %s %s %s\n", a_nm, op_nm, b_nm);
|
||||
fprintf(stderr, " expands to:\n");
|
||||
fprintf(stderr, " %lld %s %lld\n\n", a, op_nm, b);
|
||||
fprintf(stderr, " %s\n", platform::get_backtrace().c_str());
|
||||
|
||||
TraceEvent(SevError, "InternalError")
|
||||
.error(Error::fromCode(error_code_internal_error))
|
||||
|
|
Loading…
Reference in New Issue