Skip to content

Commit 3e2c437

Browse files
committed
Fix build test for windows
1 parent 2447a52 commit 3e2c437

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/tests/test_line_parser.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,31 @@ Official Source Code: https://github.com/wsjcpp/wsjcpp-yaml
2525
*/
2626

2727
#include <iostream>
28+
#include <sstream>
29+
#include <string>
2830
#include <wsjcpp_yaml.h>
2931

32+
std::string test_line_parser_WSJCPP_INT_TO_STR(int number) {
33+
#if defined(__CODEGEARC__) && !defined(_WIN64)
34+
// TODO
35+
char buffer[] = {
36+
0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
37+
0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
38+
0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0,
39+
0x0,0x0,0x0,0x0, 0x0,0x0,0x0,0x0
40+
};
41+
#if __CODEGEARC__ == 0x0770
42+
// 12.2
43+
_itoa(number, buffer, 10);
44+
#else
45+
itoa(number, buffer, 10);
46+
#endif
47+
return std::string(buffer);
48+
#else
49+
return std::to_string(number);
50+
#endif
51+
}
52+
3053
int main() {
3154
struct LineTest {
3255
LineTest(
@@ -118,7 +141,7 @@ int main() {
118141

119142
for (int i = 0; i < vTestLines.size(); i++) {
120143
LineTest test = vTestLines[i];
121-
std::string tagline = "{line:" + std::to_string(test.nNumberOfTest) + ": '" + test.sLine + "'}";
144+
std::string tagline = "{line:" + test_line_parser_WSJCPP_INT_TO_STR(test.nNumberOfTest) + ": '" + test.sLine + "'}";
122145

123146
WsjcppYamlParsebleLine line(test.nNumberOfTest);
124147
std::string sError;

0 commit comments

Comments
 (0)