[前][次][番号順一覧][スレッド一覧]

ruby-changes:26854

From: nobu <ko1@a...>
Date: Wed, 23 Jan 2013 16:16:27 +0900 (JST)
Subject: [ruby-changes:26854] nobu:r38906 (trunk): mkmf.rb: try_constant tests

nobu	2013-01-23 16:16:16 +0900 (Wed, 23 Jan 2013)

  New Revision: 38906

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38906

  Log:
    mkmf.rb: try_constant tests
    
    * test/mkmf/test_constant.rb: tests for try_constant.
      TODO: define check_constant and use it.

  Added files:
    trunk/test/mkmf/test_constant.rb
  Modified files:
    trunk/ChangeLog

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38905)
+++ ChangeLog	(revision 38906)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jan 23 16:16:14 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/mkmf/test_constant.rb: tests for try_constant.
+	  TODO: define check_constant and use it.
+
 Wed Jan 23 13:35:37 2013  Koichi Sasada  <ko1@a...>
 
 	* thread_pthread.c (ruby_init_stack): ignore `STACK_END_ADDRESS'
Index: test/mkmf/test_constant.rb
===================================================================
--- test/mkmf/test_constant.rb	(revision 0)
+++ test/mkmf/test_constant.rb	(revision 38906)
@@ -0,0 +1,18 @@ https://github.com/ruby/ruby/blob/trunk/test/mkmf/test_constant.rb#L1
+require_relative 'base'
+
+class TestMkmf
+  class TestTryConstant < TestMkmf
+    def test_simple
+      assert_equal( 0, mkmf {try_constant("0")}, MKMFLOG)
+      assert_equal( 1, mkmf {try_constant("1")}, MKMFLOG)
+      assert_equal(-1, mkmf {try_constant("-1")}, MKMFLOG)
+    end
+
+    def test_sizeof
+      assert_equal(config_value("SIZEOF_INT").to_i, mkmf {try_constant("sizeof(int)")}, MKMFLOG)
+      assert_equal(config_value("SIZEOF_LONG").to_i, mkmf {try_constant("sizeof(long)")}, MKMFLOG)
+      assert_equal(config_value("SIZEOF_VOIDP").to_i, mkmf {try_constant("sizeof(void*)")}, MKMFLOG)
+      assert_equal(config_value("SIZEOF_VALUE").to_i, mkmf {try_constant("sizeof(Qnil)")}, MKMFLOG)
+    end
+  end
+end

Property changes on: test/mkmf/test_constant.rb
___________________________________________________________________
Added: svn:eol-style
   + LF


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]