File tree 5 files changed +13
-4
lines changed
tests/idk/constexpr_inline_struggles
5 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 42
42
ZTD_USE (ZTD_EXTERN_C_OPEN )
43
43
44
44
extern const char * ztd_idk_tests_c_foo ;
45
+ extern const size_t ztd_idk_tests_c_foo_size ;
45
46
size_t ztd_idk_tests_use_size (const char * p );
46
47
size_t ztd_idk_tests_use_size_cpp (const char * p );
47
48
Original file line number Diff line number Diff line change 30
30
31
31
#include <uses_size.h>
32
32
33
- const char * ztd_idk_tests_c_foo = "foo!?#jdkgniofkwgeunwgjgwbuohi904h" ;
33
+ const char * ztd_idk_tests_c_foo = "foo!?#jdkgniofkwgeunwgjgwbuohi904h" ;
34
+ const size_t ztd_idk_tests_c_foo_size = 34 ;
Original file line number Diff line number Diff line change 33
33
int main (int argc , char * argv []) {
34
34
(void )argc ;
35
35
(void )argv ;
36
- return ztd_idk_tests_use_size (ztd_idk_tests_c_foo ) + ztd_idk_tests_use_size_cpp (ztd_idk_tests_c_foo );
36
+ const size_t expected = ztd_idk_tests_c_foo_size * 2 ;
37
+ if (expected != ztd_idk_tests_use_size (ztd_idk_tests_c_foo )) {
38
+ return 1 ;
39
+ }
40
+ if (expected != ztd_idk_tests_use_size_cpp (ztd_idk_tests_c_foo )) {
41
+ return 2 ;
42
+ }
43
+ return 0 ;
37
44
}
Original file line number Diff line number Diff line change 35
35
#include <stddef.h>
36
36
37
37
ZTD_USE (ZTD_EXTERN_C ) size_t ztd_idk_tests_use_size (const char * p ) {
38
- return ztdc_c_string_ptr_size (p ) + ztdc_c_string_ptr_size_limit (256 , p );
38
+ return ztdc_c_string_ptr_size_c (p ) + ztdc_c_string_ptr_size_limit_c (256 , p );
39
39
}
Original file line number Diff line number Diff line change 35
35
#include < cstddef>
36
36
37
37
ZTD_USE (ZTD_EXTERN_C) size_t ztd_idk_tests_use_size_cpp(const char * p) {
38
- return ztdc_c_string_ptr_size (p) + ztdc_c_string_ptr_size_limit (256 , p);
38
+ return ztdc_c_string_ptr_size_c (p) + ztdc_c_string_ptr_size_limit_c (256 , p);
39
39
}
You can’t perform that action at this time.
0 commit comments