@@ -565,13 +565,13 @@ void testDefaultOpenNoName2() {
565565 void addEnvFlag () {
566566 final Path file = tempDir .createTempFile ();
567567 try (Env <ByteBuffer > env =
568- Env .create ()
569- .setMapSize (1 , ByteUnit .MEBIBYTES )
570- .setMaxDbs (1 )
571- .setMaxReaders (1 )
572- .addEnvFlag (MDB_NOSUBDIR )
573- .addEnvFlag (MDB_NOTLS ) // Should not overwrite the existing one
574- .open (file )) {
568+ Env .create ()
569+ .setMapSize (1 , ByteUnit .MEBIBYTES )
570+ .setMaxDbs (1 )
571+ .setMaxReaders (1 )
572+ .addEnvFlag (MDB_NOSUBDIR )
573+ .addEnvFlag (MDB_NOTLS ) // Should not overwrite the existing one
574+ .open (file )) {
575575 env .sync (true );
576576 assertThat (Files .isRegularFile (file )).isTrue ();
577577 }
@@ -581,15 +581,15 @@ void addEnvFlag() {
581581 void addEnvFlags () {
582582 final Path file = tempDir .createTempFile ();
583583 try (Env <ByteBuffer > env =
584- Env .create ()
585- .setMapSize (1 , ByteUnit .MEBIBYTES )
586- .setMaxDbs (1 )
587- .setMaxReaders (1 )
588- .addEnvFlags (EnvFlagSet .of (MDB_NOSUBDIR , MDB_NOTLS ))
589- .addEnvFlag (MDB_NOTLS ) // Should not overwrite the existing one
590- .addEnvFlag (null ) // no-op
591- .addEnvFlags (null ) // no-op
592- .open (file )) {
584+ Env .create ()
585+ .setMapSize (1 , ByteUnit .MEBIBYTES )
586+ .setMaxDbs (1 )
587+ .setMaxReaders (1 )
588+ .addEnvFlags (EnvFlagSet .of (MDB_NOSUBDIR , MDB_NOTLS ))
589+ .addEnvFlag (MDB_NOTLS ) // Should not overwrite the existing one
590+ .addEnvFlag (null ) // no-op
591+ .addEnvFlags (null ) // no-op
592+ .open (file )) {
593593 env .sync (true );
594594 assertThat (Files .isRegularFile (file )).isTrue ();
595595 }
@@ -599,50 +599,53 @@ void addEnvFlags() {
599599 void setEnvFlags_null1 () {
600600 final Path file = tempDir .createTempFile ();
601601 // MDB_NOSUBDIR is cleared out so it will error as file is a file not a dir
602- Assertions .assertThatThrownBy (() -> {
603- try (Env <ByteBuffer > env =
604- Env .create ()
605- .setMapSize (1 , ByteUnit .MEBIBYTES )
606- .setMaxDbs (1 )
607- .setMaxReaders (1 )
608- .addEnvFlag (MDB_NOSUBDIR )
609- .setEnvFlags ((Collection <EnvFlags >) null ) // Clears the flags
610- .open (file )) {
611- }
612- }).isInstanceOf (LmdbNativeException .class );
602+ Assertions .assertThatThrownBy (
603+ () -> {
604+ try (Env <ByteBuffer > env =
605+ Env .create ()
606+ .setMapSize (1 , ByteUnit .MEBIBYTES )
607+ .setMaxDbs (1 )
608+ .setMaxReaders (1 )
609+ .addEnvFlag (MDB_NOSUBDIR )
610+ .setEnvFlags ((Collection <EnvFlags >) null ) // Clears the flags
611+ .open (file )) {}
612+ })
613+ .isInstanceOf (LmdbNativeException .class );
613614 }
614615
615616 @ Test
616617 void setEnvFlags_null2 () {
617618 final Path file = tempDir .createTempFile ();
618619 // MDB_NOSUBDIR is cleared out so it will error as file is a file not a dir
619- Assertions .assertThatThrownBy (() -> {
620- try (Env <ByteBuffer > env =
621- Env .create ()
622- .setMapSize (1 , ByteUnit .MEBIBYTES )
623- .setMaxDbs (1 )
624- .setMaxReaders (1 )
625- .addEnvFlag (MDB_NOSUBDIR )
626- .setEnvFlags ((EnvFlags ) null ) // Clears the flags
627- .open (file )) {
628- }
629- }).isInstanceOf (LmdbNativeException .class );
620+ Assertions .assertThatThrownBy (
621+ () -> {
622+ try (Env <ByteBuffer > env =
623+ Env .create ()
624+ .setMapSize (1 , ByteUnit .MEBIBYTES )
625+ .setMaxDbs (1 )
626+ .setMaxReaders (1 )
627+ .addEnvFlag (MDB_NOSUBDIR )
628+ .setEnvFlags ((EnvFlags ) null ) // Clears the flags
629+ .open (file )) {}
630+ })
631+ .isInstanceOf (LmdbNativeException .class );
630632 }
631633
632634 @ Test
633635 void setEnvFlags_null3 () {
634636 final Path file = tempDir .createTempFile ();
635637 // MDB_NOSUBDIR is cleared out so it will error as file is a file not a dir
636- Assertions .assertThatThrownBy (() -> {
637- try (Env <ByteBuffer > env =
638- Env .create ()
639- .setMapSize (1 , ByteUnit .MEBIBYTES )
640- .setMaxDbs (1 )
641- .setMaxReaders (1 )
642- .addEnvFlag (MDB_NOSUBDIR )
643- .setEnvFlags ((EnvFlagSet ) null ) // Clears the flags
644- .open (file )) {
645- }
646- }).isInstanceOf (LmdbNativeException .class );
638+ Assertions .assertThatThrownBy (
639+ () -> {
640+ try (Env <ByteBuffer > env =
641+ Env .create ()
642+ .setMapSize (1 , ByteUnit .MEBIBYTES )
643+ .setMaxDbs (1 )
644+ .setMaxReaders (1 )
645+ .addEnvFlag (MDB_NOSUBDIR )
646+ .setEnvFlags ((EnvFlagSet ) null ) // Clears the flags
647+ .open (file )) {}
648+ })
649+ .isInstanceOf (LmdbNativeException .class );
647650 }
648651}
0 commit comments