33 *
44 * RED phase: These tests define the expected behavior for all 64 languages.
55 */
6+ #include "../src/foundation/compat.h"
67#include "test_framework.h"
78#include "discover/discover.h"
89
@@ -542,7 +543,7 @@ TEST(lang_name_unknown) {
542543/* These tests need temp files with content markers */
543544TEST (lang_m_objc ) {
544545 /* Write a temp file with Objective-C markers */
545- const char * path = "/tmp/ test_lang_objc.m" ;
546+ char path [ 256 ]; snprintf ( path , sizeof ( path ), "%s/ test_lang_objc.m", cbm_tmpdir ()) ;
546547 FILE * f = fopen (path , "w" );
547548 ASSERT_NOT_NULL (f );
548549 fprintf (f , "#import <Foundation/Foundation.h>\n@interface Foo : NSObject\n@end\n" );
@@ -554,7 +555,7 @@ TEST(lang_m_objc) {
554555}
555556
556557TEST (lang_m_magma ) {
557- const char * path = "/tmp/ test_lang_magma.m" ;
558+ char path [ 256 ]; snprintf ( path , sizeof ( path ), "%s/ test_lang_magma.m", cbm_tmpdir ()) ;
558559 FILE * f = fopen (path , "w" );
559560 ASSERT_NOT_NULL (f );
560561 fprintf (f , "function MyFunc(x)\n return x^2;\nend function;\n" );
@@ -566,7 +567,7 @@ TEST(lang_m_magma) {
566567}
567568
568569TEST (lang_m_matlab ) {
569- const char * path = "/tmp/ test_lang_matlab.m" ;
570+ char path [ 256 ]; snprintf ( path , sizeof ( path ), "%s/ test_lang_matlab.m", cbm_tmpdir ()) ;
570571 FILE * f = fopen (path , "w" );
571572 ASSERT_NOT_NULL (f );
572573 fprintf (f , "function y = square(x)\n y = x.^2;\nend\n" );
0 commit comments