Skip to content

Commit

Permalink
Fix of #676
Browse files Browse the repository at this point in the history
  • Loading branch information
ogawaffm committed Aug 26, 2024
1 parent 9f4ad4c commit 0b566c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Source/com/drew/imaging/FileType.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public enum FileType
// Only file detection
Aac("AAC", "Advanced Audio Coding", "audio/aac", "m4a"),
Asf("ASF", "Advanced Systems Format", "video/x-ms-asf", "asf", "wma", "wmv"),
Cfbf("CFBF", "Compound File Binary Format", null, (String[])null),
Cfbf("CFBF", "Compound File Binary Format", null),
Flv("FLV", "Flash Video", "video/x-flv", ".flv", ".f4v,"),
Indd("INDD", "INDesign Document", "application/octet-stream", ".indd"),
Mxf("MXF", "Material Exchange Format", "application/mxf", "mxf"),
Expand All @@ -88,9 +88,9 @@ public enum FileType
@NotNull private final String _name;
@NotNull private final String _longName;
@Nullable private final String _mimeType;
private final String[] _extensions;
@NotNull private final String[] _extensions;

FileType(@NotNull String name, @NotNull String longName, @Nullable String mimeType, String... extensions)
FileType(@NotNull String name, @NotNull String longName, @Nullable String mimeType, @NotNull String... extensions)
{
_name = name;
_longName = longName;
Expand Down
12 changes: 11 additions & 1 deletion Tests/com/drew/imaging/FileTypeTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 Drew Noakes and contributors
* Copyright 2002-2024 Drew Noakes and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,6 +24,7 @@

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

public class FileTypeTest
Expand All @@ -41,4 +42,13 @@ public void testExtensions()

assertNull(FileType.Unknown.getCommonExtension());
}

@Test
public void testCommonExtension()
{
for (FileType fileType : FileType.values()) {
String[] extensions = fileType.getAllExtensions();
assertNotNull(fileType.name(), extensions);
}
}
}

0 comments on commit 0b566c0

Please sign in to comment.