tests: Get username from environment

FossilOrigin-Name: 4c1432632b30cbe6e876af1b803dfbe826166cd9d5bfd4d15043c67bcd9a59de
This commit is contained in:
Jonathan Schleifer 2014-07-18 23:35:22 +00:00
parent 35212e3305
commit 2600168d95

View file

@ -14,12 +14,15 @@ OF_APPLICATION_DELEGATE(Test)
@implementation Test @implementation Test
- (void)applicationDidFinishLaunching - (void)applicationDidFinishLaunching
{ {
OFString *username =
[[OFApplication environment] objectForKey: @"USER"];
PGResult *result; PGResult *result;
connection = [[PGConnection alloc] init]; connection = [[PGConnection alloc] init];
[connection setParameters: [connection setParameters:
[OFDictionary dictionaryWithKeysAndObjects: @"user", @"js", [OFDictionary dictionaryWithKeysAndObjects: @"user", username,
@"dbname", @"js", nil]]; @"dbname", username,
nil]];
[connection connect]; [connection connect];
[connection executeCommand: @"DROP TABLE IF EXISTS test"]; [connection executeCommand: @"DROP TABLE IF EXISTS test"];