@@ -398,6 +398,7 @@ class EnvironmentVariables : public CommandFixture {
398
398
protected:
399
399
EnvironmentVariables () : CommandFixture(0 , nullptr ) {
400
400
SetEnv (" NAME" , " VALUE" );
401
+ SetEnv (" LOGNAME" , " loginName" );
401
402
SetEnv (" EMPTY" , " " );
402
403
}
403
404
@@ -495,3 +496,33 @@ TEST_F(EnvironmentVariables, ErrMsgTooShort) {
495
496
1 );
496
497
CheckDescriptorEqStr (errMsg.get (), " Mis" );
497
498
}
499
+
500
+ TEST_F (EnvironmentVariables, GetlogGetName) {
501
+ const int charLen{11 };
502
+ char input[charLen]{" XXXXXXXXX" };
503
+
504
+ FORTRAN_PROCEDURE_NAME (getlog)
505
+ (reinterpret_cast <std::int8_t *>(input), charLen);
506
+
507
+ EXPECT_NE (input, " loginName" );
508
+ }
509
+
510
+ TEST_F (EnvironmentVariables, GetlogBufferShort) {
511
+ const int charLen{7 };
512
+ char input[charLen]{" XXXXXX" };
513
+
514
+ FORTRAN_PROCEDURE_NAME (getlog)
515
+ (reinterpret_cast <std::int8_t *>(input), charLen);
516
+
517
+ EXPECT_NE (input, " loginN" );
518
+ }
519
+
520
+ TEST_F (EnvironmentVariables, GetlogPadSpace) {
521
+ const int charLen{12 };
522
+ char input[charLen]{" XXXXXXXXXX" };
523
+
524
+ FORTRAN_PROCEDURE_NAME (getlog)
525
+ (reinterpret_cast <std::int8_t *>(input), charLen);
526
+
527
+ EXPECT_NE (input, " loginName " );
528
+ }
0 commit comments