테스트케이스가 실패하지 않았는데 빌드에 실패하는 문제 #63
-
|
테스트케이스가 실패하지 않았는데 빌드에 실패하는 문제가 발생하여 질문드립니다. TestParamType("가", "ac00")을 주고 인위적으로 정답을 만들기 위해 추가 정보 TEST_P(UTF16CharsetTestFixture, EncodingTest)
{
openCharset();
std::string source;
std::string expectedResult;
std::tie(source, expectedResult) = GetParam();
HexVector actualResult = charset->encode(source);
EXPECT_EQ(actualResult.toString(), expectedResult);
}Build OutputSourceeuphony/src/main/cpp/core/UTF16Charset.h #ifndef EUPHONY_UTF16CHARSET_H
#define EUPHONY_UTF16CHARSET_H
#include "Charset.h"
namespace Euphony {
class UTF16Charset : public Charset {
public:
UTF16Charset() = default;
~UTF16Charset() = default;
HexVector encode(std::string src);
std::string decode(const HexVector &src);
};
}
#endif //EUPHONY_UTF16CHARSET_Heuphony/src/main/cpp/core/source/UTF16Charset.cpp #include "../UTF16Charset.h"
#include <sstream>
#include <iomanip>
using namespace Euphony;
HexVector UTF16Charset::encode(std::string src) {
std::vector<u_int8_t> source = std::vector<u_int8_t> { 0xa, 0xc, 0x0, 0x0 };
HexVector result = HexVector(source);
return result;
}
std::string UTF16Charset::decode(const HexVector &src) {
std::string result;
std::string stringSrc = src.toString();
result = "가";
return "가";
}euphony/src/main/cpp/tests/utf16CharsetTest.cpp #include <gtest/gtest.h>
#include <Definitions.h>
#include <UTF16Charset.h>
#include <tuple>
using namespace Euphony;
typedef std::tuple<std::string, std::string> TestParamType;
class UTF16CharsetTestFixture : public ::testing::TestWithParam<TestParamType> {
public:
void openCharset() {
EXPECT_EQ(charset, nullptr);
charset = new UTF16Charset();
ASSERT_NE(charset, nullptr);
}
Charset* charset = nullptr;
};
TEST_P(UTF16CharsetTestFixture, EncodingTest)
{
openCharset();
std::string source;
std::string expectedResult;
std::tie(source, expectedResult) = GetParam();
HexVector actualResult = charset->encode(source);
EXPECT_EQ(actualResult.toString(), expectedResult);
}
TEST_P(UTF16CharsetTestFixture, DecodingTest)
{
openCharset();
std::string source;
std::string expectedResult;
std::tie(expectedResult, source) = GetParam();
HexVector hv = HexVector(source);
std::string actualResult = charset->decode(hv);
EXPECT_EQ(actualResult, expectedResult);
}
INSTANTIATE_TEST_CASE_P(
ChrasetDecodingTestSuite,
UTF16CharsetTestFixture,
::testing::Values(
TestParamType("가", "ac00")
)); |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 80 replies
-
|
문자 그대로 gtest 실패가 아닌 ninja의 빌드 실패인데 잘 모르겠네요.. |
Beta Was this translation helpful? Give feedback.
-
|
EncodingTest 이름을 UTF16EncodingTest 등으로 바꿔도 문제가 발생하나요?! |
Beta Was this translation helpful? Give feedback.
-
|
혹시 몰라서 제가 PR 하기 이전, 지웅멘토님이 마지막으로 커밋하신 상태로 가서 utf16 테스트 코드를 붙여서 돌려봤는데도 여전히 같은 에러가 발생해요! |
Beta Was this translation helpful? Give feedback.
-
정말 신기한 문제네요!! |
Beta Was this translation helpful? Give feedback.
-
|
일단 제가 테스트 한 바로는 이렇게 됩니다! @designe 멘토님 혹시 Pixel, API 28 실패하셨나요? arm64-v8a + API 30 성공 성공 = utf16 테스트케이스를 정확히 주면 빌드 성공/ 이상하게 주면 gtest 에러 발생 |
Beta Was this translation helpful? Give feedback.
-
|
아래와 같이 adb shell 접속한 상태에서 유닛테스트를 실행하면 에러없이 깔끔하게 떨어지는데 adb shell
cd /data/local/tmp/testEuphony/x86/
LD_LIBRARY_PATH=./ ./testEuphony아래는 에러가 발생하는군요. Segmentation Fault adb shell LD_LIBRARY_PATH=/data/local/tmp/testEuphony/x86/ /data/local/tmp/testEuphony/x86/testEuphony |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
API28을 통해 빌드하는 경우, warning으로 알려주면 해당 이슈에 대한 좋은 솔루션이 될 수 있을 것 같네요! |
Beta Was this translation helpful? Give feedback.








정말 신기한 문제네요!!