Fix Gatekeeper unit test

Change-Id: I13bec83902ef431254b6f9541db80573d7360c2d
diff --git a/tests/gatekeeper_device_test.cpp b/tests/gatekeeper_device_test.cpp
index d2283ec..147bd07 100644
--- a/tests/gatekeeper_device_test.cpp
+++ b/tests/gatekeeper_device_test.cpp
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#include <endian.h>
 #include <gtest/gtest.h>
 #include <hardware/gatekeeper.h>
 #include <gatekeeper/gatekeeper.h> // For password_handle_t
@@ -97,7 +98,7 @@
     hat = reinterpret_cast<hw_auth_token_t *>(auth_token);
 
     ASSERT_EQ(HW_AUTH_TOKEN_VERSION, hat->version);
-    ASSERT_EQ(HW_AUTH_PASSWORD, hat->authenticator_type);
+    ASSERT_EQ(htonl(HW_AUTH_PASSWORD), hat->authenticator_type);
 }
 
 TEST_F(GateKeeperDeviceTest, EnrollAndVerifyTimeout) {