Skip to content

Commit

Permalink
Split apart array tests and give them some more consistent organisation.
Browse files Browse the repository at this point in the history
Array tests have been broken into:
    array_test.cc: Static definition tests.
    local_array_test.cc: Exercises `LocalArray` directly.
    local_array_test.cc: Exercises iterators, rank 1+.
    local_array_method_test.cc: Use of rank 1 LocalArrays in functions.
    local_array_method_multidimensional_test.cc: Use of rank 2+ LocalArrays in functions.
    local_array_field_test.cc: Use of rank 1 LocalArrays in fields.
    local_array_field_multidimensional_test.cc: (TODO) Use of rank 2+ LocalArrays in fields.
    local_string_test.cc: String related array tests (rank 1+).

Method tests have been split into 3 sections, "as return" for return focused tests, "as param" for param focused tests, and "complex" where they are used for both.

Also, Tests have had some renaming to understand their use more simply (where possible).

JNI signatures are now used, but instead of [[, the rank is written (as [ is forbidden in test name).

e.g. method signature
    Return{LocalArray<int, 2>}, Params{Array<float>{}} becomes,
    "F_2I"

PiperOrigin-RevId: 583674129
  • Loading branch information
jwhpryor authored and copybara-github committed Nov 19, 2023
1 parent db5ecf9 commit 83da03e
Show file tree
Hide file tree
Showing 13 changed files with 950 additions and 866 deletions.
1 change: 1 addition & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ cc_library(
"//implementation:params",
"//implementation:promotion_mechanics",
"//implementation:promotion_mechanics_tags",
"//implementation:ref_base",
"//implementation:return",
"//implementation:selector_static_info",
"//implementation:self",
Expand Down
62 changes: 58 additions & 4 deletions implementation/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ cc_library(
],
)

cc_test(
name = "array_test",
srcs = ["array_test.cc"],
deps = [
":fake_test_constants",
"//:jni_bind",
"//:jni_test",
"@googletest//:gtest_main",
],
)

cc_library(
name = "array_ref",
hdrs = ["array_ref.h"],
Expand All @@ -45,8 +56,41 @@ cc_library(
)

cc_test(
name = "array_test",
srcs = ["array_test.cc"],
name = "local_array_iteration_test",
srcs = ["local_array_iteration_test.cc"],
deps = [
":fake_test_constants",
"//:jni_bind",
"//:jni_test",
"@googletest//:gtest_main",
],
)

cc_test(
name = "local_array_method_test",
srcs = ["local_array_method_test.cc"],
deps = [
":fake_test_constants",
"//:jni_bind",
"//:jni_test",
"@googletest//:gtest_main",
],
)

cc_test(
name = "local_array_method_multidimensional_test",
srcs = ["local_array_method_multidimensional_test.cc"],
deps = [
":fake_test_constants",
"//:jni_bind",
"//:jni_test",
"@googletest//:gtest_main",
],
)

cc_test(
name = "local_array_string_test",
srcs = ["local_array_string_test.cc"],
deps = [
":fake_test_constants",
"//:jni_bind",
Expand Down Expand Up @@ -987,8 +1031,18 @@ cc_library(
)

cc_test(
name = "signature_test",
srcs = ["signature_test.cc"],
name = "signature_method_test",
srcs = ["signature_method_test.cc"],
deps = [
"//:jni_bind",
"//:jni_test",
"@googletest//:gtest_main",
],
)

cc_test(
name = "signature_field_test",
srcs = ["signature_field_test.cc"],
deps = [
"//:jni_bind",
"//:jni_test",
Expand Down
Loading

0 comments on commit 83da03e

Please sign in to comment.