[compute/cker] Reduce duplicated code and Fix wrong shape size.#15158
[compute/cker] Reduce duplicated code and Fix wrong shape size.#15158chunseoklee merged 2 commits intoSamsung:masterfrom
Conversation
|
This PR reduces duplicated code and fixes a test error(#15030 (comment)) introduced in #15155. |
c3779bd to
0697d3f
Compare
This commit refactors dims storage initialization of Shape. - Reduce duplicated code - Fix wrong shape size ONE-DCO-1.0-Signed-off-by: ragmani <ragmani0216@gmail.com>
0697d3f to
a99b62a
Compare
ee15559 to
447c678
Compare
| { | ||
| ::testing::InitGoogleTest(&argc, argv); | ||
|
|
||
| ::testing::GTEST_FLAG(death_test_style) = "threadsafe"; |
There was a problem hiding this comment.
I set ::testing::GTEST_FLAG(death_test_style) = "threadsafe"; to ensure that death tests are executed in a thread-safe manner. This forces GoogleTest to spawn a new process using exec() instead of using fork(), which is safer when multiple threads are running. "Additionally, with this flag, GoogleTest no longer generates the following warning message."
[WARNING] /working_directory/ONE/externals/GTEST/googletest/src/gtest-death-test.cc:1108:: Death tests use fork(), which is unsafe particularly in a threaded context. For this test, Google Test detected 17 threads. See https://github.com/google/googletest/blob/master/docs/advanced.md#death-tests-and-threads for more explanation and suggested solutions, especially if this is the last message you see before your test times out
You can find more details in the offical documentation:
…ializations. - Add Shape unittests. ONE-DCO-1.0-Signed-off-by: ragmani <ragmani0216@gmail.com>
|
|
||
| // Constructor that creates a shape of given size and fills all dimensions with "value". | ||
| Shape(int shape_size, int32_t value) : _size(0) | ||
| Shape(int shape_size, int32_t value) : _size(shape_size) |
There was a problem hiding this comment.
This generated test errors because this constructor did not apply shape_size to _size anywhere.
447c678 to
ea488a8
Compare
|
I checked that tests pass on my local machine. $ Product/x86_64-linux.debug/out/unittest/nnfw_api_gtest
...
[==========] 685 tests from 36 test suites ran. (811 ms total)
[ PASSED ] 685 tests.$ Product/x86_64-linux.debug/out/unittest/test_cker
...
[==========] 83 tests from 4 test suites ran. (1760 ms total)
[ PASSED ] 83 tests. |
This commit refactors dims storage initialization of Shape.
ONE-DCO-1.0-Signed-off-by: ragmani ragmani0216@gmail.com