-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I'm having an issue with unittesting as the mongo connections cause an exception. Minimal test program provided. Is there a way to get around this or is it a problem with mondo?
I have tried this without the static pool thing as well as without using pool and getting connection directly with Mongo(...), same error.
core.exception.InvalidMemoryOperationError@src/core/exception.d(693): Invalid memory operation
import mondo;
class MongoAlloc {
static:
private MongoPool pool;
public Mongo GetConnection() {
if(!pool)
pool = new MongoPool("mongodb://localhost");
return pool.pop;
}
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
unittest {
Mongo mongo = MongoAlloc.GetConnection();
}
void main()
{
}