Skip to content

Commit

Permalink
Merge pull request #183 from bhamail/test-getFieldOrder
Browse files Browse the repository at this point in the history
Test Structure.getFieldOrder()

All Structure warnings are solved, so I'm going to commit this.

BTW, I saw something odd ("has unknown size" error) when instantiating an empty Structure (one with no instance fields). Please see the @todo comments in com.sun.jna.StructureFieldOrderInspectorTest.java. Restore the test: testCheckMethodGetFieldOrderStaticFieldOnlyStatic() to reproduce the behavior.
  • Loading branch information
bhamail committed Jan 25, 2013
2 parents 1a9d2da + 9da1b45 commit d9fb94a
Show file tree
Hide file tree
Showing 19 changed files with 4,540 additions and 4,101 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Next Release (3.5.2)
====================

Bug Fixes
---------
* [#183](https://github.com/twall/jna/pull/183): Fix LMAccess.GROUP_INFO_3.getFieldOrder() to return correct fields names. - [@bhamail](https://github.com/bhamail).

Features
--------
* [#163](https://github.com/twall/jna/pull/163): The Java `GUID` structure can be used directly as alternative to `Ole32Util.getGUIDFromString()` - [@wolftobias](https://github.com/wolftobias).
Expand All @@ -10,6 +14,7 @@ Features
* [#178](https://github.com/twall/jna/pull/178): Added Win32 `USER_INFO_10` structure from `LMAccess.h` - [@davidmc24](https://github.com/davidmc24).
* [#174](https://github.com/twall/jna/pull/174): Recompile linux-amd64 natives to remove glibc-2.11 dependencies, now requires only 2.2.5 or better - [@twall](https://github.com/twall).
* [#180](https://github.com/twall/jna/pull/180): Fix: added missing fields in `XEvents.getFieldOrder()` - [@xwizard](https://github.com/xwizard).
* [#183](https://github.com/twall/jna/pull/183): Added StructureFieldOrderInspector unit test utility to scan for Structure field issues. See: com.sun.jna.platform.StructureFieldOrderTest.testMethodGetFieldOrder() - [@bhamail](https://github.com/bhamail).

Release 3.5.1
====================
Expand Down
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@
<fileset dir="lib">
<include name="junit.jar"/>
</fileset>
<fileset dir="lib/test"/>
<pathelement path="${classes}"/>
</path>
</path>
Expand Down
129 changes: 70 additions & 59 deletions contrib/platform/nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -1,59 +1,70 @@
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/platform.jar
dist.javadoc.dir=${dist.dir}/javadoc
file.reference.jna.jar=../../build/jna.jar
libs.junit.classpath=../../lib/junit.jar
jar.compress=false
javac.classpath=\
${file.reference.jna.jar};
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=src
test.src.dir=test
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/platform.jar
dist.javadoc.dir=${dist.dir}/javadoc
file.reference.jna.jar=../../build/jna.jar
file.reference.jna-d64.jar=../../build-d64/jna.jar
file.reference.jna-test.jar=../../build/jna-test.jar
file.reference.jna-test-d64.jar=../../build-d64/jna-test.jar
libs.junit.classpath=../../lib/junit.jar
jar.compress=false
javac.classpath=\
${file.reference.jna.jar}:\
${file.reference.jna-d64.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${file.reference.jna-test.jar}:\
${file.reference.jna-test-d64.jar}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
../../lib/test/reflections-0.9.8.jar:\
../../lib/test/guava-11.0.2.jar:\
../../lib/test/javassist-3.12.1.GA.jar:\
../../lib/test/slf4j-api-1.6.1.jar:\
../../lib/test/dom4j-1.6.1.jar:\
${build.test.classes.dir}
src.dir=src
test.src.dir=test
14 changes: 7 additions & 7 deletions contrib/platform/src/com/sun/jna/platform/unix/X11.java
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ class XUnmapEvent extends Structure {
public Window window;
public int from_configure;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "event", "window", "from_configure" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "from_configure" });
}
}

Expand All @@ -1623,7 +1623,7 @@ class XMapEvent extends Structure {
public Window window;
public int override_redirect; // boolean, is override set...
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "event", "window", "override_redirect" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "override_redirect" });
}
}

Expand All @@ -1635,7 +1635,7 @@ class XMapRequestEvent extends Structure {
public Window parent;
public Window window;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "parent", "window" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window" });
}
}

Expand All @@ -1650,7 +1650,7 @@ class XReparentEvent extends Structure {
public int x, y;
public int override_redirect;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "event", "window", "parent", "x", "y", "override_redirect" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "override_redirect" });
}
}

Expand All @@ -1667,7 +1667,7 @@ class XConfigureEvent extends Structure {
public Window above;
public int override_redirect;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display","event", "window", "x", "y", "width", "height", "border_width", "above", "override_redirect" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "border_width", "above", "override_redirect" });
}
}

Expand All @@ -1680,7 +1680,7 @@ class XGravityEvent extends Structure {
public Window window;
public int x, y;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "event", "window", "x", "y" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y" });
}
}

Expand Down Expand Up @@ -1710,7 +1710,7 @@ class XConfigureRequestEvent extends Structure {
public int detail; // Above, Below, TopIf, BottomIf, Opposite
public NativeLong value_mask;
protected List getFieldOrder() {
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "parent", "window", "x", "y", "width", "height", "border_width", "above", "detail", "value_mask" });
return Arrays.asList(new String[] { "type", "serial", "send_event", "display", "window", "x", "y", "width", "height", "above", "detail", "value_mask" });
}
}

Expand Down
46 changes: 1 addition & 45 deletions contrib/platform/src/com/sun/jna/platform/win32/LMAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,50 +154,6 @@ protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri1_name", "usri1_password", "usri1_password_age", "usri1_priv", "usri1_home_dir", "usri1_comment", "usri1_flags", "usri1_script_path" });
}
}

/**
* The USER_INFO_10 structure contains information about a user account,
* including the account name, comments associated with the account, and
* the user's full name.
*/
public static class USER_INFO_10 extends Structure {
public USER_INFO_10() {
super();
}

public USER_INFO_10(Pointer memory) {
super(memory);
read();
}

/**
* Pointer to a Unicode string that specifies the name of the user
* account. Calls to the NetUserSetInfo function ignore this member.
*/
public WString usri10_name;
/**
* Pointer to a Unicode string that contains a comment associated with
* the user account. The string can be a null string, or can have any
* number of characters before the terminating null character.
*/
public WString usri10_comment;
/**
* Pointer to a Unicode string that contains a user comment. This
* string can be a null string, or it can have any number of characters
* before the terminating null character.
*/
public WString usri10_usr_comment;
/**
* Pointer to a Unicode string that contains the full name of the user.
* This string can be a null string, or it can have any number of
* characters before the terminating null character.
*/
public WString usri10_full_name;

protected List getFieldOrder() {
return Arrays.asList(new String[] { "usri10_name", "usri10_comment", "usri10_usr_comment", "usri10_full_name" });
}
}

/**
* The USER_INFO_23 structure contains information about a user account,
Expand Down Expand Up @@ -455,7 +411,7 @@ public GROUP_INFO_3(Pointer memory) {
public int grpi3_attributes;

protected List getFieldOrder() {
return Arrays.asList(new String[] { "grpi3_name", "grpi3_comment", "grpi3_group_id", "grpi3_attributes" });
return Arrays.asList(new String[] { "grpi3_name", "grpi3_comment", "grpi3_group_sid", "grpi3_attributes" });
}
}

Expand Down
Loading

0 comments on commit d9fb94a

Please sign in to comment.